The ChainCon Software (Release 0.03)
Public Types | Public Member Functions | Protected Attributes | List of all members
tCubCell< CoordT, WrapT, EmptyT > Class Template Reference

An elementary cubical cell with vertex coordinates of integer type. More...

#include <cubcell.h>

Public Types

typedef CoordT CoordType
 The type of coordinates. More...
 
typedef WrapT WrapType
 The type of the coord wrapping class. More...
 
typedef EmptyT EmptyType
 The type of the empty cell existence decision class. More...
 

Public Member Functions

 tCubCell ()
 The default constructor of an empty cube. More...
 
template<class CoordArray >
 tCubCell (int dimension, const CoordArray &coordinates)
 The constructor of a full cube from an array of coordinates. More...
 
template<class CoordArray >
 tCubCell (int dimension, const CoordArray &left, const CoordArray &right)
 The constructor of a full cube from two arrays of coordinates. More...
 
 tCubCell (const tCubCell< CoordT, WrapT, EmptyT > &c)
 The copy constructor. More...
 
 tCubCell (const tCubCell< CoordT, WrapT, EmptyT > &c, int n)
 The constructor of the n-th boundary cube. More...
 
 tCubCell (const tCubCell< CoordT, WrapT, EmptyT > &c, int n, int side)
 The constructor of the n-th component of the Alexander-Whitney diagonal, either the left one (if side = 0), or the right one (if side = 1). More...
 
tCubCell< CoordT, WrapT, EmptyT > & operator= (const tCubCell< CoordT, WrapT, EmptyT > &s)
 The assignment operator. More...
 
 ~tCubCell ()
 The destructor. More...
 
int spaceDim () const
 Returns the dimension of the embedding space. More...
 
int dim () const
 Returns the dimension of the elementary cube. More...
 
const CoordT left (int n) const
 Returns the n-th left coordinate of the elementary cube. More...
 
const CoordT right (int n) const
 Returns the n-th right coordinate of the elementary cube. More...
 
int boundaryLength () const
 Returns the length of the boundary of the elementary cube. More...
 
int boundaryCoef (int n) const
 Returns the n-th coefficient in the boundary of the cube. More...
 
int diagonalLength () const
 Returns the number of terms in the Alexander-Whitneney diagonal. More...
 
int_t hashkey1 () const
 Returns hashing key no. 1, based on the internal data. More...
 
int_t hashkey2 () const
 Return shashing key no. 2, based on the internal data. More...
 
bool operator== (const tCubCell< CoordT, WrapT, EmptyT > &s) const
 Returns true if and only if the cubes are the same. More...
 
void swap (tCubCell< CoordT, WrapT, EmptyT > &s)
 Swaps the data between two cubical cells. More...
 

Protected Attributes

int_t n1
 The number that defines the left corner of the elementary cube. More...
 
int_t n2
 The number that defines the right corner of the elementary cube. More...
 

Detailed Description

template<class CoordT, class WrapT, class EmptyT>
class tCubCell< CoordT, WrapT, EmptyT >

An elementary cubical cell with vertex coordinates of integer type.

Note that unless using the most standard built-in integers, the vertex coordinate integer type must have hash key functions (hashkey1 and hashkey2, see e.g. those in chomp/struct/hashsets.h). The wrapping class must provide a static function "wrap" for wrapping the coordinates, separately at each dimension. 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.

Definition at line 63 of file cubcell.h.

Member Typedef Documentation

◆ CoordType

template<class CoordT, class WrapT, class EmptyT>
typedef CoordT tCubCell< CoordT, WrapT, EmptyT >::CoordType

The type of coordinates.

Definition at line 67 of file cubcell.h.

◆ EmptyType

template<class CoordT, class WrapT, class EmptyT>
typedef EmptyT tCubCell< CoordT, WrapT, EmptyT >::EmptyType

The type of the empty cell existence decision class.

Definition at line 73 of file cubcell.h.

◆ WrapType

template<class CoordT, class WrapT, class EmptyT>
typedef WrapT tCubCell< CoordT, WrapT, EmptyT >::WrapType

The type of the coord wrapping class.

