51 static polito_EXPORT int savePolytope(
const string& pathA, boost::shared_ptr<Polytope_Rn>& A);
57 static polito_EXPORT int savePolyhedralCone(
const string& pathA, boost::shared_ptr<PolyhedralCone_Rn>& A);
63 static polito_EXPORT int loadPolytope(
const string& pathA, boost::shared_ptr<Polytope_Rn>& A);
69 static polito_EXPORT int loadPolyhedralCone(
const string& pathA, boost::shared_ptr<PolyhedralCone_Rn>& A);
75 static polito_EXPORT int addHalfspace(boost::shared_ptr<Polytope_Rn>& A,
const boost::shared_ptr<HalfSpace_Rn>& HS);
81 static polito_EXPORT int addGenerator(boost::shared_ptr<Polytope_Rn>& A,
const boost::shared_ptr<Generator_Rn>& GN);
87 static polito_EXPORT int computeDoubleDescription(boost::shared_ptr<Polytope_Rn>& A,
double bb_size);
95 static polito_EXPORT int computeDoubleDescriptionWithoutCheck(boost::shared_ptr<Polytope_Rn>& A,
double bb_size=1000.);
102 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);
114 static polito_EXPORT int computeIntersectionWithoutCheck(boost::shared_ptr<Polytope_Rn>& A,
const boost::shared_ptr<Polytope_Rn>& B);
120 static polito_EXPORT bool isIncluded(
const boost::shared_ptr<Polytope_Rn>& A,
const boost::shared_ptr<Polytope_Rn>& B);
127 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);
133 static polito_EXPORT int computeMinkowskiSumOfPolytopes(
const std::vector< boost::shared_ptr<Polytope_Rn> >& arrayOfPol, boost::shared_ptr<Polytope_Rn>& C);
141 static polito_EXPORT int computeMinkowskiSumOfPolytopes(
const boost::shared_ptr<Polytope_Rn>& A,
142 const boost::shared_ptr<Polytope_Rn>& B,
143 boost::shared_ptr<Polytope_Rn>& C,
144 const std::vector< std::vector<int> >& genitorsOfGeneratorsA,
145 const std::vector< std::vector<int> >& genitorsOfGeneratorsB,
146 std::vector< std::vector<int> >& traceGenerators);
154 static polito_EXPORT int checkEqualityOfPolytopes(
const boost::shared_ptr<Polytope_Rn>& A,
const boost::shared_ptr<Polytope_Rn>& B,
bool getFaceMapping=
false);
161 static polito_EXPORT bool checkEqualityOfVertices(
const boost::shared_ptr<Polytope_Rn>& A,
const boost::shared_ptr<Polytope_Rn>& B);
166 static polito_EXPORT int checkTopologyAndGeometry(
const boost::shared_ptr<PolyhedralCone_Rn>& A,
bool check_all=
false);
172 static polito_EXPORT int makeCube(boost::shared_ptr<Polytope_Rn>& A,
double M);
185 static polito_EXPORT int PolarPolytope(
const boost::shared_ptr<Polytope_Rn>& original_pol, boost::shared_ptr<Polytope_Rn>& polar_pol);
191 static polito_EXPORT int Translate(boost::shared_ptr<Polytope_Rn>& pol,
const boost::numeric::ublas::vector<double>& v2t);
196 static polito_EXPORT double computeVolume(
const boost::shared_ptr<Polytope_Rn> P);
204 const boost::shared_ptr<Polytope_Rn>& A,
205 const boost::shared_ptr<Polytope_Rn>& B,
206 boost::shared_ptr<Polytope_Rn>& C,
207 const std::set< unsigned int >& firstOperandCaps,
208 const std::set< unsigned int >& secondOperandCaps,
209 std::set< unsigned int >& newCaps,
210 double bb_size=1000.);
218 const boost::shared_ptr<Polytope_Rn>& A,
219 const boost::shared_ptr<Polytope_Rn>& B,
220 boost::shared_ptr<Polytope_Rn>& C,
221 const std::set< unsigned int >& firstOperandCaps,
222 const std::set< unsigned int >& secondOperandCaps,
223 std::set< unsigned int >& newCaps,
224 double bb_size=1000.);
233 const boost::shared_ptr<Polytope_Rn>& inputSpace,
234 const std::vector<Point_Rn>& listOfSeeds,
235 std::vector< boost::shared_ptr<Polytope_Rn> >& VoronoiCells,
246 static int sum(
const boost::shared_ptr<T>& firstBody,
const boost::shared_ptr<T>& secondBody, boost::shared_ptr<T>& result) {
247 result = firstBody->sum(secondBody);
return TEST_OK;
250 static int sum(
const std::vector< boost::shared_ptr<T> >& allBodies, boost::shared_ptr<T>& result) {
251 result->sum(allBodies);
return TEST_OK;
254 static int intersect(
const boost::shared_ptr<T>& firstBody,
const boost::shared_ptr<T>& secondBody, boost::shared_ptr<T>& result) {
255 result = firstBody->intersect(secondBody);
return TEST_OK;
258 static int intersect(
const std::vector< boost::shared_ptr<T> >& allBodies, boost::shared_ptr<T>& result) {
259 result->intersect(allBodies);
return TEST_OK;
266 static bool isIncluded(
const boost::shared_ptr<T>& firstBody,
const boost::shared_ptr<T>& secondBody) {
267 return firstBody->isIncluded(secondBody);
275 static bool isIncluded(
const boost::shared_ptr<T>& firstBody,
const boost::shared_ptr<T>& secondBody,
double& minmaxDistance) {
276 return firstBody->isIncluded(secondBody, minmaxDistance);
280 body->resetConstantsOfAllHalfSpaces(cst);
284 return body->scalingFactor(factor);
288 return body->checkTopologyAndGeometry();
296 return T::getFileExtension();
299 static void save(
const std::string& pathA, boost::shared_ptr<T>& body) {
303 static void load(
const std::string& pathA, boost::shared_ptr<T>& body,
double bb_size=10000.) {
304 body->load(pathA, bb_size);
307 static void dump(std::ostream ¤t_ostream, boost::shared_ptr<T>& body) {
308 body->dump(current_ostream);