politopix
4.1.0
|
Split a polytope into simplices to compute its volume.
Two Algorithms for Determining Volumes of Convex Polyhedra (1979) by Jacques Cohen and Timothy Hickey
Journal of the ACM (JACM) JACM Homepage archive
Volume 26 Issue 3, july 1979
Pages 401-414
More...
#include <VolumeOfPolytopes_Rn.h>
Public Member Functions | |
VolumeOfPolytopes_Rn (const boost::shared_ptr< Polytope_Rn > P) | |
Constructor. More... | |
~VolumeOfPolytopes_Rn () | |
void | splitCloudOfVertices (unsigned int DIM) |
void | check () const throw (std::domain_error) |
double | volume () |
Sum the volumes of all simplices partitionning the polytope. More... | |
double | computeSimplexVolume (const std::set< boost::shared_ptr< Generator_Rn > > &listOfSimplexVertices) const |
double | determinant (boost::numeric::ublas::matrix< double > a) const |
void | dump (std::ostream &this_ostream) |
void | dumpDS (std::ostream &this_ostream) const |
void | dumpAllSimplices (std::ostream &this_ostream) const |
Static Public Member Functions | |
static double | compute (const boost::shared_ptr< Polytope_Rn > P) |
Return the volume of the given polytope P. More... | |
Protected Attributes | |
std::vector< std::vector < unsigned int > > | _verticesByFacets |
The ordered list of all vertices stored by facets. More... | |
std::vector< std::vector < unsigned int > > | _facetsByVertices |
The ordered list of all facets stored by vertices. More... | |
std::vector< PolytopeToSimplexes > | _allSimplices |
List to store all the simplices partitioning the polytope. More... | |
boost::shared_ptr< Polytope_Rn > | _polytope |
The current polytope we are working on. More... | |
double | _volume |
The volume of the polytope. More... | |
unsigned int | _dimension |
As the algorithm goes down in lower dimensions, we want to store the starting space dimension. More... | |
unsigned int | _numberOfFacets |
The number of facets of the current polytope. More... | |
unsigned int | _numberOfVertices |
The number of vertices of the current polytope. More... | |
Split a polytope into simplices to compute its volume.
Two Algorithms for Determining Volumes of Convex Polyhedra (1979) by Jacques Cohen and Timothy Hickey
Journal of the ACM (JACM) JACM Homepage archive
Volume 26 Issue 3, july 1979
Pages 401-414
Definition at line 139 of file VolumeOfPolytopes_Rn.h.
VolumeOfPolytopes_Rn::VolumeOfPolytopes_Rn | ( | const boost::shared_ptr< Polytope_Rn > | P | ) |
Constructor.
Definition at line 26 of file VolumeOfPolytopes_Rn.cpp.
|
inline |
Definition at line 146 of file VolumeOfPolytopes_Rn.h.
void VolumeOfPolytopes_Rn::check | ( | ) | const | |
throw | ( | std::domain_error | ||
) |
Definition at line 74 of file VolumeOfPolytopes_Rn.cpp.
|
inlinestatic |
Return the volume of the given polytope P.
Definition at line 153 of file VolumeOfPolytopes_Rn.h.
double VolumeOfPolytopes_Rn::computeSimplexVolume | ( | const std::set< boost::shared_ptr< Generator_Rn > > & | listOfSimplexVertices | ) | const |
Compute the volume of a simplex making use of the following formula :
Definition at line 228 of file VolumeOfPolytopes_Rn.cpp.
double VolumeOfPolytopes_Rn::determinant | ( | boost::numeric::ublas::matrix< double > | a | ) | const |
Called by computeSimplexVolume() to compute a square matrix determinant. As we run it on small matrices we just use the minors method.
Definition at line 247 of file VolumeOfPolytopes_Rn.cpp.
|
inline |
|
inline |
Definition at line 236 of file VolumeOfPolytopes_Rn.h.
|
inline |
void VolumeOfPolytopes_Rn::splitCloudOfVertices | ( | unsigned int | DIM | ) |
Build all simplices to partition the polytope.
DIM | the dimension of the space we work in |
Definition at line 81 of file VolumeOfPolytopes_Rn.cpp.
double VolumeOfPolytopes_Rn::volume | ( | ) |
Sum the volumes of all simplices partitionning the polytope.
Definition at line 194 of file VolumeOfPolytopes_Rn.cpp.
|
protected |
List to store all the simplices partitioning the polytope.
Definition at line 251 of file VolumeOfPolytopes_Rn.h.
|
protected |
As the algorithm goes down in lower dimensions, we want to store the starting space dimension.
Definition at line 257 of file VolumeOfPolytopes_Rn.h.
|
protected |
The ordered list of all facets stored by vertices.
Definition at line 249 of file VolumeOfPolytopes_Rn.h.
|
protected |
The number of facets of the current polytope.
Definition at line 259 of file VolumeOfPolytopes_Rn.h.
|
protected |
The number of vertices of the current polytope.
Definition at line 261 of file VolumeOfPolytopes_Rn.h.
|
protected |
The current polytope we are working on.
Definition at line 253 of file VolumeOfPolytopes_Rn.h.
|
protected |
The ordered list of all vertices stored by facets.
Definition at line 247 of file VolumeOfPolytopes_Rn.h.
|
protected |
The volume of the polytope.
Definition at line 255 of file VolumeOfPolytopes_Rn.h.