politopix  5.0.0
CappedPolytope_Rn Class Reference

Model a capped polytope i.e. a polytope where we can partition the facets in two sets: regular facets and cap facets which can be removed. More...

#include <Polytope_Rn.h>

Collaboration diagram for CappedPolytope_Rn:
Collaboration graph

Public Member Functions

 CappedPolytope_Rn (boost::shared_ptr< Polytope_Rn > pol, const std::set< unsigned int > &set)
 Constructor. More...
 
 CappedPolytope_Rn ()
 
virtual ~CappedPolytope_Rn ()
 Destructor. More...
 
void setPolytope (boost::shared_ptr< Polytope_Rn > pol)
 
boost::shared_ptr< Polytope_RngetPolytope ()
 Return the capped polytope under its current description. More...
 
const boost::shared_ptr< PolyhedralCone_Rn > & getPrismaticHPolyhedron ()
 Return the uncapped polytope i.e. the prismatic polyhedron under the H-description. More...
 
void resetConstantsOfAllHalfSpaces (double cst)
 Reset all halfspaces constants to the same value. More...
 
void resetConstantOfGivenHalfSpace (double cst, unsigned int fctNb)
 Reset the constant of a given halfspace. More...
 
void setCappedFacets (const std::set< unsigned int > &set)
 
boost::shared_ptr< CappedPolytope_Rnsum (const boost::shared_ptr< CappedPolytope_Rn > &pol2sum, double bb_size=1000.)
 
void sum (const std::vector< boost::shared_ptr< CappedPolytope_Rn > > &allPolytopes0)
 Perform the sum of all the capped polytopes stored in the array. More...
 
void intersect (const std::vector< boost::shared_ptr< CappedPolytope_Rn > > &allPolytopes0)
 
boost::shared_ptr< CappedPolytope_Rnintersect (const boost::shared_ptr< CappedPolytope_Rn > &pol2intersect)
 
bool isIncluded (const boost::shared_ptr< CappedPolytope_Rn > &B) const
 
int scalingFactor (double factor)
 
bool checkTopologyAndGeometry () const
 
void save (const std::string &pathA)
 
void load (const std::string &pathA, double bb_size=10000.)
 
void dump (std::ostream &current_ostream) const
 

Static Public Member Functions

static bool isIncluded (const boost::shared_ptr< CappedPolytope_Rn > &firstBody, const boost::shared_ptr< CappedPolytope_Rn > &secondBody, double &minmaxDistance)
 Test whether firstBody is inside secondBody. More...
 
static std::string getName ()
 
static std::string getFileExtension ()
 

Protected Attributes

std::set< unsigned int > _operandCaps
 Contain the number of the facets which are cap facets. More...
 
boost::shared_ptr< Polytope_Rn_polytope
 
boost::shared_ptr< PolyhedralCone_Rn_prismaticPolyhedron
 The uncapped polytope i.e. the polytope without its capped half-spaces. H-description(_prismaticPolyhedron) = H-description(_polytope) - H-description(_operandCaps) More...
 

Detailed Description

Model a capped polytope i.e. a polytope where we can partition the facets in two sets: regular facets and cap facets which can be removed.

Definition at line 152 of file Polytope_Rn.h.

Constructor & Destructor Documentation

◆ CappedPolytope_Rn() [1/2]

CappedPolytope_Rn::CappedPolytope_Rn ( boost::shared_ptr< Polytope_Rn pol,
const std::set< unsigned int > &  set 
)
inline

Constructor.

Definition at line 156 of file Polytope_Rn.h.

◆ CappedPolytope_Rn() [2/2]

CappedPolytope_Rn::CappedPolytope_Rn ( )
inline

Definition at line 161 of file Polytope_Rn.h.

Here is the caller graph for this function:

◆ ~CappedPolytope_Rn()

virtual CappedPolytope_Rn::~CappedPolytope_Rn ( )
inlinevirtual

Destructor.

Definition at line 164 of file Polytope_Rn.h.

Member Function Documentation

◆ checkTopologyAndGeometry()

bool CappedPolytope_Rn::checkTopologyAndGeometry ( ) const
inline

Definition at line 259 of file Polytope_Rn.h.

◆ dump()

void CappedPolytope_Rn::dump ( std::ostream &  current_ostream) const
inline

Definition at line 265 of file Polytope_Rn.h.

◆ getFileExtension()

static std::string CappedPolytope_Rn::getFileExtension ( )
inlinestatic

Definition at line 274 of file Polytope_Rn.h.

◆ getName()

static std::string CappedPolytope_Rn::getName ( )
inlinestatic

Definition at line 272 of file Polytope_Rn.h.

◆ getPolytope()

boost::shared_ptr<Polytope_Rn> CappedPolytope_Rn::getPolytope ( )
inline

Return the capped polytope under its current description.

