The ChainCon Software (Release 0.03)
Public Types | Public Member Functions | Private Attributes | List of all members
tSimplSet< CellT > Class Template Reference

A simplicial set. More...

#include <simplset.h>

Public Types

typedef CellT CellType
 The type of the vertex. More...
 
typedef CellT value_type
 The type of elements in the filtered complex perceived as a standard-type aggregate. More...
 

Public Member Functions

 tSimplSet ()
 The default constructor of an empty set. More...
 
 tSimplSet (const tSimplSet< CellT > &s)
 The copy constructor. More...
 
tSimplSet< CellT > & operator= (const tSimplSet< CellT > &s)
 The assignment operator. More...
 
 ~tSimplSet ()
 The destructor. More...
 
bool operator== (const tSimplSet< CellT > &s) const
 The equality operator. More...
 
void swap (tSimplSet< CellT > &s)
 Swaps the data between two simplicial sets. More...
 
int dim () const
 Returns the dimension of the highest-dimensional non-degenerate cell in the simplicial set, or -1 if none. More...
 
int_t add (const CellT &c)
 Adds a cell to the complex. More...
 
int_t getNumber (const CellT &c) const
 Finds a cell in the complex. More...
 
bool check (const CellT &c) const
 Checks if a cell is in the complex. More...
 
int_t size () const
 Returns the number of cells in the simplicial set. More...
 
bool empty () const
 Returns the information on whether the complex is empty or not. More...
 
const CellT & operator[] (int_t n) const
 Returns the given cell in the simplicial set. More...
 
int_t addFaces (int dim)
 Adds faces of all the cells of the given dimension. More...
 
int_t addFaces ()
 Adds faces of all the cells in the set. More...
 
int_t addDegenerate (int minDim, int maxDim)
 Adds degenerate cells for all cells whose dimension falls within the given range, including minDim, up to but excluding maxDim. More...
 
int_t normalize ()
 Normalizes the set of cells, that is, removes degenerate cells. More...
 
int_t addRef ()
 Adds 1 to the reference counter. More...
 
int_t delRef ()
 Subtracts 1 from the reference counter. More...
 

Private Attributes

int dimension
 The highest dimension of a non-degenerate cell. More...
 
chomp::homology::hashedset< CellT > cells
 The set of all the cells in the complex. More...
 
int_t refCount
 Reference counter. More...
 

Detailed Description

template<class CellT>
class tSimplSet< CellT >

A simplicial set.

Definition at line 51 of file simplset.h.

Member Typedef Documentation

◆ CellType

template<class CellT>
typedef CellT tSimplSet< CellT >::CellType

The type of the vertex.

Definition at line 55 of file simplset.h.

◆ value_type

template<class CellT>
typedef CellT tSimplSet< CellT >::value_type

The type of elements in the filtered complex perceived as a standard-type aggregate.

Definition at line 59 of file simplset.h.

Constructor & Destructor Documentation

◆ tSimplSet() [1/2]

template<class CellT >
tSimplSet< CellT >::tSimplSet ( )
inline

The default constructor of an empty set.

Definition at line 151 of file simplset.h.

◆ tSimplSet() [2/2]

template<class CellT >
tSimplSet< CellT >::tSimplSet ( const tSimplSet< CellT > &  s)
inline

The copy constructor.

Definition at line 158 of file simplset.h.

◆ ~tSimplSet()

template<class CellT >
tSimplSet< CellT >::~tSimplSet ( )
inline

The destructor.

Definition at line 182 of file simplset.h.

References tSimplSet< CellT >::refCount.

Member Function Documentation

◆ add()

template<class CellT >
int_t tSimplSet< CellT >::add ( const CellT &  c)
inline

Adds a cell to the complex.

Does not add its boundary cells. Returns the number of the added cell in the complex.

Definition at line 222 of file simplset.h.

References tSimplSet< CellT >::cells, tSimplSet< CellT >::dim(), and tSimplSet< CellT >::dimension.

Referenced by tSimplSet< CellT >::addDegenerate(), tSimplSet< CellT >::addFaces(), and operator>>().

◆ addDegenerate()

template<class CellT >
int_t tSimplSet< CellT >::addDegenerate ( int  minDim,
int  maxDim 
)
inline

Adds degenerate cells for all cells whose dimension falls within the given range, including minDim, up to but excluding maxDim.

Also adds degenerate cells for all the added cells, taking the dimension criterion into consideration. Returns the number of degenerate cells added.

Definition at line 290 of file simplset.h.

References tSimplSet< CellT >::add(), tSimplSet< CellT >::cells, tSimplSet< CellT >::dim(), and tSimplSet< CellT >::size().

◆ addFaces() [1/2]

template<class CellT >
int_t tSimplSet< CellT >::addFaces ( int  dim)
inline

Adds faces of all the cells of the given dimension.

Returns the number of faces added.

Definition at line 265 of file simplset.h.

References tSimplSet< CellT >::add(), tSimplSet< CellT >::cells, tSimplSet< CellT >::dim(), and tSimplSet< CellT >::size().

◆ addFaces() [2/2]

