CGAL 6.3-dev - Homological Discrete Vector Fields
Loading...
Searching...
No Matches

Definition

The concept AbstractChainComplex describes the requirements for (topological) chain complexes associated to abstract complexes used in the concept HDVF.

It provides methods to:

  • get the dimension of the complex, the number of cells in each dimension
  • get the boundary and co-boundary of cell(s)
  • get the vertices of a given cell
  • output the complex in text format

Cells are indexed along each dimension and thus identified by their index together with their dimension.

Has models
CGAL::Homological_discrete_vector_field::Abstract_simplicial_chain_complex<IntegralDomainWithoutDivision>

Types

typedef unspecified_type Coefficient_ring
 Type of coefficients ring used to compute homology, model of IntegralDomainWithoutDivision.
typedef unspecified_type Sparse_matrix_structure
 Type of structure of sparse matrix used.
typedef Sparse_matrix_structure::template Sparse_chain_type< Coefficient_ring, CGAL::OSM::COLUMN > Column_chain
 Type of column-major chains (returned by the boundary operator).
typedef Sparse_matrix_structure::template Sparse_chain_type< Coefficient_ring, CGAL::OSM::ROW > Row_chain
 Type of row-major chains (returned by the co-boundary operator).
typedef Sparse_matrix_structure::template Sparse_matrix_type< Coefficient_ring, CGAL::OSM::COLUMN > Column_matrix
 Type of column-major sparse matrices (used to store the boundary operator).

Verification operations

bool is_valid_cell_dimension (int q)
 Checks if q belongs to the range of dimensions of cells in the complex.
bool is_valid_cell (size_t i, int q)
 Checks if the cell of index i and dimension q belongs to the range of dimensions of cells in the complex.

Access functions

int dimension ()
 Returns the dimension of the complex.
size_t id () const
 Get (unique) object Id.
size_t number_of_cells (int q)
 Returns the number of cells in a given dimension.
const vector< Column_matrix > & boundary_matrices () const
 Returns a constant reference to the vector of boundary matrices (along each dimension).
const Column_matrix & boundary_matrix (int q) const
 Returns a constant reference over the boundary matrix of dimension q (i.e. column-major matrix of \(\partial_q\)).
Column_chain d (size_t id_cell, int q)
 Returns the boundary of the cell id_cell in dimension q.
Row_chain cod (size_t id_cell, int q)
 Returns the co-boundary of the cell id_cell in dimension q.
std::vector< size_t > bottom_faces (size_t id_cell, int q) const
 Returns the vertices of a given cell (that is, the indices of its faces of dimension 0).
template<typename CoefficientR, int StorageF>
Column_chain cofaces_chain (SparseChain< CoefficientR, StorageF > chain, int q) const
 Returns the cofaces of a given chain in dimension q.

Input, output

std::ostream & operator<< (std::ostream &out, const AbstractChainComplex &complex) const
 Inserts the chain complex in text mode in the stream.

Member Typedef Documentation

◆ Sparse_matrix_structure

Type of structure of sparse matrix used.

A model of SparseMatrixStructure providing a model of SparseChain and an associated model of SparseMatrix.

Warning
Check if the concept SparseMatrixStructureand documentation are correct...

Member Function Documentation

◆ boundary_matrices()

const vector< Column_matrix > & AbstractChainComplex::boundary_matrices ( ) const

Returns a constant reference to the vector of boundary matrices (along each dimension).

The q-th element of this vector is a column-major sparse matrix containing the boundaries of q-cells (i.e. rows encode q-1 cells and columns q cells).

Returns
A constant reference to the vector of column-major boundary matrices along each dimension.

◆ boundary_matrix()

const Column_matrix & AbstractChainComplex::boundary_matrix ( int q) const

Returns a constant reference over the boundary matrix of dimension q (i.e. column-major matrix of \(\partial_q\)).

It is a column-major sparse matrix containing the boundaries of q-cells (i.e. rows encode q-1 cells and columns q cells).

Parameters
qDimension of the boundary matrix (i.e. columns will contain the boundary of dimension q cells).
Returns
A constant reference over the column-major sparse matrix containing the matrix of the boundary operator of dimension q.

◆ cod()

Row_chain AbstractChainComplex::cod ( size_t id_cell,
int q )

Returns the co-boundary of the cell id_cell in dimension q.

This chain is actually a row of the boundary matrix in dimension q.

Warning
As the boundary matrix is stored column-major, this entails crossing the full matrix to extract the row coefficients (O(number of non empty columns))
Parameters
id_cellIndex of the cell.
qDimension of the cell.
Returns
The row-major chain containing the co-boundary of the cell id_cell in dimension q. If q is not in the interval [0,d] with d the dimension of the complex, the function returns an empty row chain.

◆ cofaces_chain()

template<typename CoefficientR, int StorageF>
Column_chain AbstractChainComplex::cofaces_chain ( SparseChain< CoefficientR, StorageF > chain,
int q ) const

Returns the cofaces of a given chain in dimension q.

The resulting chain, whatever the storage format of the input, is column-major, lies in dimension q+1 and is null if this dimension exceeds the dimension of the complex.

Template Parameters
CoefficientRCoefficientRing of the chain.
StorageFStorageFormat of the chain.

◆ d()

Column_chain AbstractChainComplex::d ( size_t id_cell,
int q )

Returns the boundary of the cell id_cell in dimension q.

Parameters
id_cellIndex of the cell.
qDimension of the cell.
Returns
A copy of the column-major chain containing the boundary of the cell id_cell in dimension q. If q is not in the interval [0,d] with d the dimension of the complex, the function returns an empty column chain.

◆ dimension()

int AbstractChainComplex::dimension ( )

Returns the dimension of the complex.

This dimension is the largest dimension of cells.

Returns
The dimension of the complex.

◆ id()

size_t AbstractChainComplex::id ( ) const

Get (unique) object Id.

For comparison of constant references to the complex.

◆ number_of_cells()

size_t AbstractChainComplex::number_of_cells ( int q)

Returns the number of cells in a given dimension.

Parameters
qDimension along which the number of cells is returned.
Returns
Number of cells in dimension q. If q is not in the interval [0,d] with d the dimension of the complex, the function returns an empty column chain.

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const AbstractChainComplex & complex ) const
friend

Inserts the chain complex in text mode in the stream.

Displays the number of cells in each dimension and the boundary matrix in each dimension.

Parameters
outThe output stream.
complexConstant reference over the complex considered.