gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
CellComplex Class Reference

#include <CellComplex.h>

Collaboration diagram for CellComplex:

Public Types

typedef std::set< Cell *, CellPtrLessThan >::iterator citer
 

Public Member Functions

 CellComplex (GModel *model, std::vector< MElement * > &domainElements, std::vector< MElement * > &subdomainElements, std::vector< MElement * > &nondomainElements, std::vector< MElement * > &nonsubdomainElements, std::vector< MElement * > &immuneElements, bool saveOriginalComplex=true)
 
 ~CellComplex ()
 
GModelgetModel () const
 
int getDim () const
 
bool simplicial () const
 
bool relative () const
 
int getSize (int dim, bool orig=false)
 
int getDomain (Cell *cell, std::string &str)
 
void getCells (std::set< Cell *, CellPtrLessThan > &cells, int dim, int domain=0)
 
int getNumCells (int dim, int domain=0)
 
CellgetACell (int dim, int domain=0)
 
citer firstCell (int dim, bool orig=false)
 
citer lastCell (int dim, bool orig=false)
 
bool hasCell (Cell *cell, bool orig=false)
 
bool inSameDomain (Cell *c1, Cell *c2) const
 
void removeSubdomain ()
 
void removeCells (int dim)
 
int reduction (int dim, int omit, std::vector< Cell * > &omittedCells)
 
int coreduction (int dim, int omit, std::vector< Cell * > &omittedCells)
 
int combine (int dim)
 
int cocombine (int dim)
 
bool coherent ()
 
int reduceComplex (int combine=1, bool omit=true, bool homseq=false)
 
int coreduceComplex (int combine=1, bool omit=true, int heuristic=0)
 
void bettiReduceComplex ()
 
bool isReduced () const
 
int eulerCharacteristic ()
 
void printEuler ()
 
bool restoreComplex ()
 
void printComplex (int dim)
 
int saveComplex (const std::string &filename)
 
int loadComplex (const std::string &filename)
 

Private Member Functions

bool _insertCells (std::vector< MElement * > &elements, int domain)
 
bool _removeCells (std::vector< MElement * > &elements, int domain)
 
bool _immunizeCells (std::vector< MElement * > &elements)
 
Cell_omitCell (Cell *cell, bool dual)
 
void enqueueCells (std::map< Cell *, short int, CellPtrLessThan > &cells, std::queue< Cell * > &Q, std::set< Cell *, CellPtrLessThan > &Qset)
 
void removeCell (Cell *cell, bool other=true, bool del=false)
 
void insertCell (Cell *cell)
 
int coreduction (Cell *startCell, int omit, std::vector< Cell * > &omittedCells)
 

Private Attributes

std::pair< Cell *, double > _smallestCell
 
std::pair< Cell *, double > _biggestCell
 
GModel_model
 
std::set< Cell *, CellPtrLessThan_cells [4]
 
std::set< Cell *, CellPtrLessThan_ocells [4]
 
std::vector< Cell * > _removedcells
 
int _dim
 
bool _simplicial
 
bool _saveorig
 
bool _relative
 
int _deleteCount
 
int _createCount
 
bool _reduced
 
int _numRelativeCells [4]
 
int _numSubdomainCells [4]
 

Static Private Attributes

static double _patience = 10
 

Detailed Description

Definition at line 24 of file CellComplex.h.

Member Typedef Documentation

◆ citer

typedef std::set<Cell *, CellPtrLessThan>::iterator CellComplex::citer

Definition at line 120 of file CellComplex.h.

Constructor & Destructor Documentation

◆ CellComplex()

CellComplex::CellComplex ( GModel model,
std::vector< MElement * > &  domainElements,
std::vector< MElement * > &  subdomainElements,
std::vector< MElement * > &  nondomainElements,
std::vector< MElement * > &  nonsubdomainElements,
std::vector< MElement * > &  immuneElements,
bool  saveOriginalComplex = true 
)

Definition at line 14 of file CellComplex.cpp.

Here is the call graph for this function:

◆ ~CellComplex()

CellComplex::~CellComplex ( )

Definition at line 226 of file CellComplex.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _immunizeCells()

bool CellComplex::_immunizeCells ( std::vector< MElement * > &  elements)
private

Definition at line 213 of file CellComplex.cpp.

Referenced by CellComplex().

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

◆ _insertCells()

bool CellComplex::_insertCells ( std::vector< MElement * > &  elements,
int  domain 
)
private

Definition at line 66 of file CellComplex.cpp.

Referenced by CellComplex().

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

◆ _omitCell()

Cell * CellComplex::_omitCell ( Cell cell,
bool  dual 
)
private

Definition at line 461 of file CellComplex.cpp.

Referenced by coreduceComplex(), and reduceComplex().

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

