28 #ifndef _CHAINCON_ALGCELL_H_ 29 #define _CHAINCON_ALGCELL_H_ 38 #include "chomp/system/config.h" 39 #include "chomp/struct/multitab.h" 53 template <
class IdT,
class DimT,
class CoefT>
73 explicit tAlgCell (
const IdT &identifier);
89 const DimT &
dim ()
const;
92 const IdT &
getId ()
const;
111 const DimT &dimension);
137 static chomp::homology::multitable
144 template <
class IdT,
class DimT,
class CoefT>
147 template <
class IdT,
class DimT,
class CoefT>
150 template <
class IdT,
class DimT,
class CoefT>
153 template <
class IdT,
class DimT,
class CoefT>
154 chomp::homology::multitable<tChain<tAlgCell<IdT,DimT,CoefT>,CoefT> >
159 template <
class IdT,
class DimT,
class CoefT>
165 template <
class IdT,
class DimT,
class CoefT>
172 template <
class IdT,
class DimT,
class CoefT>
180 template <
class IdT,
class DimT,
class CoefT>
188 template <
class IdT,
class DimT,
class CoefT>
196 template <
class IdT,
class DimT,
class CoefT>
202 template <
class IdT,
class DimT,
class CoefT>
213 template <
class IdT,
class DimT,
class CoefT>
219 template <
class IdT,
class DimT,
class CoefT>
225 template <
class IdT,
class DimT,
class CoefT>
231 template <
class IdT,
class DimT,
class CoefT>
232 inline bool tAlgCell<IdT,DimT,CoefT>::operator ==
235 return (
id == c.
id);
238 template <
class IdT,
class DimT,
class CoefT>
241 std::swap (
id, c.
id);
245 template <
class IdT,
class DimT,
class CoefT>
251 template <
class IdT,
class DimT,
class CoefT>
253 const DimT &dimension)
259 template <
class IdT,
class DimT,
class CoefT>
267 template <
class IdT,
class DimT,
class CoefT>
274 chomp::homology::multitable<DimT> emptyDimensions;
281 chomp::homology::multitable
292 template <
class IdT,
class DimT,
class CoefT>
295 return (static_cast<int_t> (c.
getId ()) << 3) ^ 0xA5A5A5;
300 template <
class IdT,
class DimT,
class CoefT>
303 return (static_cast<int_t> (c.
getId ()) << 5) ^ 0x5A5A5A;
309 template <
class IdT,
class DimT,
class CoefT>
324 template <
class IdT,
class DimT,
class CoefT>
328 chomp::homology::ignorecomments (in);
338 if (in. peek () !=
'_')
353 #endif // _CHAINCON_ALGCELL_H_ static IdT newId()
Returns the next available identifier to be used for cells.
std::ostream & operator<<(std::ostream &out, const tAlgCell< IdT, DimT, CoefT > &c)
Writes an abstract algebraic cell in the text mode to an output stream.
CoefT CoefType
The type of coefficients in the chain.
static void forget()
Forgets all the boundaries and dimensions of cells and resets the identifier counter.
int_t boundaryLength() const
Returns the length of the boundary of the elementary cube.
~tAlgCell()
The destructor.
DimT DimType
The type of integer used to store the dimension of the cell.
static chomp::homology::multitable< DimT > dimensions
A global array of dimensions of the cells.
const DimT & dim() const
Returns the dimension of the cell.
tCombChain< CellT > boundary(const tCombChain< CellT > &c, const CellRestrT &restr)
Returns the boundary of a given chain (takes boundary cells restricted by the given object...
A chain with coefficients in an arbitrary ring.
static chomp::homology::multitable< tChain< tAlgCell< IdT, DimT, CoefT >, CoefT > > boundaries
A global array of boundaries of the cells.
tAlgCell()
The default constructor of an empty cell (id 0).
bool operator==(const tAlgCell< IdT, DimT, CoefT > &s) const
The equality operator.
static IdT maxUsedId
The next free identifier for a new cell.
int_t hashkey2(const tAlgCell< IdT, DimT, CoefT > &c)
Generates a hashing key no.
int_t hashkey1(const tAlgCell< IdT, DimT, CoefT > &c)
Generates a hashing key no.
static bool dim0initialized
A global variable remembering if the dimension of cell 0 was already set to -1.
IdT id
The identifier of the cell.
A chain with coefficients in an arbitrary commutative ring.
std::istream & operator>>(std::istream &in, tAlgCell< IdT, DimT, CoefT > &c)
Reads an elementary cube from the input stream in the text format.
const IdT & getId() const
Returns the identifier of the cell.
IdT IdType
The type of a cell identifier.
An abstract algebraic cell, characterized by a unique identifier, dimension, and a formula for its bo...
static void setDimension(const IdT &identifier, const DimT &dimension)
Sets the dimension of the cell with the given identifier.
const CoefT & boundaryCoef(int_t n) const
Returns the n-th coefficient in the boundary of the cube.
void swap(tAlgCell< IdT, DimT, CoefT > &s)
Swaps the data with another cell.
static void setBoundary(const IdT &identifier, const tChain< tAlgCell< IdT, DimT, CoefT >, CoefT > &boundary)
Sets the boundary of the cell with the given identifier.