Definition at line 70 of file cubcell.h.

Constructor & Destructor Documentation

◆ tCubCell() [1/6]

template<class CoordT , class WrapT , class EmptyT >
tCubCell< CoordT, WrapT, EmptyT >::tCubCell ( )
inline

The default constructor of an empty cube.

Definition at line 156 of file cubcell.h.

Referenced by tCubCell< CoordT, WrapT, EmptyT >::tCubCell().

◆ tCubCell() [2/6]

template<class CoordT , class WrapT , class EmptyT >
template<class CoordArray >
tCubCell< CoordT, WrapT, EmptyT >::tCubCell ( int  dimension,
const CoordArray &  coordinates 
)
inline

The constructor of a full cube from an array of coordinates.

Definition at line 163 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::n1, and tCubCell< CoordT, WrapT, EmptyT >::n2.

◆ tCubCell() [3/6]

template<class CoordT , class WrapT , class EmptyT >
template<class CoordArray >
tCubCell< CoordT, WrapT, EmptyT >::tCubCell ( int  dimension,
const CoordArray &  left,
const CoordArray &  right 
)
inline

The constructor of a full cube from two arrays of coordinates.

Definition at line 195 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::n1, tCubCell< CoordT, WrapT, EmptyT >::n2, and tCubCell< CoordT, WrapT, EmptyT >::tCubCell().

◆ tCubCell() [4/6]

template<class CoordT , class WrapT , class EmptyT >
tCubCell< CoordT, WrapT, EmptyT >::tCubCell ( const tCubCell< CoordT, WrapT, EmptyT > &  c)
inline

The copy constructor.

Definition at line 235 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::tCubCell().

◆ tCubCell() [5/6]

template<class CoordT , class WrapT , class EmptyT >
tCubCell< CoordT, WrapT, EmptyT >::tCubCell ( const tCubCell< CoordT, WrapT, EmptyT > &  c,
int  n 
)
inline

◆ tCubCell() [6/6]

template<class CoordT , class WrapT , class EmptyT >
tCubCell< CoordT, WrapT, EmptyT >::tCubCell ( const tCubCell< CoordT, WrapT, EmptyT > &  c,
int  n,
int  side 
)
inline

The constructor of the n-th component of the Alexander-Whitney diagonal, either the left one (if side = 0), or the right one (if side = 1).

Definition at line 316 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::dim(), tCubCell< CoordT, WrapT, EmptyT >::left(), tCubCell< CoordT, WrapT, EmptyT >::n1, tCubCell< CoordT, WrapT, EmptyT >::n2, tCubCell< CoordT, WrapT, EmptyT >::right(), and tCubCell< CoordT, WrapT, EmptyT >::spaceDim().

◆ ~tCubCell()

template<class CoordT , class WrapT , class EmptyT >
tCubCell< CoordT, WrapT, EmptyT >::~tCubCell ( )
inline

The destructor.

Definition at line 475 of file cubcell.h.

Member Function Documentation

◆ boundaryCoef()

template<class CoordT , class WrapT , class EmptyT >
int tCubCell< CoordT, WrapT, EmptyT >::boundaryCoef ( int  n) const
inline

Returns the n-th coefficient in the boundary of the cube.

Definition at line 519 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::dim().

◆ boundaryLength()

template<class CoordT , class WrapT , class EmptyT >
int tCubCell< CoordT, WrapT, EmptyT >::boundaryLength ( ) const
inline

Returns the length of the boundary of the elementary cube.

Definition at line 509 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::dim().

◆ diagonalLength()

template<class CoordT , class WrapT , class EmptyT >
int tCubCell< CoordT, WrapT, EmptyT >::diagonalLength ( ) const
inline

Returns the number of terms in the Alexander-Whitneney diagonal.

Definition at line 530 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::dim().

◆ dim()

template<class CoordT , class WrapT , class EmptyT >
int tCubCell< CoordT, WrapT, EmptyT >::dim ( ) const
inline

◆ hashkey1()

template<class CoordT , class WrapT , class EmptyT >
int_t tCubCell< CoordT, WrapT, EmptyT >::hashkey1 ( ) const
inline

