pub struct PersistentHomology {
pub filtration: Vec<(f64, Vec<usize>)>,
}Expand description
Persistent homology computed from a filtered simplicial complex.
The filtration is a sequence of (threshold, simplex) pairs in increasing
order of threshold, representing the birth time of each simplex.
Fields§
§filtration: Vec<(f64, Vec<usize>)>Filtration: list of (birth_time, simplex) pairs.
Implementations§
Source§impl PersistentHomology
impl PersistentHomology
Sourcepub fn new(filtration: Vec<(f64, Vec<usize>)>) -> Self
pub fn new(filtration: Vec<(f64, Vec<usize>)>) -> Self
Create a new PersistentHomology from a filtration.
Sourcepub fn compute_barcode(&self) -> Vec<(usize, f64, f64)>
pub fn compute_barcode(&self) -> Vec<(usize, f64, f64)>
Compute the persistence barcode.
Returns a list of (dimension, birth, death) tuples.
Features that never die get death = f64::INFINITY.
Sourcepub fn compute_diagram(&self) -> Vec<(usize, f64, f64)>
pub fn compute_diagram(&self) -> Vec<(usize, f64, f64)>
Compute the persistence diagram.
Returns (dimension, birth, death) triples using the standard
boundary-matrix reduction algorithm (over ℤ/2ℤ).
Sourcepub fn total_persistence(&self) -> f64
pub fn total_persistence(&self) -> f64
Total persistence: sum of lifetimes Σ |death - birth| (finite bars only).
Sourcepub fn bottleneck_distance(&self, other: &Self) -> f64
pub fn bottleneck_distance(&self, other: &Self) -> f64
Bottleneck distance between two persistence diagrams.
Uses the greedy matching approximation over finite bars.
Trait Implementations§
Source§impl Clone for PersistentHomology
impl Clone for PersistentHomology
Source§fn clone(&self) -> PersistentHomology
fn clone(&self) -> PersistentHomology
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PersistentHomology
impl RefUnwindSafe for PersistentHomology
impl Send for PersistentHomology
impl Sync for PersistentHomology
impl Unpin for PersistentHomology
impl UnsafeUnpin for PersistentHomology
impl UnwindSafe for PersistentHomology
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.