This class defines a hypercube in R^n with edges parallel to the axes and with size 1 in each direction. More...
#include <cubebase.h>
Public Types | |
typedef coordtype | CoordType |
The type of coordinates of a cube. | |
typedef tCellBase< coordtype > | CellType |
The type of a cell related to this cube type. | |
typedef tPointBase< coordtype > | PointBase |
The point base (for wrapping and tabulating coordinates). | |
Public Member Functions | |
tCubeBase () | |
The default constructor. | |
tCubeBase (const coordtype *c, int dim) | |
The constructor of a cube from a table of coordinates. | |
tCubeBase (int_t number, int dim) | |
The constructor of a cube from a number (should be used with caution). | |
tCubeBase (const tCubeBase< coordtype > &c) | |
The copy constructor. | |
tCubeBase< coordtype > & | operator= (const tCubeBase< coordtype > &c) |
The assignment operator. | |
int | dim () const |
Returns the dimension of the cube. | |
coordtype * | coord (coordtype *c) const |
Fills out the coordinate table with the cube's coordinates. | |
int_t | hashkey1 () const |
Returns hashing key no. 1 required by the hashing set template. | |
int_t | hashkey2 () const |
Returns hashing key no. 2 required by the hashing set template. | |
Static Public Member Functions | |
static const char * | name () |
Returns the name of the objects represented by this class. | |
static const char * | pluralname () |
Returns the plural name of the objects represented by this class. | |
Static Public Attributes | |
static const int | MaxDim = MaxBasDim |
The maximal dimension of a cube. | |
Private Member Functions | |
int_t | num () const |
Returns the actual number of the cube in the point base. | |
Private Attributes | |
int_t | n |
The number that represents the full cube. | |
Friends | |
class | tCellBase< coordtype > |
int | operator== (const tCubeBase< coordtype > &c1, const tCubeBase< coordtype > &c2) |
The operator == for cubes. |
This class defines a hypercube in R^n with edges parallel to the axes and with size 1 in each direction.
This implementation uses a cube base class for indexing all the possible coordinate combinations that appear in the program.
Definition at line 72 of file cubebase.h.
typedef tCellBase<coordtype> chomp::homology::tCubeBase< coordtype >::CellType |
The type of a cell related to this cube type.
Definition at line 79 of file cubebase.h.
typedef coordtype chomp::homology::tCubeBase< coordtype >::CoordType |
The type of coordinates of a cube.
Definition at line 76 of file cubebase.h.
typedef tPointBase<coordtype> chomp::homology::tCubeBase< coordtype >::PointBase |
The point base (for wrapping and tabulating coordinates).
Definition at line 85 of file cubebase.h.
chomp::homology::tCubeBase< coordtype >::tCubeBase | ( | ) | [inline] |
The default constructor.
Definition at line 158 of file cubebase.h.
: n (0) { return; } /* tCubeBase::tCubeBase */
chomp::homology::tCubeBase< coordtype >::tCubeBase | ( | const coordtype * | c, | |
int | dim | |||
) | [inline] |
The constructor of a cube from a table of coordinates.
Definition at line 165 of file cubebase.h.
References chomp::homology::tCubeBase< coordtype >::MaxDim, chomp::homology::tCubeBase< coordtype >::n, chomp::homology::tPointBase< coordtype >::number(), and chomp::homology::NumBits.
chomp::homology::tCubeBase< coordtype >::tCubeBase | ( | int_t | number, | |
int | dim | |||
) | [inline] |
The constructor of a cube from a number (should be used with caution).
Definition at line 180 of file cubebase.h.
References chomp::homology::tCubeBase< coordtype >::n, and chomp::homology::NumBits.
chomp::homology::tCubeBase< coordtype >::tCubeBase | ( | const tCubeBase< coordtype > & | c | ) | [inline] |
The copy constructor.
Definition at line 187 of file cubebase.h.
References chomp::homology::tCubeBase< coordtype >::n.
coordtype * chomp::homology::tCubeBase< coordtype >::coord | ( | coordtype * | c | ) | const [inline] |
Fills out the coordinate table with the cube's coordinates.
Definition at line 219 of file cubebase.h.
References chomp::homology::tPointBase< coordtype >::coord(), chomp::homology::tCubeBase< coordtype >::dim(), and chomp::homology::tCubeBase< coordtype >::num().
{ int d = dim (); const coordtype *tab = PointBase::coord (num (), d); for (int i = 0; i < d; ++ i) c [i] = tab [i]; return c; } /* tCubeBase::coord */
int chomp::homology::tCubeBase< coordtype >::dim | ( | ) | const [inline] |
Returns the dimension of the cube.
Definition at line 202 of file cubebase.h.
References chomp::homology::tCubeBase< coordtype >::n, and chomp::homology::NumBits.
Referenced by chomp::homology::tCubeBase< coordtype >::coord().
int_t chomp::homology::tCubeBase< coordtype >::hashkey1 | ( | ) | const [inline] |
Returns hashing key no. 1 required by the hashing set template.
Definition at line 229 of file cubebase.h.
References chomp::homology::tCubeBase< coordtype >::n.
int_t chomp::homology::tCubeBase< coordtype >::hashkey2 | ( | ) | const [inline] |
Returns hashing key no. 2 required by the hashing set template.
Definition at line 237 of file cubebase.h.
References chomp::homology::tCubeBase< coordtype >::n.
const char * chomp::homology::tCubeBase< coordtype >::name | ( | ) | [inline, static] |
Returns the name of the objects represented by this class.
Definition at line 245 of file cubebase.h.
{ return "cube"; } /* tCubeBase::name */
int_t chomp::homology::tCubeBase< coordtype >::num | ( | ) | const [inline, private] |
Returns the actual number of the cube in the point base.
Definition at line 150 of file cubebase.h.
References chomp::homology::tCubeBase< coordtype >::n, and chomp::homology::NumMask.
Referenced by chomp::homology::tCubeBase< coordtype >::coord().
tCubeBase< coordtype > & chomp::homology::tCubeBase< coordtype >::operator= | ( | const tCubeBase< coordtype > & | c | ) | [inline] |
The assignment operator.
Definition at line 195 of file cubebase.h.
const char * chomp::homology::tCubeBase< coordtype >::pluralname | ( | ) | [inline, static] |
Returns the plural name of the objects represented by this class.
Definition at line 251 of file cubebase.h.
Referenced by chomp::homology::readelements(), and chomp::homology::saveelements().
{ return "cubes"; } /* tCubeBase::pluralname */
int operator== | ( | const tCubeBase< coordtype > & | c1, | |
const tCubeBase< coordtype > & | c2 | |||
) | [friend] |
The operator == for cubes.
Definition at line 127 of file cubebase.h.
friend class tCellBase< coordtype > [friend] |
Definition at line 134 of file cubebase.h.
const int chomp::homology::tCubeBase< coordtype >::MaxDim = MaxBasDim [static] |
The maximal dimension of a cube.
Definition at line 82 of file cubebase.h.
Referenced by chomp::homology::acyclic(), chomp::homology::ComputeBettiNumbers(), chomp::homengin::PPengine::dimsupported(), chomp::homology::SetSpaceWrapping(), and chomp::homology::tCubeBase< coordtype >::tCubeBase().
int_t chomp::homology::tCubeBase< coordtype >::n [private] |
The number that represents the full cube.
High bits keep the space dimension, the remaining bits form the number of the cube in an appropriate pointset.
Definition at line 143 of file cubebase.h.
Referenced by chomp::homology::tCubeBase< coordtype >::dim(), chomp::homology::tCubeBase< coordtype >::hashkey1(), chomp::homology::tCubeBase< coordtype >::hashkey2(), chomp::homology::tCubeBase< coordtype >::num(), and chomp::homology::tCubeBase< coordtype >::tCubeBase().