Returns hashing key no. 1, based on the internal data.

Definition at line 538 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::n1, and tCubCell< CoordT, WrapT, EmptyT >::n2.

Referenced by hashkey1().

◆ hashkey2()

template<class CoordT , class WrapT , class EmptyT >
int_t tCubCell< CoordT, WrapT, EmptyT >::hashkey2 ( ) const
inline

Return shashing key no. 2, based on the internal data.

Definition at line 545 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::n1, and tCubCell< CoordT, WrapT, EmptyT >::n2.

Referenced by hashkey2().

◆ left()

template<class CoordT , class WrapT , class EmptyT >
const CoordT tCubCell< CoordT, WrapT, EmptyT >::left ( int  n) const
inline

Returns the n-th left coordinate of the elementary cube.

Definition at line 495 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::n1, and tCubCell< CoordT, WrapT, EmptyT >::spaceDim().

Referenced by operator<<(), operator>>(), and tCubCell< CoordT, WrapT, EmptyT >::tCubCell().

◆ operator=()

template<class CoordT , class WrapT , class EmptyT >
tCubCell< CoordT, WrapT, EmptyT > & tCubCell< CoordT, WrapT, EmptyT >::operator= ( const tCubCell< CoordT, WrapT, EmptyT > &  s)
inline

The assignment operator.

Definition at line 467 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::n1, and tCubCell< CoordT, WrapT, EmptyT >::n2.

◆ operator==()

template<class CoordT , class WrapT , class EmptyT >
bool tCubCell< CoordT, WrapT, EmptyT >::operator== ( const tCubCell< CoordT, WrapT, EmptyT > &  s) const
inline

Returns true if and only if the cubes are the same.

Definition at line 553 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::n1, tCubCell< CoordT, WrapT, EmptyT >::n2, and tCubCell< CoordT, WrapT, EmptyT >::swap().

◆ right()

template<class CoordT , class WrapT , class EmptyT >
const CoordT tCubCell< CoordT, WrapT, EmptyT >::right ( int  n) const
inline

Returns the n-th right coordinate of the elementary cube.

Definition at line 502 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::n2, and tCubCell< CoordT, WrapT, EmptyT >::spaceDim().

Referenced by operator<<(), operator>>(), and tCubCell< CoordT, WrapT, EmptyT >::tCubCell().

◆ spaceDim()

template<class CoordT , class WrapT , class EmptyT >
int tCubCell< CoordT, WrapT, EmptyT >::spaceDim ( ) const
inline

◆ swap()

template<class CoordT , class WrapT , class EmptyT >
void tCubCell< CoordT, WrapT, EmptyT >::swap ( tCubCell< CoordT, WrapT, EmptyT > &  s)
inline

Swaps the data between two cubical cells.

Definition at line 560 of file cubcell.h.

References tCubCell< CoordT, WrapT, EmptyT >::n1, and tCubCell< CoordT, WrapT, EmptyT >::n2.

Referenced by tCubCell< CoordT, WrapT, EmptyT >::operator==().

Member Data Documentation

◆ n1

template<class CoordT, class WrapT, class EmptyT>
int_t tCubCell< CoordT, WrapT, EmptyT >::n1
protected

◆ n2

template<class CoordT, class WrapT, class EmptyT>
int_t tCubCell< CoordT, WrapT, EmptyT >::n2
protected

The number that defines the right corner of the elementary cube.

The dimension of the cubical cell is stored in the high bits of this number. As an exception, the empty cell has this number set to 0.

Definition at line 149 of file cubcell.h.

Referenced by tCubCell< CoordT, WrapT, EmptyT >::dim(), tCubCell< CoordT, WrapT, EmptyT >::hashkey1(), tCubCell< CoordT, WrapT, EmptyT >::hashkey2(), tCubCell< CoordT, WrapT, EmptyT >::operator=(), tCubCell< CoordT, WrapT, EmptyT >::operator==(), tCubCell< CoordT, WrapT, EmptyT >::right(), tCubCell< CoordT, WrapT, EmptyT >::swap(), and tCubCell< CoordT, WrapT, EmptyT >::tCubCell().


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