politopix  4.1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Polytope_Rn.h
Go to the documentation of this file.
1 // politopix allows to make computations on polytopes such as finding vertices, intersecting, Minkowski sums, ...
2 // Copyright (C) 2011-2016 : Delos Vincent
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
19 // I2M (UMR CNRS 5295 / University of Bordeaux)
20 
21 #ifndef POLYTOPE_Rn
22 #define POLYTOPE_Rn
23 
24 #include <boost/shared_ptr.hpp>
25 #include <stdexcept>
26 #include <exception>
27 #include <vector>
28 #include "polito_Export.h"
29 #include "PolyhedralCone_Rn.h"
30 #include "Generator_Rn.h"
31 #include "HalfSpace_Rn.h"
32 
35 
36  public:
39 
41  virtual ~Polytope_Rn() {}
42 
44  virtual bool isBounded() const {return true;}
45 
47  virtual unsigned int neigbourhoodCondition() const {return (dimension()-1);}
48 
50  virtual unsigned int numberOfGeneratorsPerFacet() const {return (dimension());}
51 
53  virtual void createBoundingSimplex(double M);
54 
56  virtual void createBoundingBox(double M);
57 
58  virtual bool checkEdges() const;
59 
64  bool checkEqualityOfVertices(const boost::shared_ptr<Polytope_Rn>& B, bool printOnScreen = false) const;
65 
68  virtual void createTruncatedGenerator(
69  const boost::shared_ptr<Generator_Rn_SD>& in,
70  const boost::shared_ptr<Generator_Rn_SD>& out,
71  boost::shared_ptr<Generator_Rn_SD> newV, double ay, double az, double b=0.) const;
72 
75  boost::shared_ptr<PolyhedralCone_Rn> getPrimalCone(unsigned int i) const throw (std::out_of_range);
76 
78  boost::shared_ptr<PolyhedralCone_Rn> getPrimalCone(const boost::shared_ptr<Generator_Rn>& vx) const;
79 
80 };
81 
82 #endif // POLYTOPE_Rn
virtual unsigned int numberOfGeneratorsPerFacet() const
Each facet in a polytope has got n vertices.
Definition: Polytope_Rn.h:50
virtual bool isBounded() const
Tell whether this polyhedron is bounded or not, polytopes are bounded.
Definition: Polytope_Rn.h:44
Model a polytope using its two equivalent definitions : the convex hull and the half-space intersecti...
Definition: Polytope_Rn.h:34
Polytope_Rn()
Constructor for polytopes i.e. bounded convex polyhedra.
Definition: Polytope_Rn.h:38
Model a polyhedral cone using its two equivalent definitions : the convex hull and the half-space int...
virtual bool checkEdges() const
Always true in the polyhedral cone case.
virtual void createBoundingBox(double)
At the moment this function is useless in the case of polyhedral cones.
virtual void createTruncatedGenerator(const boost::shared_ptr< Generator_Rn_SD > &y, const boost::shared_ptr< Generator_Rn_SD > &z, boost::shared_ptr< Generator_Rn_SD > newG, double ay, double az, double b=0.) const
Create the intersection edge in the truncating algorithm. It is defined by the intersection between a...
virtual void createBoundingSimplex(double)
At the moment this function is useless in the case of polyhedral cones.
virtual unsigned int neigbourhoodCondition() const
Two vertices are neighbours in a polytope <=> they share at least (n-1) facets.
Definition: Polytope_Rn.h:47
#define polito_EXPORT
Definition: polito_Export.h:15
virtual ~Polytope_Rn()
Destructor.
Definition: Polytope_Rn.h:41
virtual unsigned int dimension() const
Return the space dimension.