◆ _removeCells()

bool CellComplex::_removeCells ( std::vector< MElement * > &  elements,
int  domain 
)
private

Definition at line 158 of file CellComplex.cpp.

Referenced by CellComplex().

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

◆ bettiReduceComplex()

void CellComplex::bettiReduceComplex ( )

Definition at line 659 of file CellComplex.cpp.

Here is the call graph for this function:

◆ cocombine()

int CellComplex::cocombine ( int  dim)

Definition at line 744 of file CellComplex.cpp.

Referenced by bettiReduceComplex(), and coreduceComplex().

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

◆ coherent()

bool CellComplex::coherent ( )

Definition at line 822 of file CellComplex.cpp.

Referenced by coreduceComplex().

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

◆ combine()

int CellComplex::combine ( int  dim)

Definition at line 666 of file CellComplex.cpp.

Referenced by coreduceComplex(), and reduceComplex().

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

◆ coreduceComplex()

int CellComplex::coreduceComplex ( int  combine = 1,
bool  omit = true,
int  heuristic = 0 
)

Definition at line 579 of file CellComplex.cpp.

Here is the call graph for this function:

◆ coreduction() [1/2]

int CellComplex::coreduction ( Cell startCell,
int  omit,
std::vector< Cell * > &  omittedCells 
)
private

Definition at line 301 of file CellComplex.cpp.

Referenced by _omitCell(), and coreduceComplex().

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

◆ coreduction() [2/2]

int CellComplex::coreduction ( int  dim,
int  omit,
std::vector< Cell * > &  omittedCells 
)

Definition at line 384 of file CellComplex.cpp.

Here is the call graph for this function:

◆ enqueueCells()

void CellComplex::enqueueCells ( std::map< Cell *, short int, CellPtrLessThan > &  cells,
std::queue< Cell * > &  Q,
std::set< Cell *, CellPtrLessThan > &  Qset 
)
private

Definition at line 287 of file CellComplex.cpp.

Referenced by cocombine(), combine(), and coreduction().

Here is the caller graph for this function:

◆ eulerCharacteristic()

int CellComplex::eulerCharacteristic ( )
inline

Definition at line 177 of file CellComplex.h.

Referenced by printEuler().

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

◆ firstCell()

citer CellComplex::firstCell ( int  dim,
bool  orig = false 
)
inline

◆ getACell()

Cell * CellComplex::getACell ( int  dim,
int  domain = 0 
)

Definition at line 904 of file CellComplex.cpp.

Here is the call graph for this function:

◆ getCells()

void CellComplex::getCells ( std::set< Cell *, CellPtrLessThan > &  cells,
int  dim,
int  domain = 0 
)

Definition at line 880 of file CellComplex.cpp.

Here is the call graph for this function:

◆ getDim()

int CellComplex::getDim ( ) const
inline

Definition at line 94 of file CellComplex.h.

Referenced by _omitCell(), coreduceComplex(), and reduceComplex().

Here is the caller graph for this function:

◆ getDomain()

int CellComplex::getDomain ( Cell cell,
std::string &  str 
)

Definition at line 441 of file CellComplex.cpp.

Referenced by _omitCell().

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

◆ getModel()

GModel* CellComplex::getModel ( ) const
inline

Definition at line 93 of file CellComplex.h.

◆ getNumCells()

int CellComplex::getNumCells ( int  dim,
int  domain = 0 
)

Definition at line 893 of file CellComplex.cpp.

Referenced by _omitCell(), CellComplex(), and getACell().

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

◆ getSize()

int CellComplex::getSize ( int  dim,
bool  orig = false 
)

◆ hasCell()

bool CellComplex::hasCell ( Cell cell,
bool  orig = false 
)

Definition at line 867 of file CellComplex.cpp.

Referenced by coreduceComplex().

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

◆ inSameDomain()

bool CellComplex::inSameDomain ( Cell c1,
Cell c2 
) const
inline

Definition at line 136 of file CellComplex.h.

Referenced by cocombine(), combine(), coreduction(), and reduction().

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

◆ insertCell()

void CellComplex::insertCell ( Cell cell)
private

Definition at line 245 of file CellComplex.cpp.

Referenced by cocombine(), combine(), coreduceComplex(), and reduceComplex().

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

◆ isReduced()

bool CellComplex::isReduced ( ) const
inline

Definition at line 175 of file CellComplex.h.

◆ lastCell()

citer CellComplex::lastCell ( int  dim,
bool  orig = false 
)
inline

◆ loadComplex()

int CellComplex::loadComplex ( const std::string &  filename)

Definition at line 1028 of file CellComplex.cpp.

◆ printComplex()

void CellComplex::printComplex ( int  dim)

Definition at line 975 of file CellComplex.cpp.

Here is the call graph for this function:

