politopix  5.0.0
Generator_Rn_SD Class Reference

A n-coordinates generator for internal data structure. It can be a vertex or an edge whether it is embedded in a polytope or a polyhedral cone. It contains all of its support facets. More...

#include <Generator_Rn.h>

Collaboration diagram for Generator_Rn_SD:
Collaboration graph

Public Types

enum  Status {
  UNCHANGED, MODIFIED, CREATED, CREATED_AND_MODIFIED,
  DELETED, UNKNOWN
}
 

Public Member Functions

 Generator_Rn_SD (unsigned int n, unsigned int nb, Status st)
 Creates a n-coordinates generator. More...
 
 Generator_Rn_SD (const boost::numeric::ublas::vector< double > &coordinates, unsigned int nb)
 Creates a n-coordinates generator. More...
 
 Generator_Rn_SD (const Generator_Rn_SD &gn)
 Copy constructor. More...
 
 Generator_Rn_SD (const Generator_Rn &gn, unsigned int nb, Status st)
 Constructor with a Generator_Rn. More...
 
 Generator_Rn_SD ()
 Empty constructor. More...
 
 ~Generator_Rn_SD ()
 Destructor. More...
 
int dimension () const
 
void init (unsigned int nb, Status st)
 
boost::shared_ptr< Generator_RnmakeGenerator_Rn () const
 To make a Generator_Rn out of a Generator_Rn_SD. More...
 
void setCoordinate (unsigned int i, double val)
 
double getCoordinate (unsigned int i) const
 
void setCoordinates (const vector< double > &vec)
 
void setGeneratorNumber (unsigned int gn)
 
unsigned int getGeneratorNumber () const
 
void setStatus (Status stu)
 The status is used for traceability through the operations and can be equal to: UNCHANGED,MODIFIED,CREATED,CREATED_AND_MODIFIED,DELETED,UNKNOWN. More...
 
Status getStatus () const
 The status is used for traceability through the operations and can be equal to: UNCHANGED,MODIFIED,CREATED,CREATED_AND_MODIFIED,DELETED,UNKNOWN. More...
 
StatusgetStatus ()
 
void setState (HalfSpace_Rn::State ste)
 The state of the generator SD with respect to a given half-space (hs_ON,hs_IN,hs_OUT,hs_UNKNOWN,hs_IN_OR_OUT) More...
 
void setState (HalfSpace_Rn::State ste, double scalar_prod)
 
void resetState ()
 
HalfSpace_Rn::State getState () const
 The state of the generator SD with respect to a given half-space (hs_ON,hs_IN,hs_OUT,hs_UNKNOWN,hs_IN_OR_OUT) More...
 
double getScalarProduct () const
 
void setScalarProduct (double sp)
 
vector< double >::const_iterator begin () const
 
vector< double >::const_iterator end () const
 
const vector< double > & vect () const
 
void negate ()
 
bool isEqual1 (const boost::shared_ptr< Generator_Rn_SD > &gn, unsigned int RnDIM, double TOL2)
 
bool isEqual2 (const boost::shared_ptr< Generator_Rn_SD > &gn, unsigned int RnDIM, double TOL2)
 
bool fuzzyFacets () const
 
unsigned int fuzzyFacetsSize () const
 
void setFuzzyFacet (unsigned int F)
 Insert a new fuzzy facet for the current generator. More...
 
void setFacet (unsigned int F)
 Insert a new support facet in the current generator. More...
 
void setFacets (const std::vector< unsigned int > &AF)
 Insert new support facets in the current generator at the end of the existing list. More...
 
void setAllFacets (const std::vector< unsigned int > &AF)
 Insert new support facets in the current generator erasing the others. More...
 
const std::vector< unsigned int > & getAllFacets ()
 Return all support facets of the current generator. More...
 
void importFacets (const std::set< unsigned int > &setOfFacets)
 Insert all facets stored in the argument. More...
 
