Gudhi::persistent_cohomology::Persistent_cohomology< FilteredComplex, CoefficientField > Class Template Reference

Computes the persistent cohomology of a filtered complex. More...

Public Types

typedef FilteredComplex::Simplex_key Simplex_key
 Data stored for each simplex.
 
typedef FilteredComplex::Simplex_handle Simplex_handle
 Handle to specify a simplex.
 
typedef FilteredComplex::Filtration_value Filtration_value
 Type for the value of the filtration function.
 
typedef CoefficientField::Element Arith_element
 Type of element of the field.
 
typedef std::tuple< Simplex_handle, Simplex_handle, Arith_elementPersistent_interval
 Type for birth and death FilteredComplex::Simplex_handle. The Arith_element field is used for the multi-field framework.
 
- Public Types inherited from PersistentHomology
typedef unspecified Filtered_complex
 Type of filtered cell complex on which persistent homology is computed. More...
 
typedef unspecified Coefficient_field
 Type of coefficients to be used for computing persistent homology. More...
 

Public Member Functions

 Persistent_cohomology (FilteredComplex &cpx, bool persistence_dim_max=false)
 Initializes the Persistent_cohomology class. More...
 
void init_coefficients (int charac)
 Initializes the coefficient field.
 
void init_coefficients (int charac_min, int charac_max)
 Initializes the coefficient field for multi-field persistent homology.
 
void compute_persistent_cohomology (Filtration_value min_interval_length=0)
 Compute the persistent homology of the filtered simplicial complex. More...
 
void output_diagram (std::ostream &ostream=std::cout)
 Output the persistence diagram in ostream. More...
 
std::vector< int > betti_numbers () const
 Returns Betti numbers. More...
 
int betti_number (int dimension) const
 Returns the Betti number of the dimension passed by parameter. More...
 
std::vector< int > persistent_betti_numbers (Filtration_value from, Filtration_value to) const
 Returns the persistent Betti numbers. More...
 
int persistent_betti_number (int dimension, Filtration_value from, Filtration_value to) const
 Returns the persistent Betti number of the dimension passed by parameter. More...
 
const std::vector< Persistent_interval > & get_persistent_pairs () const
 Returns a list of persistence birth and death FilteredComplex::Simplex_handle pairs. More...
 
std::vector< std::pair< Filtration_value, Filtration_value > > intervals_in_dimension (int dimension)
 Returns persistence intervals for a given dimension. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ Persistent_cohomology()

template<class FilteredComplex , class CoefficientField >
Gudhi::persistent_cohomology::Persistent_cohomology< FilteredComplex, CoefficientField >::Persistent_cohomology ( FilteredComplex cpx,
bool  persistence_dim_max = false 
)
inlineexplicit

Initializes the Persistent_cohomology class.

Parameters
[in]cpxComplex for which the persistent homology is computed. cpx is a model of FilteredComplex
[in]persistence_dim_maxif true, the persistent homology for the maximal dimension in the complex is computed. If false, it is ignored. Default is false.
Exceptions
std::out_of_rangeIn case the number of simplices is more than Simplex_key type numeric limit.

Member Function Documentation

◆ betti_number()

template<class FilteredComplex , class CoefficientField >
int Gudhi::persistent_cohomology::Persistent_cohomology< FilteredComplex, CoefficientField >::betti_number ( int  dimension) const
inline

Returns the Betti number of the dimension passed by parameter.

Parameters
[in]dimensionThe Betti number dimension to get.
Returns
Betti number of the given dimension

◆ betti_numbers()

template<class FilteredComplex , class CoefficientField >
std::vector<int> Gudhi::persistent_cohomology::Persistent_cohomology< FilteredComplex, CoefficientField >::betti_numbers ( ) const
inline

Returns Betti numbers.

Returns
A vector of Betti numbers.

◆ compute_persistent_cohomology()

template<class FilteredComplex , class CoefficientField >
void Gudhi::persistent_cohomology::Persistent_cohomology< FilteredComplex, CoefficientField >::compute_persistent_cohomology ( Filtration_value  min_interval_length = 0)
inline

Compute the persistent homology of the filtered simplicial complex.

Parameters
[in]min_interval_lengththe computation discards all intervals of length less or equal than min_interval_length

Assumes that the filtration provided by the simplicial complex is valid. Undefined behavior otherwise.

Examples
cubical_complex_persistence.cpp, example_nearest_landmark_table.cpp, and periodic_cubical_complex_persistence.cpp.

◆ get_persistent_pairs()

template<class FilteredComplex , class CoefficientField >
const std::vector<Persistent_interval>& Gudhi::persistent_cohomology::Persistent_cohomology< FilteredComplex, CoefficientField >::get_persistent_pairs ( ) const
inline

Returns a list of persistence birth and death FilteredComplex::Simplex_handle pairs.

Returns
A list of Persistent_cohomology::Persistent_interval

◆ intervals_in_dimension()

template<class FilteredComplex , class CoefficientField >
std::vector< std::pair< Filtration_value , Filtration_value > > Gudhi::persistent_cohomology::Persistent_cohomology< FilteredComplex, CoefficientField >::intervals_in_dimension ( int  dimension)
inline

Returns persistence intervals for a given dimension.

Parameters
[in]dimensionDimension to get the birth and death pairs from.
Returns
A vector of persistence intervals (birth and death) on a fixed dimension.

◆ output_diagram()

template<class FilteredComplex , class CoefficientField >
void Gudhi::persistent_cohomology::Persistent_cohomology< FilteredComplex, CoefficientField >::output_diagram ( std::ostream &  ostream = std::cout)
inline

Output the persistence diagram in ostream.

The file format is the following: p1*...*pr dim b d

where "dim" is the dimension of the homological feature, b and d are respectively the birth and death of the feature and p1*...*pr is the product of prime numbers pi such that the homology feature exists in homology with Z/piZ coefficients.

Examples
cubical_complex_persistence.cpp, example_nearest_landmark_table.cpp, and periodic_cubical_complex_persistence.cpp.

◆ persistent_betti_number()

template<class FilteredComplex , class CoefficientField >
int Gudhi::persistent_cohomology::Persistent_cohomology< FilteredComplex, CoefficientField >::persistent_betti_number ( int  dimension,
Filtration_value  from,
Filtration_value  to 
) const
inline

Returns the persistent Betti number of the dimension passed by parameter.

Parameters
[in]dimensionThe Betti number dimension to get.
[in]fromThe persistence birth limit to be added in the number \((persistent birth \leq from)\).
[in]toThe persistence death limit to be added in the number \((persistent death > to)\).
Returns
Persistent Betti number of the given dimension

◆ persistent_betti_numbers()

template<class FilteredComplex , class CoefficientField >
std::vector<int> Gudhi::persistent_cohomology::Persistent_cohomology< FilteredComplex, CoefficientField >::persistent_betti_numbers ( Filtration_value  from,
Filtration_value  to 
) const
inline

Returns the persistent Betti numbers.

Parameters
[in]fromThe persistence birth limit to be added in the number \((persistent birth \leq from)\).
[in]toThe persistence death limit to be added in the number \((persistent death > to)\).
Returns
A vector of persistent Betti numbers.

The documentation for this class was generated from the following file: