CGAL 6.2 - Homological Discrete Vector Fields
Loading...
Searching...
No Matches
CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ > Class Template Reference

#include <CGAL/HDVF/Hdvf_persistence.h>

Inherits from

CGAL::Homological_discrete_vector_field::Hdvf_core< ChainComplex >.

Definition

template<typename ChainComplex, typename Degree, typename Filtration_>
class CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >

The class Hdvf_persistence computes persistent homology using HDVFs (over a ring of coefficients which should actually be a field).

Hence, unlike other persistence algorithms, beside standard persistent intervals informations (birth/death indices, degrees, associated cells), Hdvf_persistence also provides homology and cohomology generators for persistent pairs. Intuitively, holes die when they are "filled" by a cell: associated homology and cohomology generators provide a representation of the hole and of the cells filling the hole.

Given a Filtration, the Hdvf_persistence constructor basically builds a HDVF where indices of cells in the bases follow the filtration order (permutations between initial indices of cells in the chain complex and new indices given by the filtration are stored). Besides, Hdvf_persistence derives from Hdvf_core with the SparseMatrix parameter type set to OSM::Sub_sparse_matrix. Hence, Hdvf_persistence computes homology over a larger and larger sub-complex of K (encoded through a Bitboard mask of OSM::Sub_sparse_matrix) following the filtration f. At each step of the filtration, the new cell is paired (A operation) with the youngest cell valid for A.

A few words about persistent generators. At a given time \(t_2\) along the filtration, let us denote by \(\tau\) the \(q+1\)-cell inserted and let us assume that persistent homology computation pairs \(A(\sigma, \tau)\) (let \(t_1\) be the index of \(\sigma\) along the filtration). A new persistent interval \((t_1, t_2)\)is created, generated by \(\sigma\) and filled by \(\tau\). Reduction at time \(t_2-1\) (just before the insertion of \(\tau\)) provides persistent generators: \(g(\sigma)\) is a cycle and \(g(\tau)\) is a chain "filling" this cycle (before the pairing \(A(\sigma, \tau)\), the HDVF over \(K_{t_2}\) is not perfect, thus \(g(\tau)\) is not a cycle but a chain bounded by \(q\)-cycles).

Next figures illustrate such informations for a filtration of a dented double torus.

Filtration Filtration_lower_star along the z axis of a dented double torus.

The first persistent hole is a dimension 1 hole with a duration of 0.359 along z.

  • (Left) the complex at time 622 along the filtration (in blue, the 2-cell \(\tau\) added at time 623). This 1-homology of this complex contains two cycles depicted in white and yellow respectively. Yellow curve: a 1-cycle born at time 319 (with cell \(\sigma\)) along the filtration. White curve: the second 1-cycle of this complex (born at time 156 along the filtration).
  • (Middle) the filtration adds the (blue) 2-cell \(\tau\) at time 623: this cell fills one the 1-cycles (actually the "youngest" cycle, thus the yellow one). Middle image illustrates as a yellow patch the "filling 2-chain", a chain a 2-cells filling the hole when the cell \(\tau\) is added. As stated earlier, this filling chain is not a cycle and it equals \(g(\tau)\) in the (non perfect) reduction before the pairing A(319, 623) between \(\sigma\) and \(\tau\). Middle figure illustrates that in the (non perfect) HDVF before A operation, \(g(\tau)\) is not a cycle but a chain bounded by \(q\)-cycles.
  • (Right) the complex after insertion of \(\tau\) and the pairing A(319, 623) between \(\sigma\) and \(\tau\). Only the white 1-cycle remains (actually its persistent lifetime is infinite).

The figure above illustrates next persistent hole (dimension 0 hole) which duration is 0.684 along z. The cell \(\tau\) is added at time 1237 and fills the 0-hole (connected component) introduced at time 756 by the cell \(\sigma\). The persistent generator associated to \(\sigma\) is simply the cell itself identifying its connected component. The persistent generator associated to \(\tau\) is a 1-chain (depicted in yellow) connecting \(\sigma\) to the critical cell identifying the second connected component.

Figures above illustrate next finite persistent intervals and (right) infinite dimension 1 persistent intervals.

