CGAL 6.3-dev - Homological Discrete Vector Fields
Loading...
Searching...
No Matches
CGAL::Homological_discrete_vector_field::Cubical_chain_complex< CoefficientRing, Traits, SparseMatrixStruct > Class Template Reference

#include <CGAL/HDVF/Cubical_chain_complex.h>

Definition

template<typename CoefficientRing, typename Traits, typename SparseMatrixStruct = OSM::Sparse_matrix_structure<OSM::Sparse_chain>>
class CGAL::Homological_discrete_vector_field::Cubical_chain_complex< CoefficientRing, Traits, SparseMatrixStruct >

The class Cubical_chain_complex represents (topological) chain complexes associated to cubical complexes.

A cubical complex is a set of "square" cells such that: all the faces of a given cell also belong to the complex and any two cells intersect exactly along a common face (see the user manual of cubical chain complexes for more details).

Is model of
GeometricChainComplex
Template Parameters
CoefficientRinga model of the IntegralDomainWithoutDivision concept.
Traitsa geometric traits class model of the HDVFTraits concept.
SparseMatrixStructa model of SparseMatrixStructure providing templates of sparse chains and sparse matrices built over a given model of SparseChain.

Public Types

enum  Cubical_complex_primal_dual
 Type used to encode primal or dual construction. More...
typedef CoefficientRing Coefficient_ring
 Type of coefficients used to compute homology.
typedef Sparse_chain_type< Coefficient_ring, CGAL::OSM::COLUMN > Column_chain
 Type of column-major chains.
typedef Sparse_chain_type< CoefficientRing, CGAL::OSM::ROW > Row_chain
 Type of row-major chains.
typedef Sparse_matrix_type< CoefficientRing, CGAL::OSM::COLUMN > Column_matrix
 Type of column-major sparse matrices.

Public Member Functions

 Cubical_chain_complex ()
 Default constructor (empty cubical complex).
 Cubical_chain_complex (const Cub_object_io< Traits > &cub, Cubical_complex_primal_dual type)
 Constructor from a Cub_object_io (builds PRIMAL or DUAL associated complex depending on type).
bool is_valid_cell (const std::vector< size_t > &cell) const
 Checks if a cell given in Khalimsky coordinates has the right dimension.
bool is_valid_cell (size_t i) const
 Checks if an index belongs to the range of the Boolean vector encoding the complex.
Cubical_chain_complex & operator= (const Cubical_chain_complex &complex)
 Assignment.
std::vector< size_t > size_bb () const
 Get the size of the Khalimsky bounding box.
size_t size () const
 Returns the total size of the complex (size of its boolean vector representation).
std::vector< size_t > index_to_cell (size_t i, int q) const
 Returns Khalimsky coordinates of the cell of "basis index" i in dimension q.
size_t cell_to_index (const std::vector< size_t > &cell) const
 Returns the "basis index" of a cell given by its Khalimsky coordinates.
int dimension (const std::vector< size_t > &cell) const
 Returns the dimension of a cell (given in Khalimsky coordinates).
std::vector< size_t > bindex_to_cell (size_t i) const
 Returns Khalimsky coordinates of the cell of Boolean index i.
size_t cell_to_bindex (const std::vector< size_t > &cell) const
 Returns the Boolean index of a cell given by its Khalimsky coordinates.

Member Enumeration Documentation

◆ Cubical_complex_primal_dual

template<typename CoefficientRing, typename Traits, typename SparseMatrixStruct = OSM::Sparse_matrix_structure<OSM::Sparse_chain>>
enum CGAL::Homological_discrete_vector_field::Cubical_chain_complex::Cubical_complex_primal_dual

Type used to encode primal or dual construction.

Values can be either PRIMAL or DUAL.

Constructor & Destructor Documentation

◆ Cubical_chain_complex()

template<typename CoefficientRing, typename Traits, typename SparseMatrixStruct>
CGAL::Homological_discrete_vector_field::Cubical_chain_complex< CoefficientRing, Traits, SparseMatrixStruct >::Cubical_chain_complex ( const Cub_object_io< Traits > & cub,
Cubical_complex_primal_dual type )

Constructor from a Cub_object_io (builds PRIMAL or DUAL associated complex depending on type).

Builds the cubical complex associated to a a set of cells (vertices, edges, squares, cubes...), ie. performs the down closure of cells and set the boundary matrices in any dimension. Given a set of cells:

  • if the type is PRIMAL, the constructor builds the associated complex as such (see below middle), which comes to encode \(3^q-1\) connectivity (with \(q\) the dimension of the complex)
  • if the type is DUAL and the Cub_object_io contains only cells of maximal dimension (ie. binary object), the constructor build the dual associated complex (see below right), which comes to encode \(2q\) connectivity (with \(q\) the dimension of the complex)

