#include <iostream>
#include <vector>
void print_barcode(
ZP& zp) {
std::cout << std::endl << "Current barcode:" << std::endl;
std::cout << bar << std::endl;
}
}
void print_indices(
ZP& zp) {
std::cout << std::endl << "Current pairs:" << std::endl;
std::cout << bar << std::endl;
}
}
std::vector<std::vector<Cell_handle> > get_boundaries() {
return {{},
{},
{},
{0, 1},
{0, 2},
{},
{1, 2},
{},
{5, 7},
{},
{3, 4, 6},
{7, 9},
{5, 9},
{8, 11, 12},
{10},
{13},
{1, 7},
{3, 4, 6},
{2, 7},
{8, 11, 12},
{0, 7},
{4, 18, 20},
{6, 16, 18},
{3, 16, 20},
{19},
{8},
{12},
{17, 21, 22, 23},
{27}};
}
std::vector<Filtration_value> get_filtration_values() {
return {0, 0, 0,
1, 1, 1,
2, 2, 2,
3, 3, 3, 3,
4,
5,
6, 6, 6,
7, 7, 7, 7, 7, 7,
8,
9, 9, 9,
10};
}
std::vector<bool> get_directions() {
return {true, true, true, true, true, true, true, true, true, true, true, true, true, true,
false, false,
true, true, true, true, true, true, true, true,
false, false, false,
true,
false};
}
std::vector<unsigned int> get_batch_sizes() {
return {14, 2, 8, 3, 1, 1};
}
int main(int argc, char* const argv[]) {
std::clog << "********** Example **********" << std::endl;
std::vector<std::vector<Cell_handle> > simplices = get_boundaries();
std::vector<Filtration_value> fils = get_filtration_values();
std::vector<bool> dirs = get_directions();
for (unsigned int i = 0; i < simplices.size(); ++i) {
if (i > 0 && dirs[i] != dirs[i - 1]) {
print_barcode(zp);
print_indices(zp);
}
if (dirs[i]) {
int dim = simplices[i].size() == 0 ? 0 : simplices[i].size() - 1;
} else {
auto id = simplices[i][0];
}
}
print_barcode(zp);
print_indices(zp);
return 0;
}
Class computing the zigzag persistent homology of a zigzag filtration. Algorithm based on ....
Definition: filtered_zigzag_persistence.h:121
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 ...
Definition: filtered_zigzag_persistence.h:221
typename Options::Filtration_value Filtration_value
Definition: filtered_zigzag_persistence.h:126
Gudhi::persistence_matrix::Persistence_interval< Dimension, Filtration_value > Filtration_value_interval
Persistence filtration interval type.
Definition: filtered_zigzag_persistence.h:136
std::vector< Filtration_value_interval > get_persistence_diagram(Filtration_value shortestInterval=0., bool includeInfiniteBars=true)
Returns the current persistence diagram.
Definition: filtered_zigzag_persistence.h:286
typename Options::Cell_key Cell_key
Definition: filtered_zigzag_persistence.h:125
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...
Definition: filtered_zigzag_persistence.h:257
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.
Definition: filtered_zigzag_persistence.h:180
Contains the implementation of the Gudhi::zigzag_persistence::Default_filtered_zigzag_options structu...
Value type for a filtration function on a cell complex.
Definition: FiltrationValue.h:20
Type for an interval in a persistent diagram or barcode. Stores the birth, death and dimension of the...
Definition: persistence_interval.h:40