pulsatrix 1.1.0
Loading...
Searching...
No Matches
persistence_diagram.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <cstdint>
9#include <limits>
10#include <vector>
11
12namespace pulsatrix {
13
17 double birth = 0;
20 double death = std::numeric_limits<double>::infinity();
21
23 [[nodiscard]] double persistence() const { return death - birth; }
25 [[nodiscard]] bool essential() const { return death == std::numeric_limits<double>::infinity(); }
26};
27
34 int dimension = 0;
36 std::vector<PersistencePair> pairs;
42 double error_bound = 0;
43
45 [[nodiscard]] int64_t essential_count() const {
46 int64_t count = 0;
47 for (const PersistencePair& p : pairs) count += p.essential() ? 1 : 0;
48 return count;
49 }
50};
51
52} // namespace pulsatrix
Definition acquisition_functions.hpp:16
The features of one homology dimension: H0 for components, H1 for loops, H2 for voids.
Definition persistence_diagram.hpp:32
double error_bound
A bound on how far this diagram can be, in bottleneck distance, from the one the exact distances woul...
Definition persistence_diagram.hpp:42
std::vector< PersistencePair > pairs
The features, finite ones by increasing death, then by birth; essential ones last.
Definition persistence_diagram.hpp:36
int dimension
The homology dimension.
Definition persistence_diagram.hpp:34
int64_t essential_count() const
The number of essential features: the Betti number at the largest scale.
Definition persistence_diagram.hpp:45
One feature of a persistence diagram.
Definition persistence_diagram.hpp:15
double birth
The scale at which the feature appears.
Definition persistence_diagram.hpp:17
bool essential() const
Whether it never dies.
Definition persistence_diagram.hpp:25
double persistence() const
death - birth: how long it lasts; infinity for an essential feature.
Definition persistence_diagram.hpp:23
double death
The scale at which it disappears; infinity for a feature that never does, such as the one component l...
Definition persistence_diagram.hpp:20