Parameters
cubA Cub_object_io containing a set of "cubical" cells.
typeType of construction used (PRIMAL or DUAL).

Member Function Documentation

◆ bindex_to_cell()

template<typename CoefficientRing, typename Traits, typename SparseMatrixStruct = OSM::Sparse_matrix_structure<OSM::Sparse_chain>>
std::vector< size_t > CGAL::Homological_discrete_vector_field::Cubical_chain_complex< CoefficientRing, Traits, SparseMatrixStruct >::bindex_to_cell ( size_t i) const

Returns Khalimsky coordinates of the cell of Boolean index i.

In Cubical_chain_complex, a cells of dimenson q, besides its index in the basis of \(q\)-cells, has an index in the vectorisation of the Khalimsky representation, called its "Boolean index" (see user manual for details).

Parameters
iThe "Boolean" index of a cell.
Returns
Khalimsky coordinates of the cell.

◆ cell_to_bindex()

template<typename CoefficientRing, typename Traits, typename SparseMatrixStruct = OSM::Sparse_matrix_structure<OSM::Sparse_chain>>
size_t CGAL::Homological_discrete_vector_field::Cubical_chain_complex< CoefficientRing, Traits, SparseMatrixStruct >::cell_to_bindex ( const std::vector< size_t > & cell) const

Returns the Boolean index of a cell given by its Khalimsky coordinates.

In Cubical_chain_complex, a cells of dimenson q, besides its index in the basis of \(q\)-cells, has an index in the vectorisation of the Khalimsky representation, called its "Boolean index" (see user manual for details).

Parameters
cellKhalimsky coordinates of a cell.
Returns
The "Boolean" index of the cell.

◆ cell_to_index()

template<typename CoefficientRing, typename Traits, typename SparseMatrixStruct = OSM::Sparse_matrix_structure<OSM::Sparse_chain>>
size_t CGAL::Homological_discrete_vector_field::Cubical_chain_complex< CoefficientRing, Traits, SparseMatrixStruct >::cell_to_index ( const std::vector< size_t > & cell) const

Returns the "basis index" of a cell given by its Khalimsky coordinates.

In AbstractChainComplex, cells of dimenson q are identified by their index in the basis of \(q\)-cells together with their dimension. In the context of cubical complexes, this index is called "basis index" (to distinguish from its "Boolean index", see user manual for details).

Parameters
cellKhalimsky coordinates of a cell (of dimension \(q\)).
Returns
The "basis index" of the cell among \(q\)-cells.

◆ dimension()

template<typename CoefficientRing, typename Traits, typename SparseMatrixStruct>
int CGAL::Homological_discrete_vector_field::Cubical_chain_complex< CoefficientRing, Traits, SparseMatrixStruct >::dimension ( const std::vector< size_t > & cell) const

Returns the dimension of a cell (given in Khalimsky coordinates).

Exceptions
Cell_of_invalid_dimensionRaises a `std::invalid_argument` if the dimension of Khalimsky coordinates of the `cell` differs from the dimension of the complex.

◆ index_to_cell()

template<typename CoefficientRing, typename Traits, typename SparseMatrixStruct = OSM::Sparse_matrix_structure<OSM::Sparse_chain>>
std::vector< size_t > CGAL::Homological_discrete_vector_field::Cubical_chain_complex< CoefficientRing, Traits, SparseMatrixStruct >::index_to_cell ( size_t i,
int q ) const

Returns Khalimsky coordinates of the cell of "basis index" i in dimension q.

In AbstractChainComplex, cells of dimenson q are identified by their index in the basis of \(q\)-cells together with their dimension. In the context of cubical complexes, this index is called "basis index" (to distinguish from its "Boolean index", see user manual for details).

Parameters
i"basis index" of a cell.
qdimension of the cell.
Returns
Khalimsky coordinates of the cell.

◆ size()

template<typename CoefficientRing, typename Traits, typename SparseMatrixStruct = OSM::Sparse_matrix_structure<OSM::Sparse_chain>>
size_t CGAL::Homological_discrete_vector_field::Cubical_chain_complex< CoefficientRing, Traits, SparseMatrixStruct >::size ( ) const

Returns the total size of the complex (size of its boolean vector representation).

Khalimsky coordinates in dimension q are bounded above by size_bb().at(q); the size of the boolean vector representing the complex is the product of these sizes.

◆ size_bb()

template<typename CoefficientRing, typename Traits, typename SparseMatrixStruct = OSM::Sparse_matrix_structure<OSM::Sparse_chain>>
std::vector< size_t > CGAL::Homological_discrete_vector_field::Cubical_chain_complex< CoefficientRing, Traits, SparseMatrixStruct >::size_bb ( ) const

Get the size of the Khalimsky bounding box.

The Khalimsky coordinate of a cell c in dimension q is strictly lesser than size_bb().at(q).