28 #ifndef _CHAINCON_FILTCOMPLEX_H_ 29 #define _CHAINCON_FILTCOMPLEX_H_ 37 #include "chomp/system/config.h" 38 #include "chomp/system/textfile.h" 39 #include "chomp/struct/hashsets.h" 52 template <
class CellT>
68 int_t
add (
const CellT &c);
75 bool check (
const CellT &c)
const;
91 chomp::homology::hashedset<CellT>
cells;
97 template <
class CellT>
104 template <
class CellT>
110 template <
class CellT>
113 int_t n =
cells. getnumber (c);
114 return (n >= 0) ? (
cells.
size () - n - 1) : -1;
117 template <
class CellT>
123 template <
class CellT>
129 template <
class CellT>
135 template <
class CellT>
139 if ((n < 0) || (n >= size))
140 throw "Wrong number of a cell in a filtered complex.";
141 return cells [size - n - 1];
144 template <
class CellT>
154 template <
class CellT>
159 for (int_t i = 0; i <
size; ++ i)
161 out << C [i] <<
"\n";
173 template <
class CellT>
176 chomp::homology::ignorecomments (in);
181 chomp::homology::ignorecomments (in);
184 #ifndef NO_EMPTY_CELL 195 #endif // _CHAINCON_FILTCOMPLEX_H_ void swap(tFilteredComplex< CellT > &fc)
Swaps the data with another filtered complex.
bool check(const CellT &c) const
Checks if a cell is in the complex.
const CellT & operator[](int_t n) const
Returns the given cell in the complex in the reversed order.
chomp::homology::hashedset< CellT > cells
The set of all the cells in the complex in the right order.
std::ostream & operator<<(std::ostream &out, const tFilteredComplex< CellT > &C)
Writes a filtered cell complex to an output stream in the text format.
int_t getNumber(const CellT &c) const
Finds a cell in the complex.
CellT CellType
The type of cells in the filtered complex.
bool empty() const
Returns the information on whether the complex is empty or not.
CellT value_type
The type of elements in the filtered complex perceived as a standard-type aggregate.
int_t add(const CellT &c)
Adds a cell to the complex.
tFilteredComplex()
The default constructor.
std::istream & operator>>(std::istream &in, tFilteredComplex< CellT > &K)
Reads a filtered cell complex from an input stream.
int_t size() const
Returns the size of the complex.