This class defines a hypercube in R^n with edges parallel to the axes and with size 1 in each direction. More...
#include <cubefix.h>
Public Types | |
typedef coordtype | CoordType |
The type of coordinates of a cube. | |
typedef tCellFix< dimfix, coordtype > | CellType |
The type of a cell related to this cube type. | |
typedef tWrapBase< coordtype > | PointBase |
The point base (for wrapping and tabulating coordinates). | |
Public Member Functions | |
tCubeFix () | |
The default constructor. | |
tCubeFix (const coordtype *c, int dim=0) | |
The constructor of a cube from a table of coordinates. | |
tCubeFix (int number, int dim) | |
The constructor of a cube from a number (invalid in this class). | |
tCubeFix (const tCubeFix< dimfix, coordtype > &c) | |
The copy constructor. | |
tCubeFix< dimfix, coordtype > & | operator= (const tCubeFix< dimfix, 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 = 512 |
The maximal dimension of a cube (unused). | |
Private Attributes | |
coordtype | tab [dimfix] |
A table with the coordinates of the minimal vertex of the cube. | |
Friends | |
class | tCellFix< dimfix, coordtype > |
int | operator== (const tCubeFix< dimfix, coordtype > &c1, const tCubeFix< dimfix, 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 assumes that the embedding space dimension is known at time of compilation.
Definition at line 72 of file cubefix.h.
typedef tCellFix<dimfix,coordtype> chomp::homology::tCubeFix< dimfix, coordtype >::CellType |
typedef coordtype chomp::homology::tCubeFix< dimfix, coordtype >::CoordType |
typedef tWrapBase<coordtype> chomp::homology::tCubeFix< dimfix, coordtype >::PointBase |
chomp::homology::tCubeFix< dimfix, coordtype >::tCubeFix | ( | ) | [inline] |
chomp::homology::tCubeFix< dimfix, coordtype >::tCubeFix | ( | const coordtype * | c, | |
int | dim = 0 | |||
) | [inline] |
The constructor of a cube from a table of coordinates.
Definition at line 149 of file cubefix.h.
References chomp::homology::tPointBase< coordtype >::wrapcopy().
{ if (dim && ((dim != dimfix) || (dim < 0))) throw "Wrong dimension of a fixed-dim cube."; PointBase::wrapcopy (tab, c, dimfix); return; } /* tCubeFix::tCubeFix */
chomp::homology::tCubeFix< dimfix, coordtype >::tCubeFix | ( | int | number, | |
int | dim | |||
) | [inline] |
chomp::homology::tCubeFix< dimfix, coordtype >::tCubeFix | ( | const tCubeFix< dimfix, coordtype > & | c | ) | [inline] |
coordtype * chomp::homology::tCubeFix< dimfix, coordtype >::coord | ( | coordtype * | c | ) | const [inline] |
Fills out the coordinate table with the cube's coordinates.
Definition at line 197 of file cubefix.h.
References chomp::homology::tCubeFix< dimfix, coordtype >::tab.
{ for (int i = 0; i < dimfix; ++ i) c [i] = tab [i]; return c; } /* tCubeFix::coord */
int chomp::homology::tCubeFix< dimfix, coordtype >::dim | ( | ) | const [inline] |
int_t chomp::homology::tCubeFix< dimfix, coordtype >::hashkey1 | ( | ) | const [inline] |
Returns hashing key no. 1 required by the hashing set template.
Definition at line 205 of file cubefix.h.
References chomp::homology::tCubeFix< dimfix, coordtype >::tab.
{ switch (dimfix) { case 1: return static_cast<int_t> (tab [0]) << 12; case 2: return ((static_cast<int_t> (tab [0])) << 18) + ((static_cast<int_t> (tab [1])) << 6); default: return ((static_cast<int_t> (tab [0])) << 18) + ((static_cast<int_t> (tab [1])) << 6) + ((static_cast<int_t> (tab [2])) >> 6); } } /* tCubeFix::hashkey1 */
int_t chomp::homology::tCubeFix< dimfix, coordtype >::hashkey2 | ( | ) | const [inline] |
Returns hashing key no. 2 required by the hashing set template.
Definition at line 222 of file cubefix.h.
References chomp::homology::tCubeFix< dimfix, coordtype >::tab.
{ switch (dimfix) { case 1: return static_cast<int_t> (tab [0]) << 3; case 2: return (static_cast<int_t> (tab [0]) >> 1) + (static_cast<int_t> (tab [1]) << 13); default: return ((static_cast<int_t> (tab [dimfix - 1])) << 20) + ((static_cast<int_t> (tab [dimfix - 2])) << 9) + ((static_cast<int_t> (tab [dimfix - 3])) >> 1); } } /* tCubeFix::hashkey2 */
const char * chomp::homology::tCubeFix< dimfix, coordtype >::name | ( | ) | [static] |
tCubeFix< dimfix, coordtype > & chomp::homology::tCubeFix< dimfix, coordtype >::operator= | ( | const tCubeFix< dimfix, coordtype > & | c | ) | [inline] |
const char * chomp::homology::tCubeFix< dimfix, coordtype >::pluralname | ( | ) | [static] |
friend class tCellFix< dimfix, coordtype > [friend] |
const int chomp::homology::tCubeFix< dimfix, coordtype >::MaxDim = 512 [static] |
coordtype chomp::homology::tCubeFix< dimfix, coordtype >::tab[dimfix] [private] |
A table with the coordinates of the minimal vertex of the cube.
Definition at line 135 of file cubefix.h.
Referenced by chomp::homology::tCubeFix< dimfix, coordtype >::coord(), chomp::homology::tCubeFix< dimfix, coordtype >::hashkey1(), and chomp::homology::tCubeFix< dimfix, coordtype >::hashkey2().