Class computing the zigzag persistent homology of a zigzag filtration. Algorithm based on [41]. Even though the insertions and removals are given in a "stream-like" way, the barcode and other values are stored during the whole process and not removed. It is therefore suited for smaller filtrations where the clean ups produce a higher overhead than the memory consumption. More...
#include <include/gudhi/filtered_zigzag_persistence.h>
Public Types | |
using | Options = FilteredZigzagOptions |
using | Internal_key = typename Options::Internal_key |
using | Cell_key = typename Options::Cell_key |
using | Filtration_value = typename Options::Filtration_value |
using | Dimension = typename Options::Dimension |
using | Index_interval = Gudhi::persistence_matrix::Persistence_interval< Dimension, Internal_key > |
Persistence index interval type. | |
using | Filtration_value_interval = Gudhi::persistence_matrix::Persistence_interval< Dimension, Filtration_value > |
Persistence filtration interval type. | |
Public Member Functions | |
Filtered_zigzag_persistence_with_storage (unsigned int preallocationSize=0, int ignoreCyclesAboveDim=-1) | |
Constructor. More... | |
template<class BoundaryRange = std::initializer_list<Cell_key>> | |
Internal_key | insert_cell (Cell_key cellID, const BoundaryRange &boundary, Dimension dimension, Filtration_value filtrationValue) |
Updates the zigzag persistence diagram after the insertion of the given cell. More... | |
Internal_key | remove_cell (Cell_key cellID, Filtration_value filtrationValue) |
Updates the zigzag persistence diagram after the removal of the given cell if the cell was contained in the current complex (note that it will not contain cells of dimension > ignoreCyclesAboveDim if the latter was non negative at construction of the class). Otherwise, just increases the operation count by one. More... | |
Internal_key | apply_identity () |
To use when a cell is neither inserted nor removed, but the filtration moves along the identity operator on homology level. Useful to keep the birth/death indices aligned when insertions/removals are purposely skipped to avoid useless computation. More... | |
const std::vector< Index_interval > & | get_index_persistence_diagram () const |
Returns the "index persistence diagram" of the current filtration, that is, the pairs of atomic arrow numbers corresponding to a birth-death pair. Does not contain points at infinity, only the cycle classes which already died are represented. More... | |
Filtration_value | get_filtration_value_from_index (Internal_key idx) |
Returns the filtration value | |
std::vector< Filtration_value_interval > | get_persistence_diagram (Filtration_value shortestInterval=0., bool includeInfiniteBars=true) |
Returns the current persistence diagram. More... | |
Class computing the zigzag persistent homology of a zigzag filtration. Algorithm based on [41]. Even though the insertions and removals are given in a "stream-like" way, the barcode and other values are stored during the whole process and not removed. It is therefore suited for smaller filtrations where the clean ups produce a higher overhead than the memory consumption.
After construction of the class, the zigzag filtration should be given in a streaming like way, i.e., call insert_cell, remove_cell or apply_identity for each step of the filtration in order of the filtration. To retrieve the current persistence diagram at any moment of the filtration, use get_persistence_diagram or get_index_persistence_diagram.
FilteredZigzagOptions | Structure following the FilteredZigzagOptions concept. Default value: Default_filtered_zigzag_options. |
using Gudhi::zigzag_persistence::Filtered_zigzag_persistence_with_storage< FilteredZigzagOptions >::Cell_key = typename Options::Cell_key |
Cell ID type from external inputs.
using Gudhi::zigzag_persistence::Filtered_zigzag_persistence_with_storage< FilteredZigzagOptions >::Dimension = typename Options::Dimension |
Type for dimension values.
using Gudhi::zigzag_persistence::Filtered_zigzag_persistence_with_storage< FilteredZigzagOptions >::Filtration_value = typename Options::Filtration_value |
Type for filtration values.
using Gudhi::zigzag_persistence::Filtered_zigzag_persistence_with_storage< FilteredZigzagOptions >::Internal_key = typename Options::Internal_key |
Key and index type, has to be signed.
using Gudhi::zigzag_persistence::Filtered_zigzag_persistence_with_storage< FilteredZigzagOptions >::Options = FilteredZigzagOptions |
Zigzag options.
|
inline |
Constructor.
After construction of the class, the zigzag filtration should be given in a streaming like way, i.e., call insert_cell, remove_cell or apply_identity for each step of the filtration in order of the filtration. To retrieve the current persistence diagram at any moment of the filtration, use get_persistence_diagram or get_index_persistence_diagram.
preallocationSize | Reserves space for preallocationSize cells in the internal data structure. This is optional and just helps skip a few reallocations. The optimal value (no reallocation, no wasted space) is the number of cells in the biggest complex of the filtration. Default value: 0. |
ignoreCyclesAboveDim | Ignores cycles in dimension larger or equal in the final diagram. If -1, no cycles are ignored. Default value: -1. |
|
inline |
To use when a cell is neither inserted nor removed, but the filtration moves along the identity operator on homology level. Useful to keep the birth/death indices aligned when insertions/removals are purposely skipped to avoid useless computation.
|
inline |
Returns the filtration value
idx | Birth or death index |
idx
.
|
inline |
Returns the "index persistence diagram" of the current filtration, that is, the pairs of atomic arrow numbers corresponding to a birth-death pair. Does not contain points at infinity, only the cycle classes which already died are represented.
|
inline |
Returns the current persistence diagram.
shortestInterval | Threshold. Every bar shorter than the given value will not be returned. Default value: 0. |
includeInfiniteBars | If set to true, infinite bars are included in the diagram. Default value: true. |
|
inline |
Updates the zigzag persistence diagram after the insertion of the given cell.
BoundaryRange | Range type needing size, begin and end members. |
cellID | ID representing the inserted cell. |
boundary | Boundary of the inserted cell. The range should be composed of the IDs of all cells contained in the boundary (i.e. with non-zero coefficients), using the ID specified as cellID when the corresponding cell was previously inserted (recall that the cells should be inserted in order of filtration). |
dimension | Dimension of the inserted cell. |
filtrationValue | Filtration value associated to the cell. Assumed to be always larger or equal to previously used filtration values or always smaller or equal than previous values, ie. the changes are monotonous. |
|
inline |
Updates the zigzag persistence diagram after the removal of the given cell if the cell was contained in the current complex (note that it will not contain cells of dimension > ignoreCyclesAboveDim if the latter was non negative at construction of the class). Otherwise, just increases the operation count by one.
cellID | ID representing the cell to remove. Should be the same than the one used to insert it. |
filtrationValue | Filtration value associated to the removal. Assumed to be always larger or equal to previously used filtration values or always smaller or equal than previous values, ie. the changes are monotonous. |