36#ifndef _CHOMP_CUBES_CUBEBASE_H_
37#define _CHOMP_CUBES_CUBEBASE_H_
58template <
class coordtype>
70template <
class coordtype>
109 coordtype *
coord (coordtype *c)
const;
118 static const char *
name ();
129 return c1.
n == c2.
n;
148template <
class coordtype>
156template <
class coordtype>
163template <
class coordtype>
168 throw "Non-positive dimension of a cube.";
170 throw "Too high space dimension.";
173 throw "Negative number of a cube.";
178template <
class coordtype>
185template <
class coordtype>
192template <
class coordtype>
200template <
class coordtype>
203 return static_cast<int> (n >>
NumBits);
217template <
class coordtype>
222 for (
int i = 0; i < d; ++ i)
227template <
class coordtype>
230 return static_cast<int_t>
231 (((n ^ 0x55555555u) << 17) ^ ((n ^ 0xAA00AA00u) << 7) ^
232 ((n ^ 0x00AA00AAu) >> 7));
235template <
class coordtype>
241template <
class coordtype>
244 return static_cast<int_t>
245 (((n ^ 0xAAAAAAAAu) << 18) ^ ((n ^ 0x55005500u) >> 8) ^
246 ((n ^ 0x00550055u) << 10));
249template <
class coordtype>
255template <
class coordtype>
261template <
class coordtype>
270template <
class coordtype>
280template <
class coordtype>
284 int dim1 = c1. dim (), dim2 = c2. dim ();
286 throw "Dimension too high to concatenate coordinates.";
289 c2. coord (coord + dim1);
298template <
class coordtype>
308template <
class coordtype>
315template <
class coordtype>
323template <
class coordtype>
This file contains the definition of a bitfield class which works an array of bits.
This is a template for a set of objects of the given type.
This class defines a multivalued map.
This class defines cubical cell in R^n with edges parallel to the axes and with size 0 or 1 in each d...
This class defines a hypercube in R^n with edges parallel to the axes and with size 1 in each directi...
coordtype CoordType
The type of coordinates of a cube.
tCubeBase()
The default constructor.
tCellBase< coordtype > CellType
The type of a cell related to this cube type.
int_t hashkey2() const
Returns hashing key no. 2 required by the hashing set template.
int_t n
The number that represents the full cube.
static const char * pluralname()
Returns the plural name of the objects represented by this class.
static const int MaxDim
The maximal dimension of a cube.
int dim() const
Returns the dimension of the cube.
friend int operator==(const tCubeBase< coordtype > &c1, const tCubeBase< coordtype > &c2)
The operator == for cubes.
static const char * name()
Returns the name of the objects represented by this class.
int_t num() const
Returns the actual number of the cube in the point base.
coordtype * coord(coordtype *c) const
Fills out the coordinate table with the cube's coordinates.
tPointBase< coordtype > PointBase
The point base (for wrapping and tabulating coordinates).
int_t hashkey1() const
Returns hashing key no. 1 required by the hashing set template.
This class keeps a common set of points which are indexed for the use of other classes,...
static const coordtype * coord(int_t number, int d)
Retrieves the coordinates of the given point.
static int_t number(const coordtype *c, int d)
Returns the number of the point with given coordinates.
This file contains some precompiler definitions which indicate the operating system and/or compiler u...
This file contains the definition of some functions that are common for all types of cubes,...
int int_t
Index type for indexing arrays, counting cubes, etc.
This file contains the definition of the container "hashedset" which can be used to represent a set o...
This file defines a class "integer" which represents the ring of integers or the field of integers mo...
std::ostream & WriteCube(std::ostream &out, const cubetype &c)
Writes a cube to the output stream in the text mode.
const int MaxBasDim
The maximal dimension that can be used if the high bits of an integer store the value of the dimensio...
std::ostream & operator<<(std::ostream &out, const bincube< Dim, twoPower > &b)
std::istream & ReadCubes(std::istream &in, cubsettype &s)
Reads a set of cubes and ignores the line at the beginning of the file which starts with the letter '...
int_t hashkey2(const hashNumber< Number > &n)
The second hashing key.
tCellBase< coordtype > operator*(const tCellBase< coordtype > &c1, const tCellBase< coordtype > &c2)
Computes the Cartesian product of two cells.
const int NumBits
The number of bits in an integer number that remain to be used for other purposes,...
std::istream & ReadCube(std::istream &in, cubetype &c)
Reads a cube from the input text stream.
bool operator!=(const typename bincube< Dim, twoPower >::neighborhood_iterator &x1, const typename bincube< Dim, twoPower >::neighborhood_iterator &x2)
std::istream & operator>>(std::istream &in, bincube< Dim, twoPower > &b)
int_t hashkey1(const hashNumber< Number > &n)
The first hashing key.
const int_t NumMask
The mask of the bits remaining after the dimension bits are excluded.
std::istream & ReadCubicalMap(std::istream &in, mvmap< tCube, tCube > &m)
Reads a combinatorial cubical multivalued map from an input text stream.
This namespace contains the entire CHomP library interface.
This file contains the definition of a point base class which is used for indexing all the points (n-...
This file contains the definition of a set of n-dimensional points with integer coordinates and sever...
This file contains some useful functions related to the text input/output procedures.