The ChainCon Software (Release 0.03)
|
A simplex with vertices of arbitrary type. More...
#include <simplex.h>
Public Types | |
typedef VertexT | VertexType |
The type of the vertex. More... | |
typedef EmptyT | EmptyType |
The type of the empty cell existence decision class. More... | |
Public Member Functions | |
tSimplex () | |
The default constructor of an empty simplex. More... | |
template<class VertexArray > | |
tSimplex (int dimension, const VertexArray &vertices) | |
The constructor of a simplex from an array of vertices. More... | |
tSimplex (const tSimplex< VertexT, EmptyT > &s) | |
The copy constructor. More... | |
tSimplex (const tSimplex< VertexT, EmptyT > &s, int n) | |
The constructor of the n-th face of a simplex (if n >= 0) or the k-th degeneracy operator (if n = -1 - k < 0). More... | |
tSimplex< VertexT, EmptyT > & | operator= (const tSimplex< VertexT, EmptyT > &s) |
The assignment operator. More... | |
~tSimplex () | |
The destructor. More... | |
int | dim () const |
Returns the dimension of the simplex. More... | |
const VertexT & | operator[] (int n) const |
Returns the n-th vertex of the simplex. More... | |
int | boundaryLength () const |
Returns the length of the boundary of the simplex. More... | |
int | boundaryCoef (int n) const |
Returns the n-th coefficient in the boundary of the simplex. More... | |
int | degenerate () const |
Checks if the simplex is degenerate, that is, if it has two identical vertices one after another. More... | |
bool | operator== (const tSimplex< VertexT, EmptyT > &s) const |
The equality operator. More... | |
void | swap (tSimplex< VertexT, EmptyT > &s) |
Swaps the data between two simplices. More... | |
Private Attributes | |
int | dimension |
The dimension of the simplex. More... | |
VertexT * | vertices |
An array of vertices of the simplex. More... | |
A simplex with vertices of arbitrary type.
Note that the vertex type must have hash key functions (defined in chomp/struct/hashsets.h for most built-in integers, defined in chaincon/stringhash.h for std::string, or your own). The empty cell existence decision class must provide a static function "exists" that returns true if the empty cell must be taken into consideration or false otherwise. Important: The vertices are assumed to be given in the ascending order; otherwise the operator == may give false negatives!
typedef VertexT tSimplex< VertexT, EmptyT >::VertexType |
|
inline |
The constructor of a simplex from an array of vertices.
Definition at line 135 of file simplex.h.
References tSimplex< VertexT, EmptyT >::dimension.
|
inline |
The copy constructor.
Definition at line 156 of file simplex.h.
References tSimplex< VertexT, EmptyT >::dimension, and tSimplex< VertexT, EmptyT >::vertices.
|
inline |
The constructor of the n-th face of a simplex (if n >= 0) or the k-th degeneracy operator (if n = -1 - k < 0).
Definition at line 166 of file simplex.h.
References tSimplex< VertexT, EmptyT >::dimension, and tSimplex< VertexT, EmptyT >::vertices.
The destructor.
Definition at line 208 of file simplex.h.
References tSimplex< VertexT, EmptyT >::vertices.
|
inline |
|
inline |
Returns the length of the boundary of the simplex.
Definition at line 228 of file simplex.h.
References tSimplex< VertexT, EmptyT >::dimension.
|
inline |
Checks if the simplex is degenerate, that is, if it has two identical vertices one after another.
If this is the case then returns the position of the second vertex. Returns 0 if the simplex is not degenerate.
Definition at line 243 of file simplex.h.
References tSimplex< VertexT, EmptyT >::dimension, and tSimplex< VertexT, EmptyT >::vertices.
|
inline |
Returns the dimension of the simplex.
Definition at line 216 of file simplex.h.
References tSimplex< VertexT, EmptyT >::dimension.
Referenced by hashkey1(), hashkey2(), and operator<<().
|
inline |
The assignment operator.
Definition at line 192 of file simplex.h.
References tSimplex< VertexT, EmptyT >::dimension, and tSimplex< VertexT, EmptyT >::vertices.
|
inline |
The equality operator.
Verifies if the vertices are the same and in the same order. Note that this may result in false negatives if the vertices are stored in various orders.
Definition at line 255 of file simplex.h.
References tSimplex< VertexT, EmptyT >::dimension, and tSimplex< VertexT, EmptyT >::vertices.
|
inline |
Returns the n-th vertex of the simplex.
Definition at line 222 of file simplex.h.
References tSimplex< VertexT, EmptyT >::vertices.
|
inline |
Swaps the data between two simplices.
Definition at line 268 of file simplex.h.
References tSimplex< VertexT, EmptyT >::dimension, and tSimplex< VertexT, EmptyT >::vertices.
|
private |
The dimension of the simplex.
Definition at line 118 of file simplex.h.
Referenced by tSimplex< VertexT, EmptyT >::boundaryLength(), tSimplex< VertexT, EmptyT >::degenerate(), tSimplex< VertexT, EmptyT >::dim(), tSimplex< VertexT, EmptyT >::operator=(), tSimplex< VertexT, EmptyT >::operator==(), tSimplex< VertexT, EmptyT >::swap(), and tSimplex< VertexT, EmptyT >::tSimplex().
|
private |
An array of vertices of the simplex.
Definition at line 121 of file simplex.h.
Referenced by tSimplex< VertexT, EmptyT >::degenerate(), tSimplex< VertexT, EmptyT >::operator=(), tSimplex< VertexT, EmptyT >::operator==(), operator>>(), tSimplex< VertexT, EmptyT >::operator[](), tSimplex< VertexT, EmptyT >::swap(), tSimplex< VertexT, EmptyT >::tSimplex(), and tSimplex< VertexT, EmptyT >::~tSimplex().