CGAL 6.2 - Homological Discrete Vector Fields
Loading...
Searching...
No Matches
CGAL::Homological_discrete_vector_field::Simplicial_chain_complex< CoefficientRing, Traits > Class Template Reference

#include <CGAL/HDVF/Simplicial_chain_complex.h>

Inherits from

CGAL::Homological_discrete_vector_field::Abstract_simplicial_chain_complex< CoefficientRing >.

Definition

template<typename CoefficientRing, typename Traits>
class CGAL::Homological_discrete_vector_field::Simplicial_chain_complex< CoefficientRing, Traits >

The class Simplicial_chain_complex refines the Abstract_simplicial_chain_complex class by assigning coordinates to vertices (i.e. 0-simplices).

Hence, vtk output is available.

Is model of
GeometricChainComplex
Template Parameters
CoefficientRinga model of the IntegralDomainWithoutDivision concept.
Traitsa geometric traits class model of the HDVFTraits concept.

Public Types

typedef Traits::Point Point
 Type of vertex coordinates.
 
typedef Traits::Point3 Point3
 Type of vtk export vertex coordinates.
 
- Public Types inherited from CGAL::Homological_discrete_vector_field::Abstract_simplicial_chain_complex< CoefficientRing >
typedef CoefficientRing Coefficient_ring
 Type of coefficients used to compute homology.
 
typedef CGAL::OSM::Sparse_chain< CoefficientRing, CGAL::OSM::COLUMNColumn_chain
 Type of column-major chains.
 
typedef CGAL::OSM::Sparse_chain< CoefficientRing, CGAL::OSM::ROWRow_chain
 Type of row-major chains.
 
typedef CGAL::OSM::Sparse_matrix< CoefficientRing, CGAL::OSM::COLUMNColumn_matrix
 Type of column-major sparse matrices.
 

Public Member Functions

 Simplicial_chain_complex ()
 Default constructor: builds an empty simplicial complex.
 
 Simplicial_chain_complex (const Mesh_object_io< Traits > &mesh)
 Constructor from a Mesh_object_io.
 
Simplicial_chain_complexoperator= (const Simplicial_chain_complex &complex)
 Assignment operator for simplicial complexes.
 
const std::vector< Point > & points () const
 Gets the vector of vertex coordinates

 
Point point (size_t i) const
 Gets the coordinates of the ith dimension-0 simplex.
 
- Public Member Functions inherited from CGAL::Homological_discrete_vector_field::Abstract_simplicial_chain_complex< CoefficientRing >
 Abstract_simplicial_chain_complex (int q=0)
 Default constructor (empty simplicial complex of dimension q).
 
template<typename Traits >
 Abstract_simplicial_chain_complex (const Mesh_object_io< Traits > &mesh)
 Constructor from a Mesh_object_io.
 
Abstract_simplicial_chain_complexoperator= (const Abstract_simplicial_chain_complex &complex)
 Assignment operator for abstract simplicial chain complexes.
 
Column_chain d (size_t id_cell, int q) const
 Returns the boundary of the cell id_cell in dimension q.
 
Row_chain cod (size_t id_cell, int q) const
 Returns the co-boundary of the cell id_cell in dimension q.
 
int dimension () const
 Returns the dimension of the complex.
 
size_t number_of_cells (int q) const
 Returns the number of cells in a given dimension.
 
const Simplexindex_to_cell (size_t i, int q) const
 Returns the simplex of index i in dimension q.
 
size_t cell_to_index (const Simplex &simplex) const
 Returns the index of a given simplex.
 
const std::vector< Column_matrix > & boundary_matrices () const
 Returns a constant reference to the vector of boundary matrices (along each dimension).
 
const Column_matrixboundary_matrix (int q) const
 Returns a copy of the dim-th boundary matrix (i.e. column-major matrix of \(\partial_q\)).
 
std::vector< size_t > bottom_faces (size_t id_cell, int q) const
 Returns 0-simplex indices included in the cell with index id_cell of dimension q.
 
template<typename CoefficientT , int ChainTypeF>
Column_chain cofaces_chain (OSM::Sparse_chain< CoefficientT, ChainTypeF > chain, int q) const
 Returns the cofaces of a given chain in dimension q.
 
size_t get_id () const
 Get (unique) object Id.
 

Static Public Member Functions

template<typename LabelType = int>
static void chain_complex_to_vtk (const Simplicial_chain_complex &K, const std::string &filename, const std::vector< std::vector< LabelType > > *labels=NULL, std::string label_type_name="int")
 
static void chain_to_vtk (const Simplicial_chain_complex &K, const std::string &filename, const OSM::Sparse_chain< CoefficientRing, OSM::COLUMN > &chain, int q, size_t cellId=-1)
 

Protected Attributes

std::vector< Point_coords
 Vector of vertex coordinates.
 
- Protected Attributes inherited from CGAL::Homological_discrete_vector_field::Abstract_simplicial_chain_complex< CoefficientRing >
int _dim
 
std::vector< std::vector< Simplex > > _ind2simp
 
std::vector< std::map< Simplex, size_t > > _simp2ind
 
std::vector< size_t > _nb_cells
 
std::vector< Column_matrix_d
 

Additional Inherited Members

- Protected Member Functions inherited from CGAL::Homological_discrete_vector_field::Abstract_simplicial_chain_complex< CoefficientRing >
std::ostream & print_complex (std::ostream &out=std::cout) const
 
void compute_d (int q) const
 
void insert_simplex (const Simplex &tau)
 

Constructor & Destructor Documentation

◆ Simplicial_chain_complex()

template<typename CoefficientRing , typename Traits >
CGAL::Homological_discrete_vector_field::Simplicial_chain_complex< CoefficientRing, Traits >::Simplicial_chain_complex ( const Mesh_object_io< Traits > &  mesh)

Constructor from a Mesh_object_io.

Builds a simplicial complex from a Mesh_object_io describing maximal faces and vertex coordinates.

Member Function Documentation

◆ operator=()

template<typename CoefficientRing , typename Traits >
Simplicial_chain_complex & CGAL::Homological_discrete_vector_field::Simplicial_chain_complex< CoefficientRing, Traits >::operator= ( const Simplicial_chain_complex< CoefficientRing, Traits > &  complex)

Assignment operator for simplicial complexes.

Stores a copy of a simplicial complex in *this.

Parameters
complexThe simplicial complex which will be copied.

◆ point()

template<typename CoefficientRing , typename Traits >
Point CGAL::Homological_discrete_vector_field::Simplicial_chain_complex< CoefficientRing, Traits >::point ( size_t  i) const

Gets the coordinates of the ith dimension-0 simplex.

Warning
This does not come to return vertex indices, as dimension 0 simplices enumerate vertices in any order. For instance, if an abstract simplicial complex is build from 3 vertices {1,2,3} such that the enumeration of dimension 0 simplices is: id0: 3, id1 : 2, id2: 1 then the bottom_faces of the 1-simplex {1,2} are two 0-simplices with id 2 and 1.