◆ printEuler()

void CellComplex::printEuler ( )
inline

Definition at line 181 of file CellComplex.h.

Here is the call graph for this function:

◆ reduceComplex()

int CellComplex::reduceComplex ( int  combine = 1,
bool  omit = true,
bool  homseq = false 
)

Definition at line 499 of file CellComplex.cpp.

Referenced by bettiReduceComplex().

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

◆ reduction()

int CellComplex::reduction ( int  dim,
int  omit,
std::vector< Cell * > &  omittedCells 
)

Definition at line 343 of file CellComplex.cpp.

Referenced by _omitCell(), and reduceComplex().

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

◆ relative()

bool CellComplex::relative ( ) const
inline

Definition at line 96 of file CellComplex.h.

Referenced by coreduceComplex(), getDomain(), reduceComplex(), removeCell(), and restoreComplex().

Here is the caller graph for this function:

◆ removeCell()

void CellComplex::removeCell ( Cell cell,
bool  other = true,
bool  del = false 
)
private

Definition at line 256 of file CellComplex.cpp.

Referenced by _omitCell(), _removeCells(), cocombine(), combine(), coreduction(), reduction(), removeCells(), and removeSubdomain().

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

◆ removeCells()

void CellComplex::removeCells ( int  dim)

Definition at line 568 of file CellComplex.cpp.

Here is the call graph for this function:

◆ removeSubdomain()

void CellComplex::removeSubdomain ( )

Definition at line 555 of file CellComplex.cpp.

Referenced by coreduceComplex(), and reduceComplex().

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

◆ restoreComplex()

bool CellComplex::restoreComplex ( )

Definition at line 929 of file CellComplex.cpp.

Here is the call graph for this function:

◆ saveComplex()

int CellComplex::saveComplex ( const std::string &  filename)

Definition at line 987 of file CellComplex.cpp.

◆ simplicial()

bool CellComplex::simplicial ( ) const
inline

Definition at line 95 of file CellComplex.h.

Member Data Documentation

◆ _biggestCell

std::pair<Cell *, double> CellComplex::_biggestCell
private

Definition at line 27 of file CellComplex.h.

Referenced by _insertCells(), CellComplex(), and coreduceComplex().

◆ _cells

◆ _createCount

int CellComplex::_createCount
private

Definition at line 54 of file CellComplex.h.

Referenced by _insertCells(), _omitCell(), CellComplex(), cocombine(), combine(), and ~CellComplex().

◆ _deleteCount

int CellComplex::_deleteCount
private

Definition at line 53 of file CellComplex.h.

Referenced by CellComplex(), cocombine(), combine(), restoreComplex(), and ~CellComplex().

◆ _dim

int CellComplex::_dim
private

Definition at line 42 of file CellComplex.h.

Referenced by _insertCells(), CellComplex(), and getDim().

◆ _model

GModel* CellComplex::_model
private

Definition at line 29 of file CellComplex.h.

Referenced by getModel().

◆ _numRelativeCells

int CellComplex::_numRelativeCells[4]
private

Definition at line 59 of file CellComplex.h.

Referenced by CellComplex(), getNumCells(), removeCell(), and restoreComplex().

◆ _numSubdomainCells

int CellComplex::_numSubdomainCells[4]
private

Definition at line 60 of file CellComplex.h.

Referenced by CellComplex(), getNumCells(), removeCell(), and restoreComplex().

◆ _ocells

std::set<Cell *, CellPtrLessThan> CellComplex::_ocells[4]
private

Definition at line 36 of file CellComplex.h.

Referenced by CellComplex(), firstCell(), getSize(), hasCell(), lastCell(), and restoreComplex().

◆ _patience

double CellComplex::_patience = 10
staticprivate

Definition at line 82 of file CellComplex.h.

Referenced by _insertCells(), cocombine(), combine(), coreduceComplex(), and reduceComplex().

◆ _reduced

◆ _relative

bool CellComplex::_relative
private

Definition at line 51 of file CellComplex.h.

Referenced by CellComplex(), and relative().

◆ _removedcells

std::vector<Cell *> CellComplex::_removedcells
private

Definition at line 39 of file CellComplex.h.

Referenced by removeCell(), restoreComplex(), and ~CellComplex().

◆ _saveorig

bool CellComplex::_saveorig
private

Definition at line 48 of file CellComplex.h.

Referenced by CellComplex(), and restoreComplex().

◆ _simplicial

bool CellComplex::_simplicial
private

Definition at line 45 of file CellComplex.h.

Referenced by _insertCells(), and simplicial().

◆ _smallestCell

std::pair<Cell *, double> CellComplex::_smallestCell
private

Definition at line 26 of file CellComplex.h.

Referenced by _insertCells(), CellComplex(), and coreduceComplex().


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