Is model of
HDVF
Template Parameters
ChainComplexa model of the AbstractChainComplex concept, providing the type of abstract chain complex used (the underlying ring of coefficients must be a model of Field). The sparse matrix provided by ChainComplex must be an instance of the Sub_sparse_matrix template.
Degreea scalar data type used for the degrees of the filtration (a model of RealEmbeddable concept).
Filtration_a model of the Filtration concept, providing the filtration used to compute persistence.

Classes

struct  iterator
 Iterator over (finite) persistent intervals. More...
 
struct  Persistence_interval
 Structure storing (full) persistent interval data: More...
 
struct  Persistent_hole
 Hole information returned by the persistent diagram iterator. More...
 

Public Types

typedef ChainComplex Chain_complex
 Chain complex type.
 
typedef Chain_complex::Coefficient_ring Coefficient_ring
 Type of coefficients used to compute homology.
 
typedef Hdvf_core< ChainComplex > Base
 Type of parent HDVF class (Hdvf_core with appropriate template parameters) The SparseMatrix model is set to Sub_sparse_matrix to activate (co)homology computation over a subcomplex.
 
typedef Base::Column_chain Column_chain
 Type of column-major chains.
 
typedef Base::Row_chain Row_chain
 Type of row-major chains.
 
typedef Base::Column_matrix Column_matrix
 Type of column-major sparse matrices.
 
typedef Base::Row_matrix Row_matrix
 Type of row-major sparse matrices.
 
typedef Filtration_ Filtration
 Type of filtrations used to compute persistence.
 
- Public Types inherited from CGAL::Homological_discrete_vector_field::Hdvf_core< ChainComplex >
typedef ChainComplex Chain_complex
 Type of the underlying chain complex.
 
typedef ChainComplex::Coefficient_ring Coefficient_ring
 Type of coefficients used to compute homology.
 
typedef ChainComplex::Sparse_matrix_struct Sparse_matrix_struct
 Type of sparse matrix structure used to compute homology.
 
template<typename CR , int SF>
using Sparse_chain_base = typename Sparse_matrix_struct::template Sparse_chain_type< CR, SF >
 Template type of underlying sparse chains.
 
template<typename CR , int SF>
using Sparse_matrix_base = typename Sparse_matrix_struct::template Sparse_matrix_type< CR, SF >
 Template type of underlying sparse matrices.
 
typedef Sparse_chain_base< Coefficient_ring, CGAL::OSM::COLUMNColumn_chain
 Type of column-major chains.
 
typedef Sparse_chain_base< Coefficient_ring, CGAL::OSM::ROWRow_chain
 Type of row-major chains.
 
typedef Sparse_matrix_base< Coefficient_ring, CGAL::OSM::COLUMNColumn_matrix
 Type of column-major sparse matrices.
 
typedef Sparse_matrix_base< Coefficient_ring, CGAL::OSM::ROWRow_matrix
 Type of row-major sparse matrices.
 

Public Member Functions

 Hdvf_persistence (const Chain_complex &K, const Filtration &f, int hdvf_opt=OPT_BND, bool with_export=false, int dimension_restriction=-1)
 Hdvf_persistence default constructor.
 
std::vector< Cell_paircompute_perfect_hdvf (bool verbose=false)
 Computes a perfect persistent HDVF.
 
bool with_export () const
 Gets the "with_export" Boolean flag.
 
const Filtrationfiltration () const
 Get a constant reference on the filtration.
 
std::ostream & print_hdvf_persistence_information (std::ostream &out) const
 Prints informations related to the filtration.
 
std::vector< std::vector< int > > psc_labels () const
 Exports primary/secondary/critical labels to integers (e.g. for vtk export).
 
Column_chain homology_chain (size_t cell_index, int q) const
 Exports homology generators associated to cell_index (critical cell) of dimension q (e.g. for vtk export).
 
Column_chain cohomology_chain (size_t cell_index, int q) const
 Exports cohomology generators associated to cell (critical cell) of dimension q (used by vtk export).
 
iterator begin (bool discard_small=true)
 Iterator to the beginning of persistent intervals.
 
iterator end ()
 Iterator past-the-end of the chain indices.
 
std::ostream & write_hdvf_reduction (std::ostream &out) const
 Writes a HDVF_persistence together with the associated reduction (f, g, h, d matrices)
 
void write_hdvf_reduction (std::string filename) const
 Writes a HDVF_persistence together with the associated reduction to a file (f, g, h, d matrices).
 
