politopix  5.0.0
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 ()
 Create an empty generator. More...
 
 Generator_Rn (unsigned int n)
 Create 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 scalingFactor (double factor)
 
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)
 
bool isEqual2 (const 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)
 Remove the i-th facet in list. More...
 
boost::shared_ptr< HalfSpace_RngetFacet (unsigned int i) const
 
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)
 
unsigned int numberOfNeighbourGenerators () const
 
void clearNeighbourGenerators ()
 
boost::shared_ptr< Generator_RngetNeighbourGenerator (unsigned int i) const
 
void setNeighbourGenerator (boost::shared_ptr< Generator_Rn > G)
 
void dump (std::ostream &this_ostream) const
 
void print () 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
 The list of all support facets. More...
 
std::vector< boost::shared_ptr< Generator_Rn > > _neighbourGenerators
 The list of all the generator neighbours. 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 39 of file Generator_Rn.h.

Constructor & Destructor Documentation

◆ Generator_Rn() [1/3]

Generator_Rn::Generator_Rn ( )
inline

Create an empty generator.

Definition at line 44 of file Generator_Rn.h.

◆ Generator_Rn() [2/3]

Generator_Rn::Generator_Rn ( unsigned int  n)

Create a n-coordinates generator.

Definition at line 28 of file Generator_Rn.cpp.

◆ Generator_Rn() [3/3]

Generator_Rn::Generator_Rn ( const Generator_Rn gn)
inline

Copy constructor.

Definition at line 50 of file Generator_Rn.h.

◆ ~Generator_Rn()

Generator_Rn::~Generator_Rn ( )

Destructor.

Definition at line 32 of file Generator_Rn.cpp.

Member Function Documentation

◆ begin()

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

Definition at line 64 of file Generator_Rn.h.

◆ clearFacets()

void Generator_Rn::clearFacets ( )
inline

Clear the list of facets.

Definition at line 116 of file Generator_Rn.h.

◆ clearNeighbourGenerators()

void Generator_Rn::clearNeighbourGenerators ( )
inline

Definition at line 216 of file Generator_Rn.h.

◆ dimension()

int Generator_Rn::dimension ( ) const
inline

Definition at line 58 of file Generator_Rn.h.

◆ distanceFrom()

double Generator_Rn::distanceFrom ( const Generator_Rn P)
inline

Definition at line 204 of file Generator_Rn.h.

◆ dump()

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

Definition at line 233 of file Generator_Rn.h.

Here is the call graph for this function:

◆ end()

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

Definition at line 66 of file Generator_Rn.h.

◆ exportFacets()

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

Store all facets in a set.

Definition at line 137 of file Generator_Rn.h.

◆ getCoordinate()

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

Definition at line 62 of file Generator_Rn.h.

Here is the caller graph for this function:

◆ getFacet()

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

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

Definition at line 149 of file Generator_Rn.h.

Here is the call graph for this function:

◆ getNeighbourGenerator()

boost::shared_ptr<Generator_Rn> Generator_Rn::getNeighbourGenerator ( unsigned int  i) const
inline

Definition at line 218 of file Generator_Rn.h.

Here is the call graph for this function:

◆ getNormalDistance()

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 189 of file Generator_Rn.h.

◆ getRawFacet()

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 160 of file Generator_Rn.h.

◆ importFacets()

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

Insert all facets stored in the argument.

Definition at line 128 of file Generator_Rn.h.

◆ isEqual1()

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

Definition at line 76 of file Generator_Rn.h.

Here is the call graph for this function:

◆ isEqual2() [1/2]

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

Definition at line 88 of file Generator_Rn.h.

Here is the call graph for this function:

◆ isEqual2() [2/2]

bool Generator_Rn::isEqual2 ( const Generator_Rn gn,
unsigned int  RnDIM,
double  TOL2 
)
inline

Definition at line 100 of file Generator_Rn.h.

Here is the call graph for this function:

◆ isFacetInside()

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.

◆ load()

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

Definition at line 249 of file Generator_Rn.h.

Here is the call graph for this function:

◆ makeCoefSum()

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 179 of file Generator_Rn.h.

◆ makeDiff()

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

Definition at line 171 of file Generator_Rn.h.

◆ makeSum()

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

Definition at line 175 of file Generator_Rn.h.

◆ negate()

void Generator_Rn::negate ( )
inline

Definition at line 74 of file Generator_Rn.h.

◆ normalize()

double Generator_Rn::normalize ( )
inline

Definition at line 198 of file Generator_Rn.h.

◆ numberOfFacets()

unsigned int Generator_Rn::numberOfFacets ( ) const
inline

Return the total number of support faces.

Definition at line 166 of file Generator_Rn.h.

Here is the caller graph for this function:

◆ numberOfNeighbourGenerators()

unsigned int Generator_Rn::numberOfNeighbourGenerators ( ) const
inline

Definition at line 214 of file Generator_Rn.h.

◆ print()

void Generator_Rn::print ( ) const
inline

Definition at line 244 of file Generator_Rn.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeFacet()

void Generator_Rn::removeFacet ( unsigned int  i)

Remove the i-th facet in list.

Definition at line 35 of file Generator_Rn.cpp.

Here is the call graph for this function:

◆ save()

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

Definition at line 257 of file Generator_Rn.h.

Here is the call graph for this function:

◆ scalingFactor()

void Generator_Rn::scalingFactor ( double  factor)
inline

Definition at line 72 of file Generator_Rn.h.

◆ setCoordinate()

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

Definition at line 60 of file Generator_Rn.h.

Here is the caller graph for this function:

◆ setCoordinates()

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

Definition at line 70 of file Generator_Rn.h.

◆ setFacet()

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

Insert a new support facet for the current generator.

Definition at line 125 of file Generator_Rn.h.

◆ setNeighbourGenerator()

void Generator_Rn::setNeighbourGenerator ( boost::shared_ptr< Generator_Rn G)
inline

Definition at line 228 of file Generator_Rn.h.

◆ switchFacets()

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

Clear the list of facets.

Definition at line 119 of file Generator_Rn.h.

◆ vect()

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

Definition at line 68 of file Generator_Rn.h.

Friends And Related Function Documentation

◆ Generator_Rn_SD

friend class Generator_Rn_SD
friend

Definition at line 40 of file Generator_Rn.h.

Member Data Documentation

◆ _coordinates

vector<double> Generator_Rn::_coordinates
protected

The set of coordinates.

Definition at line 267 of file Generator_Rn.h.

◆ _neighbourGenerators

std::vector< boost::shared_ptr<Generator_Rn> > Generator_Rn::_neighbourGenerators
protected

The list of all the generator neighbours.

Definition at line 271 of file Generator_Rn.h.

◆ _supportFacets

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

The list of all support facets.

Definition at line 269 of file Generator_Rn.h.


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