#include <gudhi/Simplex_tree.h>
#include <gudhi/Persistent_cohomology.h>
#include <iostream>
#include <vector>
#include <cstdint>
static const bool store_filtration = false;
static const bool store_key = true;
typedef std::uint8_t Simplex_key;
};
int main() {
ST st;
const short edge01[] = {0, 1};
const short edge02[] = {0, 2};
const short edge12[] = {1, 2};
const short edge03[] = {0, 3};
const short edge13[] = {1, 3};
const short edge35[] = {3, 5};
const short vertex4[] = {4};
st.insert_simplex_and_subfaces(edge01);
st.insert_simplex_and_subfaces(edge02);
st.insert_simplex_and_subfaces(edge12);
st.insert_simplex_and_subfaces(edge03);
st.insert_simplex(edge13);
st.insert_simplex_and_subfaces(edge35);
st.insert_simplex(vertex4);
pcoh.init_coefficients(2);
pcoh.compute_persistent_cohomology();
pcoh.output_diagram();
std::clog << std::endl;
std::clog << "The Betti numbers are : ";
for (int i = 0; i < 3; i++)
std::clog << "b" << i << " = " << pcoh.betti_number(i) << " ; ";
std::clog << std::endl;
}
Simplex Tree data structure for representing simplicial complexes.
Definition: Simplex_tree.h:75
Structure representing the coefficient field .
Definition: Field_Zp.h:26
Computes the persistent cohomology of a filtered complex.
Definition: Persistent_cohomology.h:52
Definition: Simplex_tree.h:1752
Handle type for the vertices of a cell complex.
Definition: VertexHandle.h:15