Class computing the zigzag persistent homology of a zigzag sequence. Algorithm based on [41]. More...
#include <gudhi/zigzag_persistence.h>
Public Types | |
using | Options = ZigzagOptions |
using | Index = typename Options::Internal_key |
using | Dimension = typename Options::Dimension |
Public Member Functions | |
Zigzag_persistence (std::function< void(Dimension, Index, Index)> stream_interval, unsigned int preallocationSize=0) | |
Constructor of the Zigzag_persistence class. More... | |
template<class BoundaryRange = std::initializer_list<Index>> | |
Index | insert_cell (const BoundaryRange &boundary, Dimension dimension) |
Updates the zigzag persistence diagram after the insertion of the given cell. More... | |
Index | remove_cell (Index arrowNumber) |
Updates the zigzag persistence diagram after the removal of the given cell. More... | |
Index | 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. Increases the arrow number by one. More... | |
template<typename F > | |
void | get_current_infinite_intervals (F &&stream_infinite_interval) |
Outputs through the given callback method all birth indices which are currently not paired with a death index. More... | |
Class computing the zigzag persistent homology of a zigzag sequence. Algorithm based on [41].
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. The pairs of birth and death indices are retrieved via the given callback method every time a pair is closed. To retrieve the open pairs (corresponding to infinite bars), use get_current_infinite_intervals.
ZigzagOptions | Structure following the ZigzagOptions concept. Default value: Default_zigzag_options. |
using Gudhi::zigzag_persistence::Zigzag_persistence< ZigzagOptions >::Dimension = typename Options::Dimension |
Type for dimension values.
using Gudhi::zigzag_persistence::Zigzag_persistence< ZigzagOptions >::Index = typename Options::Internal_key |
Key and index type, has to be signed.
using Gudhi::zigzag_persistence::Zigzag_persistence< ZigzagOptions >::Options = ZigzagOptions |
Zigzag options.
|
inline |
Constructor of the Zigzag_persistence class.
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. The pairs of birth and death indices are retrieved via the given callback method every time a pair is closed. To retrieve the open pairs (corresponding to infinite bars), use get_current_infinite_intervals.
stream_interval | Callback method to process the birth and death index pairs. Has to take three arguments as input: first the dimension of the cycle, then the birth index of the cycle and third the death index of the cycle. An index always corresponds to the arrow number the event occurred (one call to insert_cell, remove_cell or apply_identity is equal to one arrow and increases the arrow count by one). |
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. |
|
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. Increases the arrow number by one.
|
inline |
Outputs through the given callback method all birth indices which are currently not paired with a death index.
F | Type of the callback method. Takes two arguments: the dimension of the cycle and the birth index of the cycle. |
stream_infinite_interval | Method processing the unpaired birth indices. |
|
inline |
Updates the zigzag persistence diagram after the insertion of the given cell.
BoundaryRange | Range type needing size, begin and end members. |
boundary | Boundary of the inserted cell. The boundary should be represented by all the cells with non-zero coefficients generating it. A cell should be represented by the arrow number when the cell appeared for the first time in the filtration (if a cell was inserted and then removed and reinserted etc., only the last insertion counts). The cell range should be ordered by increasing arrow numbers. |
dimension | Dimension of the inserted cell. |
|
inline |
Updates the zigzag persistence diagram after the removal of the given cell.
arrowNumber | Arrow number of when the cell to remove was inserted for the last time. |