CGAL 6.2 - Homological Discrete Vector Fields
Loading...
Searching...
No Matches
CGAL::Homological_discrete_vector_field::Simplex Class Reference

#include <CGAL/HDVF/Simplex.h>

Definition

The class Simplex is used by the class Abstract_simplicial_chain_complex to represent a simplex (i.e. cells of a simplicial complex).

Simplices are described by the ordered vector of the indices of their vertices (see the documentation of Abstract_simplicial_chain_complex for examples).

Public Types

typedef std::vector< size_t > Simplex_data
 Type of simplices representation.
 
typedef Simplex_data::const_iterator const_iterator
 Constant iterator over the vertices of a simplex.
 

Public Member Functions

 Simplex (const Simplex_data &vertices, bool sort_data=false)
 Constructor from a vector of vertex indices.
 
const_iterator cbegin ()
 Returning a constant iterator on the first vertex of the simplex.
 
const_iterator cend ()
 Returning a constant past-the-end iterator of the simplex.
 
int dimension () const
 Returns the dimension of a simplex.
 
std::vector< Simplexboundary () const
 Returns the boundary of a simplex.
 
const Simplex_datavertices () const
 Gets the set of vertex indices of the simplex.
 
bool operator< (const Simplex &other) const
 Comparison operator.
 
bool operator== (const Simplex &other) const
 Equality operator.
 

Friends

template<typename _CoefficientType >
class Abstract_simplicial_chain_complex
 
std::ostream & operator<< (std::ostream &out, const Simplex &simplex)
 Outputs a simplex.
 

Member Typedef Documentation

◆ Simplex_data

Type of simplices representation.

Simplices are stored as a sorted vector of vertex indices (a simplex of dimension \(q\) has \(q+1\) vertices and the vector must be sorted).

Constructor & Destructor Documentation

◆ Simplex()

CGAL::Homological_discrete_vector_field::Simplex::Simplex ( const Simplex_data vertices,
bool  sort_data = false 
)

Constructor from a vector of vertex indices.

Parameters
verticesVector of the simplex vertex indices (a simplex of dimension \(q\) has \(q+1\) vertices and the vector must be sorted).
sort_dataIf true vectors of vertex indices are sorted, if false indices are assumed to be sorted (faster).

Member Function Documentation

◆ boundary()

std::vector< Simplex > CGAL::Homological_discrete_vector_field::Simplex::boundary ( ) const

Returns the boundary of a simplex.

The method returns the vector of the simplices in the boundary of the object.

◆ dimension()

int CGAL::Homological_discrete_vector_field::Simplex::dimension ( ) const

Returns the dimension of a simplex.

A simplex of dimension \(q\) has \(q+1\) vertices.

◆ operator<()

bool CGAL::Homological_discrete_vector_field::Simplex::operator< ( const Simplex other) const

Comparison operator.

Compare the object with another simplex according to the lexicographical order on vertex indices sets.

Parameters
otherCompare this with other (returns this < other).

◆ operator==()

bool CGAL::Homological_discrete_vector_field::Simplex::operator== ( const Simplex other) const

Equality operator.

As vertex indices must be store in increasing order, comparison just comes to compare the ordered vector of indices.