Go to the documentation of this file.
21 #include <boost/python.hpp>
22 #include <boost/python/suite/indexing/vector_indexing_suite.hpp>
24 using namespace boost::python;
28 static polito_EXPORT int computeMinkowskiSumOfPolytopesPy(
const boost::python::list& listOfPol, boost::shared_ptr<Polytope_Rn>& C) {
29 std::vector< boost::shared_ptr<Polytope_Rn> > arrayOfPol;
30 for (
unsigned int i=0; i<boost::python::len(listOfPol); ++i)
31 arrayOfPol.push_back(boost::python::extract< boost::shared_ptr<Polytope_Rn> >(listOfPol[i]));
46 class_<Generator_Rn, boost::shared_ptr<Generator_Rn> >(
"generator", init<>())
52 class_<HalfSpace_Rn, boost::shared_ptr<HalfSpace_Rn> >(
"halfspace", init<>())
60 class_<PolyhedralCone_Rn, boost::shared_ptr<PolyhedralCone_Rn> >(
"polyhedralcone", init<>())
67 class_<Polytope_Rn, boost::shared_ptr<Polytope_Rn>, bases<PolyhedralCone_Rn> >(
"polytope", init<>())
71 class_<politopixAPI>(
"politopix")
static polito_EXPORT int savePolytope(const string &pathA, boost::shared_ptr< Polytope_Rn > &A)
Save a polytope in the corresponding file name.
double getCoefficient(unsigned int i) const
int(* computeDoubleDescription1)(boost::shared_ptr< Polytope_Rn > &)
const boost::shared_ptr< HalfSpace_Rn > & getHalfSpace(unsigned int i) const
Return the i-th half-space.
void setCoordinate(unsigned int i, double val)
static boost::shared_ptr< Polytope_Rn > create()
Return s shared pointer on an empty polytope.
const boost::shared_ptr< Generator_Rn > & getGenerator(unsigned int i) const
Return the i-th generator.
static polito_EXPORT int computeMinkowskiSumOfPolytopes(const boost::shared_ptr< Polytope_Rn > &A, const boost::shared_ptr< Polytope_Rn > &B, boost::shared_ptr< Polytope_Rn > &C)
Compute the Minkowski sum between two HV-polytopes.
int(* computeMinkowskiSumOfPolytopes3)(const boost::python::list &, boost::shared_ptr< Polytope_Rn > &)
int(* computeMinkowskiSumOfPolytopes1)(const boost::shared_ptr< Polytope_Rn > &, const boost::shared_ptr< Polytope_Rn > &, boost::shared_ptr< Polytope_Rn > &)
BOOST_PYTHON_MODULE(libpolito)
unsigned int numberOfHalfSpaces() const
Get the total number of half-spaces.
void setConstant(double c)
void setCoefficient(unsigned int i, double c)
static polito_EXPORT unsigned int getDimension()
Return the dimension of the cartesian space we work in.
static polito_EXPORT int computeIntersection(const boost::shared_ptr< Polytope_Rn > &A, const boost::shared_ptr< Polytope_Rn > &B, boost::shared_ptr< Polytope_Rn > &C)
Compute the intersection between two HV-polytopes with the Double Description algorithm.
static polito_EXPORT double computeVolume(const boost::shared_ptr< Polytope_Rn > P)
Return the volume of the given polytope P with its double description. The implemented algorithm can ...
int(* computeMinkowskiSumOfPolytopes2)(const std::vector< boost::shared_ptr< Polytope_Rn > > &, boost::shared_ptr< Polytope_Rn > &)
static polito_EXPORT int computeDoubleDescription(boost::shared_ptr< Polytope_Rn > &A, double bb_size)
Compute the HV-description for a given H-polytope or V-polytope with the Double Description algorithm...
static polito_EXPORT int checkTopologyAndGeometry(const boost::shared_ptr< PolyhedralCone_Rn > &A, bool check_all=false)
Check whether a HV-polytopes is correct.
unsigned int numberOfGenerators() const
Give the total number of generators.
static polito_EXPORT int makeCube(boost::shared_ptr< Polytope_Rn > &A, double M)
Create a cube whose vertices will be (+-M, ..., +-M)
static polito_EXPORT int loadPolytope(const string &pathA, boost::shared_ptr< Polytope_Rn > &A)
Load a polytope from the corresponding file name.
double getCoordinate(unsigned int i) const
static polito_EXPORT void setTolerance(double t)
Give the minimum distance between two points.
int(* computeDoubleDescription2)(boost::shared_ptr< Polytope_Rn > &, double bb_size)
double getConstant() const
static polito_EXPORT void setDimension(unsigned int dim)
Set the dimension for the cartesian space we work in.
int(* computeIntersection)(const boost::shared_ptr< Polytope_Rn > &, const boost::shared_ptr< Polytope_Rn > &, boost::shared_ptr< Polytope_Rn > &)
static polito_EXPORT double getTolerance()
Give the minimum distance between two points.