std::istream & read_hdvf_reduction (std::istream &in)
 Reads a HDVF_persistence together with the associated reduction (f, g, h, d matrices)
 
void read_hdvf_reduction (std::string filename)
 Loads a HDVF_persistence together with the associated reduction from a file (f, g, h, d matrices)
 
bool compare (const Hdvf_persistence &other, bool full_compare=false) const
 Compares the HDVF_persistence with another HDVF_persistence over the same underlying complex and filtration.
 
- Public Member Functions inherited from CGAL::Homological_discrete_vector_field::Hdvf_core< ChainComplex >
int dimension_restriction () const
 Returns the dimension of Hdvf computation.
 
void dimension_restriction (int dimension)
 Changes the dimension of Hdvf computation.
 
 Hdvf_core (const ChainComplex &K, int hdvf_opt=OPT_FULL, int dimension_restriction=-1)
 Constructor from a chain complex.
 
 Hdvf_core (const Hdvf_core &hdvf)
 
Hdvf_coreoperator= (const Hdvf_core &hdvf)
 Affectation operator.
 
 Hdvf_core (const ChainComplex &K, const std::vector< std::vector< PSC_flag > > &flags, bool with_build_reduction=false, int hdvf_opt=OPT_FULL, int dimension_restriction=-1)
 Constructor from the PRIMARY/SECONDARY/CRITICAL labels.
 
 ~Hdvf_core ()
 
bool combinatorially_coherent ()
 Check the "combinatorial" coherence of a HDVF \(X(P,S,C)\).
 
