The Original CHomP Software
|
The class that defines a geometric complex - a set of cells (cubes, simplices, etc). More...
#include <gcomplex.h>
Public Member Functions | |
gcomplex () | |
The default constructor. More... | |
gcomplex (const gcomplex< cell, euclidom > &c) | |
The copy constructor. More... | |
~gcomplex () | |
The destructor. More... | |
gcomplex & | operator= (const gcomplex< cell, euclidom > &c) |
The assignment operator. More... | |
int | dim () const |
Returns the dimension of the complex, that is, the highest dimension of any cell contained in the complex. More... | |
int_t | size () const |
Returns the number of cells in the complex. More... | |
bool | empty () const |
Returns 'true' iff the cell complex is empty. More... | |
const hashedset< cell > & | operator[] (int d) const |
Returns the set of cells of the given dimension. More... | |
const hashedset< cell > & | getcob (const cell &c) const |
Returns the coboundary of the given cell. More... | |
const hashedset< cell > & | getcob (const cell &c, int d) const |
Returns the coboundary of the given cell. More... | |
gcomplex< cell, euclidom > & | add (const cell &c) |
Add a cell to the geometric complex. More... | |
gcomplex< cell, euclidom > & | add (const hashedset< cell > &c, int d) |
Adds a set of cells to the geometric complex. More... | |
gcomplex< cell, euclidom > & | add (const hashedset< cell > &c) |
Adds a set of cells to the geometric complex. More... | |
gcomplex< cell, euclidom > & | add (const gcomplex< cell, euclidom > &c) |
Adds all the cells from a geometric complex. More... | |
gcomplex< cell, euclidom > & | remove (const cell &c) |
Remove a cell from the geometric complex. More... | |
gcomplex< cell, euclidom > & | remove (const hashedset< cell > &c, int d) |
Removes a set of cells to the geometric complex. More... | |
gcomplex< cell, euclidom > & | remove (const hashedset< cell > &c) |
Removes a set of cells to the geometric complex. More... | |
gcomplex< cell, euclidom > & | remove (const gcomplex< cell, euclidom > &c) |
Adds all the cells from a geometric complex. More... | |
gcomplex< cell, euclidom > & | removeall (int d) |
Remove all the cells of the given dimension. More... | |
bool | check (const cell &c) const |
Check whether the given cell is in the complex. More... | |
int_t | addboundaries (int d, bool addcob=false) |
Adds boundaries of all the cells of given dimension to the geometric complex. More... | |
int_t | addboundaries (bool addcob=false) |
Adds boundaries of all the cells of all dimensions to the geometric complex. More... | |
int_t | addboundaries (int d, gcomplex< cell, euclidom > ¬these, bool keepused=false) |
Adds boundaries of all the cells of given dimension to the geometric complex, except for the cells which belong to the geometric complex "notthese". More... | |
int_t | addboundaries (gcomplex< cell, euclidom > ¬these, bool keepused=false) |
Adds boundaries of all the cells of all dimensions to the geometric complex, except for the cells which belong to the geometric complex "notthese". More... | |
int_t | addboundaries (int d, chaincomplex< euclidom > &c) |
Adds boundaries and also fills in the given chain complex. More... | |
int_t | addboundaries (chaincomplex< euclidom > &c) |
Adds boundaries and also fills in the given chain complex. More... | |
int_t | addboundaries (int d, chaincomplex< euclidom > &c, gcomplex< cell, euclidom > ¬these, bool keepused=false) |
Adds boundaries and also fills in the given chain complex. More... | |
int_t | addboundaries (chaincomplex< euclidom > &c, gcomplex< cell, euclidom > ¬these, bool keepused=false) |
Adds boundaries and also fills in the given chain complex. More... | |
int_t | addboundaries (int d, chaincomplex< euclidom > *c, gcomplex< cell, euclidom > *notthese, bool dontadd, bool keepused, bool addcob) |
The actual function that is used for all the functions for adding boundaries of a fixed dimension. More... | |
int_t | addboundaries (chaincomplex< euclidom > *c, gcomplex< cell, euclidom > *notthese, bool dontadd, bool keepused, bool addcob) |
The actual function that is used for all the functions for adding boundaries of all dimensions. More... | |
int_t | collapse (int d, gcomplex< cell, euclidom > &other, const gcomplex< cell, euclidom > &keep, bool addbd, bool addcob, bool disjoint, bool quiet=false) |
Adds boundaries of all the cells of the given dimension and then performs free face collapses. More... | |
int_t | collapse (gcomplex< cell, euclidom > &other, gcomplex< cell, euclidom > &keep, bool addbd, bool addcob, bool disjoint, const int *level=NULL, bool quiet=false) |
Adds boundaries to 'other' and 'keep', and then does the free face collapses. More... | |
Private Member Functions | |
void | increasedimension (int d) |
Increases the dimension of the complex to take this cell. More... | |
void | decreasedimension () |
Frees empty sets if there are no cells of high dimensions. More... | |
Private Attributes | |
hashedset< cell > ** | tab |
The tables with cells of dimension 0, 1, 2, etc. More... | |
mvmap< cell, cell > ** | cob |
The tables with coboundaries of cells of these dimensions. More... | |
int | n |
The number of tables. More... | |
The class that defines a geometric complex - a set of cells (cubes, simplices, etc).
Each cell has its dimension returned by the method "dim ()" of the cell object. Additionally, the following functions must be defined for the cell objects: "boundarylength (cell)" returns the length of the boundary of a cell (i.e., the number of lower-dimensional cells in its boundary), "boundarycell (cell, i)" returns the i-th cell in the boundary, and "boundarycoef (cell, i)" returns the i-th integer coefficient in the boundary.
Definition at line 84 of file gcomplex.h.
|
inline |
The default constructor.
Definition at line 252 of file gcomplex.h.
chomp::homology::gcomplex< cell, euclidom >::gcomplex | ( | const gcomplex< cell, euclidom > & | c | ) |
The copy constructor.
Definition at line 258 of file gcomplex.h.
chomp::homology::gcomplex< cell, euclidom >::~gcomplex |
The destructor.
Definition at line 337 of file gcomplex.h.
|
inline |
Add a cell to the geometric complex.
Definition at line 405 of file gcomplex.h.
gcomplex< cell, euclidom > & chomp::homology::gcomplex< cell, euclidom >::add | ( | const gcomplex< cell, euclidom > & | c | ) |
Adds all the cells from a geometric complex.
Definition at line 449 of file gcomplex.h.
gcomplex< cell, euclidom > & chomp::homology::gcomplex< cell, euclidom >::add | ( | const hashedset< cell > & | c | ) |
Adds a set of cells to the geometric complex.
Definition at line 438 of file gcomplex.h.
|
inline |
Adds a set of cells to the geometric complex.
It is assumed that all the cells have dimension d.
Definition at line 424 of file gcomplex.h.
|
inline |
Adds boundaries of all the cells of all dimensions to the geometric complex.
If requested, keeps the information about the coboundaries. Returns the number of cells added.
Definition at line 653 of file gcomplex.h.
References chomp::homology::addboundaries().
|
inline |
Adds boundaries and also fills in the given chain complex.
Definition at line 680 of file gcomplex.h.
References chomp::homology::addboundaries().
|
inline |
Adds boundaries and also fills in the given chain complex.
Definition at line 694 of file gcomplex.h.
References chomp::homology::addboundaries().
int_t chomp::homology::gcomplex< cell, euclidom >::addboundaries | ( | chaincomplex< euclidom > * | c, |
gcomplex< cell, euclidom > * | notthese, | ||
bool | dontadd, | ||
bool | keepused, | ||
bool | addcob | ||
) |
The actual function that is used for all the functions for adding boundaries of all dimensions.
Definition at line 635 of file gcomplex.h.
References chomp::homology::addboundaries().
int_t chomp::homology::gcomplex< cell, euclidom >::addboundaries | ( | gcomplex< cell, euclidom > & | notthese, |
bool | keepused = false |
||
) |
Adds boundaries of all the cells of all dimensions to the geometric complex, except for the cells which belong to the geometric complex "notthese".
If "keepused" is set to false, then cells whose boundaries have been added are removed from the geometric complex; otherwise, they are kept there. Returns the number of cells added.
Definition at line 666 of file gcomplex.h.
References chomp::homology::addboundaries().
|
inline |
Adds boundaries of all the cells of given dimension to the geometric complex.
If requested, keeps the information about the coboundaries. Returns the number of cells added.
Definition at line 647 of file gcomplex.h.
References chomp::homology::addboundaries().
|
inline |
Adds boundaries and also fills in the given chain complex.
Definition at line 673 of file gcomplex.h.
References chomp::homology::addboundaries().
|
inline |
Adds boundaries and also fills in the given chain complex.
Definition at line 686 of file gcomplex.h.
References chomp::homology::addboundaries().
int_t chomp::homology::gcomplex< cell, euclidom >::addboundaries | ( | int | d, |
chaincomplex< euclidom > * | c, | ||
gcomplex< cell, euclidom > * | notthese, | ||
bool | dontadd, | ||
bool | keepused, | ||
bool | addcob | ||
) |
The actual function that is used for all the functions for adding boundaries of a fixed dimension.
Definition at line 579 of file gcomplex.h.
References chomp::homology::addboundaries(), chomp::homology::boundarycell(), chomp::homology::boundarycoef(), and chomp::homology::boundarylength().
|
inline |
Adds boundaries of all the cells of given dimension to the geometric complex, except for the cells which belong to the geometric complex "notthese".
If "keepused" is set to false, then cells whose boundaries have been added are removed from the geometric complex; otherwise, they are kept there. Returns the number of cells added.
Definition at line 659 of file gcomplex.h.
References chomp::homology::addboundaries().
bool chomp::homology::gcomplex< cell, euclidom >::check | ( | const cell & | c | ) | const |
Check whether the given cell is in the complex.
Returns true if yes, false if not.
Definition at line 562 of file gcomplex.h.
int_t chomp::homology::gcomplex< cell, euclidom >::collapse | ( | gcomplex< cell, euclidom > & | other, |
gcomplex< cell, euclidom > & | keep, | ||
bool | addbd, | ||
bool | addcob, | ||
bool | disjoint, | ||
const int * | level = NULL , |
||
bool | quiet = false |
||
) |
Adds boundaries to 'other' and 'keep', and then does the free face collapses.
Does this at all levels or only the necessary ones. Remove sfrom 'other' cells that are not in the result. If 'disjoint', then removes 'other' from 'this'. Removes from 'keep' cells not contained in the result. Returns the number of collapses performed.
Definition at line 995 of file gcomplex.h.
References chomp::homology::addboundaries(), chomp::homology::collapse(), and chomp::homology::scon.
int_t chomp::homology::gcomplex< cell, euclidom >::collapse | ( | int | d, |
gcomplex< cell, euclidom > & | other, | ||
const gcomplex< cell, euclidom > & | keep, | ||
bool | addbd, | ||
bool | addcob, | ||
bool | disjoint, | ||
bool | quiet = false |
||
) |
Adds boundaries of all the cells of the given dimension and then performs free face collapses.
Does not remove cells listed in 'keep'. Removes from 'other' and 'this' unnecessary d-dim cells. Returns the number of collapses performed.
Definition at line 752 of file gcomplex.h.
References chomp::homology::boundarycell(), chomp::homology::boundarylength(), chomp::homology::decreasedimension(), chomp::homology::findelem(), chomp::homology::scon, and chomp::homology::sseq.
|
private |
Frees empty sets if there are no cells of high dimensions.
Definition at line 1103 of file gcomplex.h.
|
inline |
Returns the dimension of the complex, that is, the highest dimension of any cell contained in the complex.
Definition at line 354 of file gcomplex.h.
bool chomp::homology::gcomplex< cell, euclidom >::empty |
|
inline |
Returns the coboundary of the given cell.
Definition at line 389 of file gcomplex.h.
|
inline |
Returns the coboundary of the given cell.
The dimension of the cell must be given.
Definition at line 396 of file gcomplex.h.
|
private |
Increases the dimension of the complex to take this cell.
Definition at line 1068 of file gcomplex.h.
gcomplex< cell, euclidom > & chomp::homology::gcomplex< cell, euclidom >::operator= | ( | const gcomplex< cell, euclidom > & | c | ) |
The assignment operator.
Definition at line 284 of file gcomplex.h.
|
inline |
Returns the set of cells of the given dimension.
Definition at line 380 of file gcomplex.h.
|
inline |
Remove a cell from the geometric complex.
Definition at line 476 of file gcomplex.h.
References chomp::homology::decreasedimension().
gcomplex< cell, euclidom > & chomp::homology::gcomplex< cell, euclidom >::remove | ( | const gcomplex< cell, euclidom > & | c | ) |
Adds all the cells from a geometric complex.
Definition at line 500 of file gcomplex.h.
References chomp::homology::decreasedimension().
gcomplex< cell, euclidom > & chomp::homology::gcomplex< cell, euclidom >::remove | ( | const hashedset< cell > & | c | ) |
|
inline |
Removes a set of cells to the geometric complex.
It is assumed that all the cells have dimension d.
Definition at line 519 of file gcomplex.h.
References chomp::homology::decreasedimension().
gcomplex< cell, euclidom > & chomp::homology::gcomplex< cell, euclidom >::removeall | ( | int | d | ) |
Remove all the cells of the given dimension.
Definition at line 543 of file gcomplex.h.
References chomp::homology::decreasedimension().
int_t chomp::homology::gcomplex< cell, euclidom >::size |
|
private |
The tables with coboundaries of cells of these dimensions.
Definition at line 236 of file gcomplex.h.
|
private |
The number of tables.
Definition at line 239 of file gcomplex.h.
|
private |
The tables with cells of dimension 0, 1, 2, etc.
Definition at line 233 of file gcomplex.h.