politopix  4.1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Generator_Rn Class Reference

A n-coordinates generator, which can be a vertex or an edge whether it is contained by a polytope or a polyhedral cone. It contains all of its support facets. More...

#include <Generator_Rn.h>

Collaboration diagram for Generator_Rn:
Collaboration graph

Public Member Functions

 Generator_Rn (unsigned int n)
 Creates a n-coordinates generator. More...
 
 Generator_Rn (const Generator_Rn &gn)
 Copy constructor. More...
 
 ~Generator_Rn ()
 Destructor. More...
 
int dimension () const
 
void setCoordinate (unsigned int i, double val)
 
double getCoordinate (unsigned int i) const
 
vector< double >::const_iterator begin () const
 
vector< double >::const_iterator end () const
 
const vector< double > & vect () const
 
void setCoordinates (const vector< double > &vec)
 
void negate ()
 
bool isEqual1 (const boost::shared_ptr< Generator_Rn > &gn, unsigned int RnDIM, double TOL2)
 
bool isEqual2 (const boost::shared_ptr< Generator_Rn > &gn, unsigned int RnDIM, double TOL2)
 
void clearFacets ()
 Clear the list of facets. More...
 
void switchFacets (const std::vector< boost::shared_ptr< HalfSpace_Rn > > &tab)
 Clear the list of facets. More...
 
void setFacet (boost::shared_ptr< HalfSpace_Rn > F)
 Insert a new support facet for the current generator. More...
 
void importFacets (const std::set< boost::shared_ptr< HalfSpace_Rn > > &setOfFacets)
 Insert all facets stored in the argument. More...
 
void exportFacets (std::set< boost::shared_ptr< HalfSpace_Rn > > &setOfFacets) const
 Store all facets in a set. More...
 
void removeFacet (unsigned int i) throw (std::out_of_range,std::domain_error)
 Remove the i-th facet in list. More...
 
boost::shared_ptr< HalfSpace_RngetFacet (unsigned int i) const throw (std::out_of_range)
 
HalfSpace_RngetRawFacet (unsigned int i)
 Return the i-th facet as a pointer for very fast comparisons. No check is performed! More...
 
bool isFacetInside (boost::shared_ptr< HalfSpace_Rn > F) const
 Check whether the given half-space is inside the generator's list. More...
 
unsigned int numberOfFacets () const
 Return the total number of support faces. More...
 
void makeDiff (const boost::shared_ptr< Generator_Rn > &gn1, const boost::shared_ptr< Generator_Rn > &gn2)
 
void makeSum (const boost::shared_ptr< Generator_Rn > &gn1, const boost::shared_ptr< Generator_Rn > &gn2)
 
void makeCoefSum (const boost::shared_ptr< Generator_Rn > &gn1, const boost::shared_ptr< Generator_Rn > &gn2, double coef1, double coef2)
 
double getNormalDistance (const boost::shared_ptr< Generator_Rn > &gn1, double coef, unsigned int RnDIM)
 
double normalize ()
 
double distanceFrom (const Generator_Rn &P)
 
void dump (std::ostream &this_ostream) const
 
void load (std::istream &this_istream)
 
void save (std::ostream &this_ostream) const
 

Protected Attributes

vector< double > _coordinates
 The set of coordinates. More...
 
std::vector< boost::shared_ptr
< HalfSpace_Rn > > 
_supportFacets
 Contain the list of all support facets. More...
 

Friends

class Generator_Rn_SD
 

Detailed Description

A n-coordinates generator, which can be a vertex or an edge whether it is contained by a polytope or a polyhedral cone. It contains all of its support facets.

Definition at line 38 of file Generator_Rn.h.

Constructor & Destructor Documentation

Generator_Rn::Generator_Rn ( unsigned int  n)

Creates a n-coordinates generator.

Definition at line 28 of file Generator_Rn.cpp.

Generator_Rn::Generator_Rn ( const Generator_Rn gn)
inline

Copy constructor.

Definition at line 46 of file Generator_Rn.h.

Generator_Rn::~Generator_Rn ( )

Destructor.

Definition at line 32 of file Generator_Rn.cpp.

Member Function Documentation

vector<double>::const_iterator Generator_Rn::begin ( ) const
inline

Definition at line 60 of file Generator_Rn.h.

void Generator_Rn::clearFacets ( )
inline

Clear the list of facets.

Definition at line 95 of file Generator_Rn.h.

int Generator_Rn::dimension ( ) const
inline

Definition at line 54 of file Generator_Rn.h.

double Generator_Rn::distanceFrom ( const Generator_Rn P)
inline

Definition at line 180 of file Generator_Rn.h.

void Generator_Rn::dump ( std::ostream &  this_ostream) const
inline

Definition at line 187 of file Generator_Rn.h.

Here is the call graph for this function:

vector<double>::const_iterator Generator_Rn::end ( ) const
inline

Definition at line 62 of file Generator_Rn.h.

void Generator_Rn::exportFacets ( std::set< boost::shared_ptr< HalfSpace_Rn > > &  setOfFacets) const
inline

Store all facets in a set.

Definition at line 116 of file Generator_Rn.h.

double Generator_Rn::getCoordinate ( unsigned int  i) const
inline

Definition at line 58 of file Generator_Rn.h.

boost::shared_ptr<HalfSpace_Rn> Generator_Rn::getFacet ( unsigned int  i) const
throw (std::out_of_range
)
inline

Return the i-th facet. The user has to check validity of the returned smart pointer.

Definition at line 128 of file Generator_Rn.h.

Here is the call graph for this function:

double Generator_Rn::getNormalDistance ( const boost::shared_ptr< Generator_Rn > &  gn1,
double  coef,
unsigned int  RnDIM 
)
inline

Return the square distance of the generator gn1 to the straight line defined by _coordinates and passing through the origin.

Definition at line 165 of file Generator_Rn.h.

HalfSpace_Rn* Generator_Rn::getRawFacet ( unsigned int  i)
inline

Return the i-th facet as a pointer for very fast comparisons. No check is performed!

Definition at line 139 of file Generator_Rn.h.

void Generator_Rn::importFacets ( const std::set< boost::shared_ptr< HalfSpace_Rn > > &  setOfFacets)
inline

Insert all facets stored in the argument.

Definition at line 107 of file Generator_Rn.h.

bool Generator_Rn::isEqual1 ( const boost::shared_ptr< Generator_Rn > &  gn,
unsigned int  RnDIM,
double  TOL2 
)
inline

Definition at line 70 of file Generator_Rn.h.

Here is the call graph for this function:

bool Generator_Rn::isEqual2 ( const boost::shared_ptr< Generator_Rn > &  gn,
unsigned int  RnDIM,
double  TOL2 
)
inline

Definition at line 82 of file Generator_Rn.h.

Here is the call graph for this function:

bool Generator_Rn::isFacetInside ( boost::shared_ptr< HalfSpace_Rn F) const

Check whether the given half-space is inside the generator's list.

Definition at line 50 of file Generator_Rn.cpp.

void Generator_Rn::load ( std::istream &  this_istream)
inline

Definition at line 198 of file Generator_Rn.h.

Here is the call graph for this function:

void Generator_Rn::makeCoefSum ( const boost::shared_ptr< Generator_Rn > &  gn1,
const boost::shared_ptr< Generator_Rn > &  gn2,
double  coef1,
double  coef2 
)
inline

Definition at line 155 of file Generator_Rn.h.

void Generator_Rn::makeDiff ( const boost::shared_ptr< Generator_Rn > &  gn1,
const boost::shared_ptr< Generator_Rn > &  gn2 
)
inline

Definition at line 147 of file Generator_Rn.h.

void Generator_Rn::makeSum ( const boost::shared_ptr< Generator_Rn > &  gn1,
const boost::shared_ptr< Generator_Rn > &  gn2 
)
inline

Definition at line 151 of file Generator_Rn.h.

void Generator_Rn::negate ( )
inline

Definition at line 68 of file Generator_Rn.h.

double Generator_Rn::normalize ( )
inline

Definition at line 174 of file Generator_Rn.h.

unsigned int Generator_Rn::numberOfFacets ( ) const
inline

Return the total number of support faces.

Definition at line 145 of file Generator_Rn.h.

void Generator_Rn::removeFacet ( unsigned int  i)
throw (std::out_of_range,
std::domain_error
)

Remove the i-th facet in list.

Definition at line 35 of file Generator_Rn.cpp.

Here is the call graph for this function:

void Generator_Rn::save ( std::ostream &  this_ostream) const
inline

Definition at line 206 of file Generator_Rn.h.

Here is the call graph for this function:

void Generator_Rn::setCoordinate ( unsigned int  i,
double  val 
)
inline

Definition at line 56 of file Generator_Rn.h.

void Generator_Rn::setCoordinates ( const vector< double > &  vec)
inline

Definition at line 66 of file Generator_Rn.h.

void Generator_Rn::setFacet ( boost::shared_ptr< HalfSpace_Rn F)
inline

Insert a new support facet for the current generator.

Definition at line 104 of file Generator_Rn.h.

void Generator_Rn::switchFacets ( const std::vector< boost::shared_ptr< HalfSpace_Rn > > &  tab)
inline

Clear the list of facets.

Definition at line 98 of file Generator_Rn.h.

const vector<double>& Generator_Rn::vect ( ) const
inline

Definition at line 64 of file Generator_Rn.h.

Friends And Related Function Documentation

friend class Generator_Rn_SD
friend

Definition at line 39 of file Generator_Rn.h.

Member Data Documentation

vector<double> Generator_Rn::_coordinates
protected

The set of coordinates.

Definition at line 216 of file Generator_Rn.h.

std::vector< boost::shared_ptr<HalfSpace_Rn> > Generator_Rn::_supportFacets
protected

Contain the list of all support facets.

Definition at line 218 of file Generator_Rn.h.


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