bool is_valid_pair_for_A (size_t gamma, size_t gamma_prime, int q)
 Checks if the pair of cells \((\gamma, \gamma')\), of dimensions q / q+1, is valid for A.
 
virtual Cell_pair find_pair_A (int q, bool &found) const
 Finds a valid Cell_pair of dimension q / q+1 for A.
 
virtual Cell_pair find_pair_A (int q, bool &found, size_t gamma) const
 Finds a valid Cell_pair for A containing gamma (a cell of dimension q)
 
virtual std::vector< Cell_pairfind_pairs_A (int q, bool &found) const
 Finds all valid Cell_pair of dimension q / q+1 for A.
 
virtual std::vector< Cell_pairfind_pairs_A (int q, bool &found, size_t gamma) const
 Finds all valid Cell_pair for A containing gamma (a cell of dimension q)
 
void A (size_t gamma1, size_t gamma2, int q)
 A operation: pairs critical cells.
 
void A (const Cell_pair &p)
 A operation: pairs critical cells.
 
std::vector< Cell_paircompute_perfect_hdvf (bool verbose=false)
 Computes a perfect HDVF.
 
std::vector< Cell_paircompute_rand_perfect_hdvf (bool verbose=false)
 Computes a random perfect HDVF.
 
bool is_perfect_hdvf (int dimension_restriction=-2)
 Tests if a HDVF is perfect.
 
size_t number_of_cells_by_flag (PSC_flag flag, int q) const
 Gets the number of cells with a given flag in dimension q.
 
virtual std::vector< std::vector< size_t > > psc_flags (PSC_flag flag) const
 Gets cells with a given PSC_flag in any dimension.
 
virtual std::vector< size_t > psc_flags (PSC_flag flag, int q) const
 Gets cells with a given PSC_flag in dimension q.
 
virtual const std::vector< PSC_flag > & psc_flags (int q) const
 Gets thePSC_flag of all cells in dimension q.
 
virtual const std::vector< std::vector< PSC_flag > > & psc_flags () const
 Gets thePSC_flag of all cells.
 
PSC_flag psc_flag (size_t tau, int q) const
 Gets the PSC_flag of the cell tau in dimension q.
 
int hdvf_opts () const
 Gets HDVF computation option.
 
const Row_matrixmatrix_f (int q) const
 Gets the row-major matrix of \(f\) (from the reduction associated to the HDVF).
 
const Column_matrixmatrix_g (int q) const
 Gets the column-major matrix of \(g\) (from the reduction associated to the HDVF).
 
const Column_matrixmatrix_h (int q) const
 Gets the column-major matrix of \(h\) (from the reduction associated to the HDVF).
 
const Column_matrixmatrix_dd (int q) const
 Gets the column-major matrix of \(\partial'\), reduced boundary operator (from the reduction associated to the HDVF).
 
const Chain_complexcomplex ()
 Gets a constant reference over the underlying chain complex.
 
std::ostream & write_flags (std::ostream &out=std::cout, int dimension_restriction=-2) const
 Writes the PSC flags of cells along each dimension.
 
std::ostream & write_matrices (std::ostream &out=std::cout, int dimension_restriction=-2) const
 Writes the matrices of the reduction.
 
std::ostream & write_reduction (std::ostream &out=std::cout, int dimension_restriction=-2) const
 Writes the homology and cohomology reduction information.
 
virtual std::vector< std::vector< int > > psc_labels (int dimension_restriction=-2) const
 Exports primary/secondary/critical integers encoding labels (in particular for vtk export)
 
virtual Column_chain homology_chain (size_t cell_index, int q) const
 Gets homology generators associated to cell (critical cell) of dimension q (used by vtk export).
 
virtual Column_chain cohomology_chain (size_t cell_index, int dim) const
 Gets cohomology generators associated to cell_index (critical cell) of dimension q (used by vtk export).
 
std::ostream & write_hdvf_reduction (std::ostream &out) const
 Writes a HDVF together with the associated reduction (f, g, h, d matrices)
 
void write_hdvf_reduction (std::string filename) const
 Writes a HDVF together with the associated reduction to a file (f, g, h, d matrices).
 
std::istream & read_hdvf_reduction (std::istream &in_stream)
 Loads a HDVF together with the associated reduction (f, g, h, d matrices)
 
void read_hdvf_reduction (std::string filename)
 Loads a HDVF together with the associated reduction from a file (f, g, h, d matrices)
 
bool compare (const Hdvf_core &other, bool full_compare=false) const
 Compares the HDVF with another HDVF over the same underlying complex.
 
bool operator== (const Hdvf_core &other)
 Comparison operator.
 

Protected Attributes

const Filtration_f
 
std::vector< std::vector< size_t > > _K_to_per
 
std::vector< std::vector< size_t > > _per_to_K
 
std::vector< Persistence_interval_persist
 
bool _with_export
 
std::vector< std::vector< std::vector< int > > > _export_labels
 
std::vector< std::pair< Column_chain, Column_chain > > _export_g
 
std::vector< std::pair< Column_chain, Column_chain > > _export_fstar
 
size_t _t
 
std::vector< size_t > _t_dim
 
std::vector< OSM::Bitboard_masks
 
- Protected Attributes inherited from CGAL::Homological_discrete_vector_field::Hdvf_core< ChainComplex >
std::vector< std::vector< PSC_flag > > _flag
 
std::vector< size_t > _nb_P
 
std::vector< size_t > _nb_S
 
std::vector< size_t > _nb_C
 
std::vector< Row_matrix_F_row
 
std::vector< Column_matrix_G_col
 
std::vector< Column_matrix_H_col
 
std::vector< Column_matrix_DD_col
 
const ChainComplex & _K
 
int _hdvf_opt
 
int _dimension_restriction
 
int _min_dimension
 
int _max_dimension
 

Friends

std::ostream & operator<< (std::ostream &out_stream, const Hdvf_persistence &per_hdvf)
 Overload of operator<<() for Hdvf_persistence.
 

Additional Inherited Members

- Protected Member Functions inherited from CGAL::Homological_discrete_vector_field::Hdvf_core< ChainComplex >
Sub_matrix_data< Sparse_matrix_base< Coefficient_ring, OSM::ROW > > extract_sub (const Sparse_matrix_base< Coefficient_ring, OSM::ROW > &M, int q_rows, int q_cols, PSC_flag flag_rows, PSC_flag flag_cols)
 
Sub_matrix_data< Sparse_matrix_base< Coefficient_ring, OSM::COLUMN > > extract_sub (const Sparse_matrix_base< Coefficient_ring, OSM::COLUMN > &M, int q_rows, int q_cols, PSC_flag flag_rows, PSC_flag flag_cols)
 
template<typename MatrixType >
void fill_sub (MatrixType &M, const Sub_matrix_data< MatrixType > &sub)
 
template<typename MatrixType >
void restrict_matrix (MatrixType &M, int q_rows, int q_cols, PSC_flag flag_rows, PSC_flag flag_cols)
 
void build_reduction ()
 
std::ostream & write_hdvf_reduction_main (std::ostream &out) const
 
std::istream & read_hdvf_reduction_main (std::istream &in_stream)
 
template<int StorageFormat>
Sparse_chain_base< Coefficient_ring, StorageFormat > projection (const Sparse_chain_base< Coefficient_ring, StorageFormat > &chain, PSC_flag flag, int q) const
 
void progress_bar (size_t i, size_t n)
 

Member Typedef Documentation

◆ Base

template<typename ChainComplex , typename Degree , typename Filtration_ >
typedef Hdvf_core<ChainComplex> CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::Base

Type of parent HDVF class (Hdvf_core with appropriate template parameters) The SparseMatrix model is set to Sub_sparse_matrix to activate (co)homology computation over a subcomplex.

Todo:
Check that the SparseMatrix provided by ChainComplex is a Sub_sparse_matrix (and not a standard Sparse_matrix.

Constructor & Destructor Documentation

◆ Hdvf_persistence()

template<typename ChainComplex , typename Degree , typename Filtration_ >
CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::Hdvf_persistence ( const Chain_complex K,
const Filtration f,
int  hdvf_opt = OPT_BND,
bool  with_export = false,
int  dimension_restriction = -1 
)

Hdvf_persistence default constructor.

Builds an "empty" HDVF_persistence (with all cells critical) associated to the chain complex K and the filtration f. By default, the HDVF option is set to OPT_FULL (full reduction computed)

Parameters
KA chain complex (a model of AbstractChainComplex).
fA filtration (a model of Filtration).
hdvf_optOption for HDVF computation (OPT_BND, OPT_F, OPT_G or OPT_FULL)
with_exportBoolean option to activate or not the export of PSC labels and homology/cohomology generators for of persistent intervals of positive duration. This information is used by vtk exporters.
dimension_restrictionDetermines if persistence is computed along any dimensions (if dimension_restriction is -1) or a single dimension (specified by dimension_restrictions)
Exceptions
Empty_complexIf the complex `K` is empty, raises a `std::runtime_error`.

Member Function Documentation

◆ begin()

template<typename ChainComplex , typename Degree , typename Filtration_ >
iterator CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::begin ( bool  discard_small = true)

Iterator to the beginning of persistent intervals.

Parameters
discard_smallIf true, the iterator visits only persistent intervals of (strictly) positive degree duration. Otherwise, visit all persistent intervals.
Returns
The iterator to the beginning of the chain indices.

◆ cohomology_chain()

template<typename ChainComplex , typename Degree , typename Filtration_ >
Column_chain CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::cohomology_chain ( size_t  cell_index,
int  q 
) const
virtual

Exports cohomology generators associated to cell (critical cell) of dimension q (used by vtk export).

The method exports the chain \(f^\star(\sigma)\) for \(\sigma\) the cell of index cell and dimension q.

Returns
A column-major chain.
Exceptions
Invalid_hdvf_optionIf the HDVF option is neither `OPT_FULL` nor `OPT_F` raises a `std::runtime_error`.

Reimplemented from CGAL::Homological_discrete_vector_field::Hdvf_core< ChainComplex >.

◆ compare()

template<typename ChainComplex , typename Degree , typename Filtration_ >
bool CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::compare ( const Hdvf_persistence< ChainComplex, Degree, Filtration_ > &  other,
bool  full_compare = false 
) const

Compares the HDVF_persistence with another HDVF_persistence over the same underlying complex and filtration.

Parameters
otherOther HDVF_persistence to compare.
full_compareTurns on "in depth" HDVF comparison (reduction matrices).

◆ compute_perfect_hdvf()

template<typename ChainComplex , typename Degree , typename Filtration_ >
std::vector< Cell_pair > CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::compute_perfect_hdvf ( bool  verbose = false)

Computes a perfect persistent HDVF.

This method follows the filtration and considers cells one by one. For each of them, it searches the youngest possible cell valid for A (returned by find_pair_A()), and applies the corresponding A() operation. By definition of persistent homology, the IntegralDomainWithoutDivision of coefficients must be a Field.

If dimension_restriction is a positive parameter (in the HDVF), then persistence is computed only in dimension dimension_restriction.

Parameters
verboseIf this parameter is true, all intermediate reductions are printed out.
Returns
The vector of all Cell_pair paired with A.

◆ end()

template<typename ChainComplex , typename Degree , typename Filtration_ >
iterator CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::end ( )

Iterator past-the-end of the chain indices.

Returns
The past-the-end iterator of the chain indices.

◆ homology_chain()

template<typename ChainComplex , typename Degree , typename Filtration_ >
Column_chain CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::homology_chain ( size_t  cell_index,
int  q 
) const
virtual

Exports homology generators associated to cell_index (critical cell) of dimension q (e.g. for vtk export).

The method exports the chain \(g(\sigma)\) for \(\sigma\) the cell of index cell_index and dimension q.

Returns
A column-major chain.

Reimplemented from CGAL::Homological_discrete_vector_field::Hdvf_core< ChainComplex >.

◆ print_hdvf_persistence_information()

template<typename ChainComplex , typename Degree , typename Filtration_ >
std::ostream & CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::print_hdvf_persistence_information ( std::ostream &  out) const

Prints informations related to the filtration.

Prints out the filtration and associated permutations (_K_to_per and _per_to_K) between indices of cells in each dimension in the basis of K and indices along the filtration.

Parameters
outReference to an output stream.

◆ psc_labels()

template<typename ChainComplex , typename Degree , typename Filtration_ >
std::vector< std::vector< int > > CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::psc_labels ( ) const

Exports primary/secondary/critical labels to integers (e.g. for vtk export).

The method exports the labels of every cell in each dimension. Encoding used:

  • PRIMARY: -1
  • SECONDARY: +1
  • CRITICAL: 0
Returns
A vector containing, for each dimension, the vector of integers encoding labels by cell index.

◆ read_hdvf_reduction() [1/2]

template<typename ChainComplex , typename Degree , typename Filtration_ >
std::istream & CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::read_hdvf_reduction ( std::istream &  in)

Reads a HDVF_persistence together with the associated reduction (f, g, h, d matrices)

Reads a HDVF_persistence from a stream in hdvf file format (a simple text file format, see for a specification).

Parameters
inInput stream.

◆ read_hdvf_reduction() [2/2]

template<typename ChainComplex , typename Degree , typename Filtration_ >
void CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::read_hdvf_reduction ( std::string  filename)

Loads a HDVF_persistence together with the associated reduction from a file (f, g, h, d matrices)

Load a HDVF_persistence and its reduction from a file in hdvf file format, a simple text file format (see for a specification).

Warning
The underlying complex is not stored in the file!
Parameters
filenameInput file name.
Exceptions
File_not_foundIf the file `filename` cannot be opened, raises a `std::runtime_error`.

◆ with_export()

template<typename ChainComplex , typename Degree , typename Filtration_ >
bool CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::with_export ( ) const

Gets the "with_export" Boolean flag.

If the flag is true, homology/cohomology generators and corresponding PSC labels are exported for each persistent interval of positive duration.

◆ write_hdvf_reduction() [1/2]

template<typename ChainComplex , typename Degree , typename Filtration_ >
std::ostream & CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::write_hdvf_reduction ( std::ostream &  out) const

Writes a HDVF_persistence together with the associated reduction (f, g, h, d matrices)

Writes a HDVF_persistence to a stream in hdvf file format (a simple text file format, see for a specification).

Parameters
outOutput stream.

◆ write_hdvf_reduction() [2/2]

template<typename ChainComplex , typename Degree , typename Filtration_ >
void CGAL::Homological_discrete_vector_field::Hdvf_persistence< ChainComplex, Degree, Filtration_ >::write_hdvf_reduction ( std::string  filename) const

Writes a HDVF_persistence together with the associated reduction to a file (f, g, h, d matrices).

Writes a HDVF_persistence to a file in hdvf file format (a simple text file format, see for a specification).

Parameters
filenameOutput file name.
Exceptions
File_not_foundIf the file `filename` cannot be opened, raises a `std::runtime_error`.

Friends And Related Function Documentation

◆ operator<<

template<typename ChainComplex , typename Degree , typename Filtration_ >
std::ostream & operator<< ( std::ostream &  out_stream,
const Hdvf_persistence< ChainComplex, Degree, Filtration_ > &  per_hdvf 
)
friend

Overload of operator<<() for Hdvf_persistence.

Prints out finite and infinite persistence intervals.

Parameters
out_streamReference to an output stream.
per_hdvfConstant reference on the Hdvf_persistence to print.