void exportFacets (std::set< unsigned int > &setOfFacets) const
 Store all facets in a set. More...
 
void removeFacet (unsigned int i)
 Remove the i-th facet in list. More...
 
unsigned int getFacet (unsigned int i) const
 Return the i-th facet number. More...
 
void removeCurrentLinearConstraint (unsigned int LC)
 Remove the facet LC in list. More...
 
unsigned int getRawFacet (unsigned int i)
 Return the i-th facet. No check is performed! More...
 
bool isFacetInside (unsigned int 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 orderFacets ()
 
std::vector< unsigned int >::const_iterator facetsBegin () const
 
std::vector< unsigned int >::const_iterator facetsEnd () const
 
std::vector< unsigned int >::const_iterator fuzzyFacetsBegin () const
 
std::vector< unsigned int >::const_iterator fuzzyFacetsEnd () const
 
void makeDiff (const boost::shared_ptr< Generator_Rn_SD > &gn1, const boost::shared_ptr< Generator_Rn_SD > &gn2)
 
void makeSum (const boost::shared_ptr< Generator_Rn_SD > &gn1, const boost::shared_ptr< Generator_Rn_SD > &gn2)
 
void makeCoefSum (const boost::shared_ptr< Generator_Rn_SD > &gn1, const boost::shared_ptr< Generator_Rn_SD > &gn2, double coef1, double coef2)
 
double getNormalDistance (const boost::shared_ptr< Generator_Rn_SD > &gn1, double coef, unsigned int RnDIM)
 
double normalize ()
 
double distanceFrom (const Generator_Rn_SD &P)
 
void dump (std::ostream &this_ostream) const
 
void load (std::istream &this_istream)
 
void save (std::ostream &this_ostream) const
 

Protected Attributes

boost::numeric::ublas::vector< double > _coordinates
 The set of coordinates. More...
 
std::vector< unsigned int > _supportIntFacets
 The list of all support facets. More...
 
std::vector< unsigned int > _fuzzyFacets
 The list of all fuzzy facets i.e. the facets whose distance to the current generator is close to the tolerance. More...
 
unsigned int _generatorNumber
 The SD generator embeds its own number. More...
 
Status _status
 The SD generator embeds its status to trace the operations (UNCHANGED,MODIFIED,CREATED,CREATED_AND_MODIFIED,DELETED,UNKNOWN) More...
 
HalfSpace_Rn::State _currentState
 The state of the generator SD with respect to a given half-space (hs_ON,hs_IN,hs_OUT,hs_UNKNOWN,hs_IN_OR_OUT,hs_OUT_TO_ON) More...
 
double _scalarProduct
 The scalar product with the current half-space. More...
 

Friends

class Generator_Rn
 

Detailed Description

A n-coordinates generator for internal data structure. It can be a vertex or an edge whether it is embedded in a polytope or a polyhedral cone. It contains all of its support facets.

Definition at line 280 of file Generator_Rn.h.

Member Enumeration Documentation

◆ Status

Enumerator
UNCHANGED 
MODIFIED 
CREATED 
CREATED_AND_MODIFIED 
DELETED 
UNKNOWN 

Definition at line 285 of file Generator_Rn.h.

Constructor & Destructor Documentation

◆ Generator_Rn_SD() [1/5]

Generator_Rn_SD::Generator_Rn_SD ( unsigned int  n,
unsigned int  nb,
Status  st 
)
inline

Creates a n-coordinates generator.

Definition at line 300 of file Generator_Rn.h.

◆ Generator_Rn_SD() [2/5]

Generator_Rn_SD::Generator_Rn_SD ( const boost::numeric::ublas::vector< double > &  coordinates,
unsigned int  nb 
)
inline

Creates a n-coordinates generator.

Definition at line 307 of file Generator_Rn.h.

◆ Generator_Rn_SD() [3/5]

Generator_Rn_SD::Generator_Rn_SD ( const Generator_Rn_SD gn)
inline

Copy constructor.

Definition at line 314 of file Generator_Rn.h.

◆ Generator_Rn_SD() [4/5]

Generator_Rn_SD::Generator_Rn_SD ( const Generator_Rn gn,
unsigned int  nb,
Status  st 
)
inline

Constructor with a Generator_Rn.

Definition at line 322 of file Generator_Rn.h.

◆ Generator_Rn_SD() [5/5]

Generator_Rn_SD::Generator_Rn_SD ( )
inline

Empty constructor.

Definition at line 328 of file Generator_Rn.h.

◆ ~Generator_Rn_SD()

Generator_Rn_SD::~Generator_Rn_SD ( )
inline

Destructor.

Definition at line 333 of file Generator_Rn.h.

Member Function Documentation

◆ begin()

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

Definition at line 384 of file Generator_Rn.h.

◆ dimension()

int Generator_Rn_SD::dimension ( ) const
inline

Definition at line 335 of file Generator_Rn.h.

◆ distanceFrom()

double Generator_Rn_SD::distanceFrom ( const Generator_Rn_SD P)
inline

Definition at line 547 of file Generator_Rn.h.

◆ dump()

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

Definition at line 554 of file Generator_Rn.h.

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

◆ end()

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

Definition at line 386 of file Generator_Rn.h.

◆ exportFacets()

void Generator_Rn_SD::exportFacets ( std::set< unsigned int > &  setOfFacets) const
inline

Store all facets in a set.

Definition at line 447 of file Generator_Rn.h.

◆ facetsBegin()

std::vector<unsigned int>::const_iterator Generator_Rn_SD::facetsBegin ( ) const
inline

Definition at line 506 of file Generator_Rn.h.

◆ facetsEnd()

std::vector<unsigned int>::const_iterator Generator_Rn_SD::facetsEnd ( ) const
inline

Definition at line 508 of file Generator_Rn.h.

◆ fuzzyFacets()

bool Generator_Rn_SD::fuzzyFacets ( ) const
inline

Test if fuzzy facets exist in this generator. Fuzzy facets distance to the current generator is close to the tolerance.

Definition at line 418 of file Generator_Rn.h.

◆ fuzzyFacetsBegin()

std::vector<unsigned int>::const_iterator Generator_Rn_SD::fuzzyFacetsBegin ( ) const
inline

Definition at line 510 of file Generator_Rn.h.

◆ fuzzyFacetsEnd()

std::vector<unsigned int>::const_iterator Generator_Rn_SD::fuzzyFacetsEnd ( ) const
inline

Definition at line 512 of file Generator_Rn.h.

◆ fuzzyFacetsSize()

unsigned int Generator_Rn_SD::fuzzyFacetsSize ( ) const
inline

Definition at line 420 of file Generator_Rn.h.

◆ getAllFacets()

const std::vector<unsigned int>& Generator_Rn_SD::getAllFacets ( )
inline

Return all support facets of the current generator.

Definition at line 435 of file Generator_Rn.h.

◆ getCoordinate()

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

Definition at line 355 of file Generator_Rn.h.

Here is the caller graph for this function:

◆ getFacet()

unsigned int Generator_Rn_SD::getFacet ( unsigned int  i) const
inline

Return the i-th facet number.

Definition at line 462 of file Generator_Rn.h.

Here is the call graph for this function:

◆ getGeneratorNumber()

unsigned int Generator_Rn_SD::getGeneratorNumber ( ) const
inline

Definition at line 361 of file Generator_Rn.h.

◆ getNormalDistance()

double Generator_Rn_SD::getNormalDistance ( const boost::shared_ptr< Generator_Rn_SD > &  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 532 of file Generator_Rn.h.

◆ getRawFacet()

unsigned int Generator_Rn_SD::getRawFacet ( unsigned int  i)
inline

Return the i-th facet. No check is performed!

Definition at line 489 of file Generator_Rn.h.

◆ getScalarProduct()

double Generator_Rn_SD::getScalarProduct ( ) const
inline

Definition at line 381 of file Generator_Rn.h.

◆ getState()

HalfSpace_Rn::State Generator_Rn_SD::getState ( ) const
inline

The state of the generator SD with respect to a given half-space (hs_ON,hs_IN,hs_OUT,hs_UNKNOWN,hs_IN_OR_OUT)

Definition at line 380 of file Generator_Rn.h.

◆ getStatus() [1/2]

Status& Generator_Rn_SD::getStatus ( )
inline

Definition at line 368 of file Generator_Rn.h.

◆ getStatus() [2/2]

Status Generator_Rn_SD::getStatus ( ) const
inline

The status is used for traceability through the operations and can be equal to: UNCHANGED,MODIFIED,CREATED,CREATED_AND_MODIFIED,DELETED,UNKNOWN.

Definition at line 367 of file Generator_Rn.h.

◆ importFacets()

void Generator_Rn_SD::importFacets ( const std::set< unsigned int > &  setOfFacets)
inline

Insert all facets stored in the argument.

Definition at line 438 of file Generator_Rn.h.

◆ init()

void Generator_Rn_SD::init ( unsigned int  nb,
Status  st 
)
inline

Definition at line 337 of file Generator_Rn.h.

◆ isEqual1()

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

Definition at line 392 of file Generator_Rn.h.

Here is the call graph for this function:

◆ isEqual2()

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

Definition at line 404 of file Generator_Rn.h.

Here is the call graph for this function:

◆ isFacetInside()

bool Generator_Rn_SD::isFacetInside ( unsigned int  F) const
inline

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

Definition at line 492 of file Generator_Rn.h.

◆ load()

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

Definition at line 570 of file Generator_Rn.h.

Here is the call graph for this function:

◆ makeCoefSum()

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

Definition at line 522 of file Generator_Rn.h.

◆ makeDiff()

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

Definition at line 514 of file Generator_Rn.h.

◆ makeGenerator_Rn()

boost::shared_ptr<Generator_Rn> Generator_Rn_SD::makeGenerator_Rn ( ) const
inline

To make a Generator_Rn out of a Generator_Rn_SD.

Definition at line 347 of file Generator_Rn.h.

◆ makeSum()

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

Definition at line 518 of file Generator_Rn.h.

◆ negate()

void Generator_Rn_SD::negate ( )
inline

Definition at line 390 of file Generator_Rn.h.

◆ normalize()

double Generator_Rn_SD::normalize ( )
inline

Definition at line 541 of file Generator_Rn.h.

◆ numberOfFacets()

unsigned int Generator_Rn_SD::numberOfFacets ( ) const
inline

Return the total number of support faces.

Definition at line 502 of file Generator_Rn.h.

◆ orderFacets()

void Generator_Rn_SD::orderFacets ( )
inline

Definition at line 504 of file Generator_Rn.h.

◆ removeCurrentLinearConstraint()

void Generator_Rn_SD::removeCurrentLinearConstraint ( unsigned int  LC)
inline

Remove the facet LC in list.

Definition at line 473 of file Generator_Rn.h.

Here is the call graph for this function:

◆ removeFacet()

void Generator_Rn_SD::removeFacet ( unsigned int  i)
inline

Remove the i-th facet in list.

Definition at line 455 of file Generator_Rn.h.

◆ resetState()

void Generator_Rn_SD::resetState ( )
inline

Definition at line 377 of file Generator_Rn.h.

◆ save()

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

Definition at line 578 of file Generator_Rn.h.

Here is the call graph for this function:

◆ setAllFacets()

void Generator_Rn_SD::setAllFacets ( const std::vector< unsigned int > &  AF)
inline

Insert new support facets in the current generator erasing the others.

Definition at line 432 of file Generator_Rn.h.

◆ setCoordinate()

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

Definition at line 353 of file Generator_Rn.h.

Here is the caller graph for this function:

◆ setCoordinates()

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

Definition at line 357 of file Generator_Rn.h.

◆ setFacet()

void Generator_Rn_SD::setFacet ( unsigned int  F)
inline

Insert a new support facet in the current generator.

Definition at line 426 of file Generator_Rn.h.

◆ setFacets()

void Generator_Rn_SD::setFacets ( const std::vector< unsigned int > &  AF)
inline

Insert new support facets in the current generator at the end of the existing list.

Definition at line 429 of file Generator_Rn.h.

◆ setFuzzyFacet()

void Generator_Rn_SD::setFuzzyFacet ( unsigned int  F)
inline

Insert a new fuzzy facet for the current generator.

Definition at line 423 of file Generator_Rn.h.

◆ setGeneratorNumber()

void Generator_Rn_SD::setGeneratorNumber ( unsigned int  gn)
inline

Definition at line 359 of file Generator_Rn.h.

◆ setScalarProduct()

void Generator_Rn_SD::setScalarProduct ( double  sp)
inline

Definition at line 382 of file Generator_Rn.h.

◆ setState() [1/2]

void Generator_Rn_SD::setState ( HalfSpace_Rn::State  ste)
inline

The state of the generator SD with respect to a given half-space (hs_ON,hs_IN,hs_OUT,hs_UNKNOWN,hs_IN_OR_OUT)

Definition at line 371 of file Generator_Rn.h.

◆ setState() [2/2]

void Generator_Rn_SD::setState ( HalfSpace_Rn::State  ste,
double  scalar_prod 
)
inline

Definition at line 372 of file Generator_Rn.h.

◆ setStatus()

void Generator_Rn_SD::setStatus ( Status  stu)
inline

The status is used for traceability through the operations and can be equal to: UNCHANGED,MODIFIED,CREATED,CREATED_AND_MODIFIED,DELETED,UNKNOWN.

Definition at line 364 of file Generator_Rn.h.

◆ vect()

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

Definition at line 388 of file Generator_Rn.h.

Friends And Related Function Documentation

◆ Generator_Rn

friend class Generator_Rn
friend

Definition at line 281 of file Generator_Rn.h.

Member Data Documentation

◆ _coordinates

boost::numeric::ublas::vector< double > Generator_Rn_SD::_coordinates
protected

The set of coordinates.

Definition at line 588 of file Generator_Rn.h.

◆ _currentState

HalfSpace_Rn::State Generator_Rn_SD::_currentState
protected

The state of the generator SD with respect to a given half-space (hs_ON,hs_IN,hs_OUT,hs_UNKNOWN,hs_IN_OR_OUT,hs_OUT_TO_ON)

Definition at line 600 of file Generator_Rn.h.

◆ _fuzzyFacets

std::vector< unsigned int > Generator_Rn_SD::_fuzzyFacets
protected

The list of all fuzzy facets i.e. the facets whose distance to the current generator is close to the tolerance.

Definition at line 592 of file Generator_Rn.h.

◆ _generatorNumber

unsigned int Generator_Rn_SD::_generatorNumber
protected

The SD generator embeds its own number.

Definition at line 596 of file Generator_Rn.h.

◆ _scalarProduct

double Generator_Rn_SD::_scalarProduct
protected

The scalar product with the current half-space.

Definition at line 602 of file Generator_Rn.h.

◆ _status

Status Generator_Rn_SD::_status
protected

The SD generator embeds its status to trace the operations (UNCHANGED,MODIFIED,CREATED,CREATED_AND_MODIFIED,DELETED,UNKNOWN)

Definition at line 598 of file Generator_Rn.h.

◆ _supportIntFacets

std::vector< unsigned int > Generator_Rn_SD::_supportIntFacets
protected

The list of all support facets.

Definition at line 590 of file Generator_Rn.h.


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