politopix
5.0.0
|
The algorithm implemented here is an incremental algorithm as mentioned in How Good are Convex Hull Algorithms? (1997) by David Avis and David Bremner. Specific and efficient implementations can be found in The double description method revisited (1996) written by Komei Fukuda and Alain Prodon .
Incremental algorithms for the vertex enumeration problem compute the vertex description by intersecting the defining half-spaces sequentially. An initial simplex is constructed from a subset of n+1 half-spaces and its vertices and 1-skeleton are computed. Additional half-spaces are introduced sequentially and the vertex description and 1-skeleton are updated at each stage. Essentially such an update amounts to identifying and removing all vertices that are not contained in the new half-space, introducing new vertices for all intersections between edges and the bounding hyperplane of the new half-space, and generating the new edges between these new vertices.
This algorithm can be instantiated by polytopes or polyhedral cones, and as a second argument can be instantiated by iterators such as minindex, lexmin, lexmax.
More...
#include <DoubleDescription_Rn.h>
Public Member Functions | |
DoubleDescription (POLYHEDRON poly, ITERATOR ite, int truncationStep) | |
DoubleDescription (POLYHEDRON poly, ITERATOR ite, int truncationStep, TrackingOperatorToResult &trackerVdesc, TrackingOperatorToResult &trackerHdesc) | |
virtual | ~DoubleDescription () |
unsigned int | init (POLYHEDRON poly, ITERATOR ite, int truncationStep) |
bool | getIsEmpty () const |
void | computeStatesOfAllGenerators (std::vector< boost::shared_ptr< Generator_Rn_SD > > &arrayOfGenOUT, const boost::shared_ptr< HalfSpace_Rn > ¤tHalfSpace, unsigned int halfspaceNumber, unsigned int &nbGeneratorsIn, unsigned int &nbGeneratorsOut, unsigned int &nbGeneratorsOn) |
For each generator compute its state according to the current half-space. More... | |
HalfSpace_Rn::State | computeGeneratorState (const boost::shared_ptr< Generator_Rn_SD > &Gen, const boost::shared_ptr< HalfSpace_Rn > ¤tHalfSpace, unsigned int halfspaceNumber, double halfSpaceNorm, unsigned int &nbGeneratorsIn, unsigned int &nbGeneratorsOut, unsigned int &nbGeneratorsOn) |
Compute the state hs_ON,hs_IN,hs_OUT,hs_UNKNOWN,hs_IN_OR_OUT for a given generator. More... | |
bool | findBestLinearConstraint (std::vector< boost::shared_ptr< HalfSpace_Rn > >::iterator currentLC, std::vector< boost::shared_ptr< HalfSpace_Rn > >::iterator bestLC) |
Given a list of half-spaces, try to find the one able to cut most of a given segment or to discard it completely. More... | |
bool | compute (POLYHEDRON poly, ITERATOR iteHS, int truncationStep, std::vector< boost::shared_ptr< Generator_Rn_SD > > &listOfGenSD) |
The main function splitting the polyhedron cone or polytope 1-skeleton with a list of half-spaces. More... | |
bool | checkNeighbours (POLYHEDRON poly, const boost::shared_ptr< Generator_Rn_SD > &genIn, const boost::shared_ptr< Generator_Rn_SD > &genOut, std::vector< unsigned int > &commonFacets) |
void | markHdescription (TrackingOperatorToResult &trackerHdesc, unsigned int truncationStep, unsigned int numberOfProcessedLinearConstraints) |
void | unhookRedundantGenerators (POLYHEDRON poly) |
bool | checkFuzziness (POLYHEDRON poly, const boost::shared_ptr< Generator_Rn_SD > &gen1, const boost::shared_ptr< Generator_Rn_SD > &fuzz, std::vector< unsigned int > &commonFacets) |
Check whether a fuzzy half-space of the generator fuzz can be a half-space of gen1 when we chop the segment [gen1,fuzz]. More... | |
Static Public Member Functions | |
static bool | inferior (const boost::shared_ptr< Generator_Rn_SD > &HS1, const boost::shared_ptr< Generator_Rn_SD > &HS2) |
Internal function: tell whether a given object is declared inferior to another one. More... | |
static void | dumpListOfGenerators (POLYHEDRON poly, std::vector< boost::shared_ptr< Generator_Rn_SD > > listOfGenSD, std::ostream &this_ostream, bool displayAll=true) |
Protected Member Functions | |
bool | checkDataStructuresConsistency () |
In debug mode only, check the equality of two data structures. More... | |
Protected Attributes | |
double | _TOL |
unsigned int | _RnDIM |
bool | _isEmpty |
Store the current state of the intersection. More... | |
unsigned int | _neigbourhoodCondition |
std::vector< std::set< boost::shared_ptr< Generator_Rn_SD > > > | _listOfGeneratorsPerLinearConstraint |
For each linear constraint, update and store the list of its associated generators. More... | |
std::set< unsigned int > | _listOfRedundantLinearConstraints |
std::vector< boost::shared_ptr< HalfSpace_Rn > > | _listOfLinearConstraints |
std::vector< double > | _listOfLinearConstraintNorms |
std::vector< boost::shared_ptr< NormedHalfSpace_Rn > > | _listOfNormedLinearConstraints |
To speed up computations. More... | |
std::vector< Segment_Rn > | _allNeighbours |
The connections between generators { {gen_a, gen_b}, {gen_a, gen_c}, ...}. More... | |
unsigned int | _currentSegmentIndexAllNeighbours |
The algorithm implemented here is an incremental algorithm as mentioned in How Good are Convex Hull Algorithms? (1997) by David Avis and David Bremner. Specific and efficient implementations can be found in The double description method revisited (1996) written by Komei Fukuda and Alain Prodon .
Incremental algorithms for the vertex enumeration problem compute the vertex description by intersecting the defining half-spaces sequentially. An initial simplex is constructed from a subset of n+1 half-spaces and its vertices and 1-skeleton are computed. Additional half-spaces are introduced sequentially and the vertex description and 1-skeleton are updated at each stage. Essentially such an update amounts to identifying and removing all vertices that are not contained in the new half-space, introducing new vertices for all intersections between edges and the bounding hyperplane of the new half-space, and generating the new edges between these new vertices.
This algorithm can be instantiated by polytopes or polyhedral cones, and as a second argument can be instantiated by iterators such as minindex, lexmin, lexmax.
DoubleDescription stores all the connections between generators unlike the class DoubleDescription which recomputes them on the fly.
Definition at line 86 of file DoubleDescription_Rn.h.
|
inline |
|
inline |
Compute the double description tracking all entities and considering the operator1 as the V-description and operator2 as the H-description.
Definition at line 171 of file DoubleDescription_Rn.h.
|
inlinevirtual |
Definition at line 245 of file DoubleDescription_Rn.h.
|
inlineprotected |
In debug mode only, check the equality of two data structures.
Definition at line 1823 of file DoubleDescription_Rn.h.
|
inline |
Check whether a fuzzy half-space of the generator fuzz can be a half-space of gen1 when we chop the segment [gen1,fuzz].
Definition at line 1800 of file DoubleDescription_Rn.h.
|
inline |
Compute the list of common half-spaces between two generators.
Definition at line 1754 of file DoubleDescription_Rn.h.
|
inline |
The main function splitting the polyhedron cone or polytope 1-skeleton with a list of half-spaces.
Definition at line 506 of file DoubleDescription_Rn.h.
|
inline |
Compute the state hs_ON,hs_IN,hs_OUT,hs_UNKNOWN,hs_IN_OR_OUT for a given generator.
Definition at line 377 of file DoubleDescription_Rn.h.
|
inline |
For each generator compute its state according to the current half-space.
Definition at line 280 of file DoubleDescription_Rn.h.
|
inlinestatic |
|
inline |
Given a list of half-spaces, try to find the one able to cut most of a given segment or to discard it completely.
Definition at line 427 of file DoubleDescription_Rn.h.
|
inline |
|
inlinestatic |
Internal function: tell whether a given object is declared inferior to another one.
Definition at line 362 of file DoubleDescription_Rn.h.
|
inline |
|
inline |
|
inline |
In some cases fuzzy generators are located somewhere in a fuzzy zone and are computed with redundant half-spaces. As they are likely not to have the sufficient number of half-spaces through the process, unhook them.
Definition at line 1783 of file DoubleDescription_Rn.h.
|
protected |
The connections between generators { {gen_a, gen_b}, {gen_a, gen_c}, ...}.
Definition at line 1899 of file DoubleDescription_Rn.h.
|
protected |
Definition at line 1900 of file DoubleDescription_Rn.h.
|
protected |
Store the current state of the intersection.
Definition at line 1889 of file DoubleDescription_Rn.h.
|
protected |
For each linear constraint, update and store the list of its associated generators.
Definition at line 1892 of file DoubleDescription_Rn.h.
|
protected |
Definition at line 1895 of file DoubleDescription_Rn.h.
|
protected |
Definition at line 1894 of file DoubleDescription_Rn.h.
|
protected |
To speed up computations.
Definition at line 1897 of file DoubleDescription_Rn.h.
|
protected |
Definition at line 1893 of file DoubleDescription_Rn.h.
|
protected |
Definition at line 1890 of file DoubleDescription_Rn.h.
|
protected |
Definition at line 1887 of file DoubleDescription_Rn.h.
|
protected |
Definition at line 1886 of file DoubleDescription_Rn.h.