template<class CellT >
int_t tSimplSet< CellT >::addFaces ( )
inline

Adds faces of all the cells in the set.

Returns the number of faces added.

Definition at line 281 of file simplset.h.

References tSimplSet< CellT >::dim(), and tSimplSet< CellT >::dimension.

◆ addRef()

template<class CellT >
int_t tSimplSet< CellT >::addRef ( )
inline

Adds 1 to the reference counter.

If in use, returns the number that indicates how many references to the object exist.

Definition at line 321 of file simplset.h.

References tSimplSet< CellT >::refCount.

◆ check()

template<class CellT >
bool tSimplSet< CellT >::check ( const CellT &  c) const
inline

Checks if a cell is in the complex.

Definition at line 238 of file simplset.h.

References tSimplSet< CellT >::cells.

◆ delRef()

template<class CellT >
int_t tSimplSet< CellT >::delRef ( )
inline

Subtracts 1 from the reference counter.

If in use, returns the number that indicates how many references of the object remain.

Definition at line 328 of file simplset.h.

References tSimplSet< CellT >::refCount.

◆ dim()

template<class CellT >
int tSimplSet< CellT >::dim ( ) const
inline

Returns the dimension of the highest-dimensional non-degenerate cell in the simplicial set, or -1 if none.

Definition at line 216 of file simplset.h.

References tSimplSet< CellT >::dimension.

Referenced by tSimplSet< CellT >::add(), tSimplSet< CellT >::addDegenerate(), tSimplSet< CellT >::addFaces(), and operator>>().

◆ empty()

template<class CellT >
bool tSimplSet< CellT >::empty ( ) const
inline

Returns the information on whether the complex is empty or not.

Definition at line 250 of file simplset.h.

References tSimplSet< CellT >::cells.

◆ getNumber()

template<class CellT >
int_t tSimplSet< CellT >::getNumber ( const CellT &  c) const
inline

Finds a cell in the complex.

Returns its number or -1 if not found.

Definition at line 232 of file simplset.h.

References tSimplSet< CellT >::cells.

◆ normalize()

template<class CellT >
int_t tSimplSet< CellT >::normalize ( )
inline

Normalizes the set of cells, that is, removes degenerate cells.

Note that the order and the numbers of cells may change. Returns the number of degenerate cells removed.

Definition at line 306 of file simplset.h.

References tSimplSet< CellT >::cells, and tSimplSet< CellT >::size().

◆ operator=()

template<class CellT >
tSimplSet< CellT > & tSimplSet< CellT >::operator= ( const tSimplSet< CellT > &  s)
inline

The assignment operator.

Definition at line 166 of file simplset.h.

References tSimplSet< CellT >::cells, tSimplSet< CellT >::dimension, and tSimplSet< CellT >::refCount.

◆ operator==()

template<class CellT >
bool tSimplSet< CellT >::operator== ( const tSimplSet< CellT > &  s) const
inline

The equality operator.

Definition at line 194 of file simplset.h.

References tSimplSet< CellT >::cells.

◆ operator[]()

template<class CellT >
const CellT & tSimplSet< CellT >::operator[] ( int_t  n) const
inline

Returns the given cell in the simplicial set.

Definition at line 256 of file simplset.h.

References tSimplSet< CellT >::cells, and tSimplSet< CellT >::size().

◆ size()

template<class CellT >
int_t tSimplSet< CellT >::size ( ) const
inline

Returns the number of cells in the simplicial set.

Definition at line 244 of file simplset.h.

References tSimplSet< CellT >::cells.

Referenced by tSimplSet< CellT >::addDegenerate(), tSimplSet< CellT >::addFaces(), tSimplSet< CellT >::normalize(), operator<<(), and tSimplSet< CellT >::operator[]().

◆ swap()

template<class CellT >
void tSimplSet< CellT >::swap ( tSimplSet< CellT > &  s)
inline

Swaps the data between two simplicial sets.

Definition at line 200 of file simplset.h.

References tSimplSet< CellT >::cells, tSimplSet< CellT >::dimension, and tSimplSet< CellT >::refCount.

Member Data Documentation

◆ cells

template<class CellT>
chomp::homology::hashedset<CellT> tSimplSet< CellT >::cells
private

◆ dimension

template<class CellT>
int tSimplSet< CellT >::dimension
private

The highest dimension of a non-degenerate cell.

Definition at line 134 of file simplset.h.

Referenced by tSimplSet< CellT >::add(), tSimplSet< CellT >::addFaces(), tSimplSet< CellT >::dim(), tSimplSet< CellT >::operator=(), and tSimplSet< CellT >::swap().

◆ refCount

template<class CellT>
int_t tSimplSet< CellT >::refCount
private

Reference counter.

If in use, keeps track on how many references to the object exist in the program. Note that if this value is > 0 then the "normalize" operation is not permitted, because it may change the order of cells in the array.

Definition at line 144 of file simplset.h.

Referenced by tSimplSet< CellT >::addRef(), tSimplSet< CellT >::delRef(), tSimplSet< CellT >::operator=(), tSimplSet< CellT >::swap(), and tSimplSet< CellT >::~tSimplSet().


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