Definition at line 169 of file Polytope_Rn.h.

◆ getPrismaticHPolyhedron()

const boost::shared_ptr<PolyhedralCone_Rn>& CappedPolytope_Rn::getPrismaticHPolyhedron ( )
inline

Return the uncapped polytope i.e. the prismatic polyhedron under the H-description.

Definition at line 172 of file Polytope_Rn.h.

◆ intersect() [1/2]

boost::shared_ptr< CappedPolytope_Rn > CappedPolytope_Rn::intersect ( const boost::shared_ptr< CappedPolytope_Rn > &  pol2intersect)

Definition at line 367 of file Polytope_Rn.cpp.

Here is the call graph for this function:

◆ intersect() [2/2]

void CappedPolytope_Rn::intersect ( const std::vector< boost::shared_ptr< CappedPolytope_Rn > > &  allPolytopes0)
inline

Definition at line 229 of file Polytope_Rn.h.

◆ isIncluded() [1/2]

bool CappedPolytope_Rn::isIncluded ( const boost::shared_ptr< CappedPolytope_Rn > &  B) const
inline

Definition at line 246 of file Polytope_Rn.h.

◆ isIncluded() [2/2]

static bool CappedPolytope_Rn::isIncluded ( const boost::shared_ptr< CappedPolytope_Rn > &  firstBody,
const boost::shared_ptr< CappedPolytope_Rn > &  secondBody,
double &  minmaxDistance 
)
inlinestatic

Test whether firstBody is inside secondBody.

Parameters
firstBody
secondBody
minmaxDistanceIf

\[ projectionVertices(firstBody) \not\subset secondBody \]

minmaxDistance is the minimum distance from firstBody to secondBody, otherwise it is the maximum distance shift to apply to the half-spaces of secondBody to include firstBody.
Returns
true if

\[ firstBody \subset secondBody \]

, false otherwise.

Definition at line 253 of file Polytope_Rn.h.

◆ load()

void CappedPolytope_Rn::load ( const std::string &  pathA,
double  bb_size = 10000. 
)

Definition at line 376 of file Polytope_Rn.cpp.

Here is the call graph for this function:

◆ resetConstantOfGivenHalfSpace()

void CappedPolytope_Rn::resetConstantOfGivenHalfSpace ( double  cst,
unsigned int  fctNb 
)
inline

Reset the constant of a given halfspace.

Definition at line 196 of file Polytope_Rn.h.

◆ resetConstantsOfAllHalfSpaces()

void CappedPolytope_Rn::resetConstantsOfAllHalfSpaces ( double  cst)
inline

Reset all halfspaces constants to the same value.

Definition at line 182 of file Polytope_Rn.h.

◆ save()

void CappedPolytope_Rn::save ( const std::string &  pathA)

Definition at line 432 of file Polytope_Rn.cpp.

Here is the call graph for this function:

◆ scalingFactor()

int CappedPolytope_Rn::scalingFactor ( double  factor)

Definition at line 442 of file Polytope_Rn.cpp.

Here is the call graph for this function:

◆ setCappedFacets()

void CappedPolytope_Rn::setCappedFacets ( const std::set< unsigned int > &  set)
inline

Definition at line 209 of file Polytope_Rn.h.

◆ setPolytope()

void CappedPolytope_Rn::setPolytope ( boost::shared_ptr< Polytope_Rn pol)
inline

Definition at line 166 of file Polytope_Rn.h.

◆ sum() [1/2]

boost::shared_ptr< CappedPolytope_Rn > CappedPolytope_Rn::sum ( const boost::shared_ptr< CappedPolytope_Rn > &  pol2sum,
double  bb_size = 1000. 
)

Definition at line 358 of file Polytope_Rn.cpp.

Here is the call graph for this function:

◆ sum() [2/2]

void CappedPolytope_Rn::sum ( const std::vector< boost::shared_ptr< CappedPolytope_Rn > > &  allPolytopes0)
inline

Perform the sum of all the capped polytopes stored in the array.

Definition at line 214 of file Polytope_Rn.h.

Member Data Documentation

◆ _operandCaps

std::set< unsigned int > CappedPolytope_Rn::_operandCaps
protected

Contain the number of the facets which are cap facets.

Definition at line 278 of file Polytope_Rn.h.

◆ _polytope

boost::shared_ptr<Polytope_Rn> CappedPolytope_Rn::_polytope
protected

Definition at line 280 of file Polytope_Rn.h.

◆ _prismaticPolyhedron

boost::shared_ptr<PolyhedralCone_Rn> CappedPolytope_Rn::_prismaticPolyhedron
protected

The uncapped polytope i.e. the polytope without its capped half-spaces. H-description(_prismaticPolyhedron) = H-description(_polytope) - H-description(_operandCaps)

Definition at line 283 of file Polytope_Rn.h.


The documentation for this class was generated from the following files: