pub struct PersistenceDiagram {
pub points: Vec<PersistencePoint>,
pub max_dimension: usize,
}Expand description
Persistence diagram: a collection of (birth, death) pairs per dimension.
A persistence diagram captures the topological features of a dataset across all scales, organized by homological dimension.
Fields§
§points: Vec<PersistencePoint>All persistence points across all dimensions
max_dimension: usizeMaximum homological dimension computed
Implementations§
Source§impl PersistenceDiagram
impl PersistenceDiagram
Sourcepub fn add_point(&mut self, birth: f64, death: f64, dimension: usize)
pub fn add_point(&mut self, birth: f64, death: f64, dimension: usize)
Add a persistence point to the diagram
Sourcepub fn points_in_dimension(&self, dim: usize) -> Vec<&PersistencePoint>
pub fn points_in_dimension(&self, dim: usize) -> Vec<&PersistencePoint>
Get all points in a specific homological dimension
Sourcepub fn finite_points(&self) -> Vec<&PersistencePoint>
pub fn finite_points(&self) -> Vec<&PersistencePoint>
Get all finite persistence points (non-essential features)
Sourcepub fn essential_points(&self) -> Vec<&PersistencePoint>
pub fn essential_points(&self) -> Vec<&PersistencePoint>
Get all essential points (infinite persistence)
Sourcepub fn total_persistence(&self, p: f64) -> f64
pub fn total_persistence(&self, p: f64) -> f64
Compute the total persistence (sum of all finite persistence values)
Sourcepub fn filter_by_persistence(&self, min_persistence: f64) -> PersistenceDiagram
pub fn filter_by_persistence(&self, min_persistence: f64) -> PersistenceDiagram
Filter points by minimum persistence threshold
Sourcepub fn to_barcode(&self) -> Barcode
pub fn to_barcode(&self) -> Barcode
Convert to barcode representation
Sourcepub fn betti_numbers_at(&self, filtration_value: f64) -> Vec<usize>
pub fn betti_numbers_at(&self, filtration_value: f64) -> Vec<usize>
Get the Betti numbers (count of features) at a given filtration value
Trait Implementations§
Source§impl Clone for PersistenceDiagram
impl Clone for PersistenceDiagram
Source§fn clone(&self) -> PersistenceDiagram
fn clone(&self) -> PersistenceDiagram
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PersistenceDiagram
impl RefUnwindSafe for PersistenceDiagram
impl Send for PersistenceDiagram
impl Sync for PersistenceDiagram
impl Unpin for PersistenceDiagram
impl UnsafeUnpin for PersistenceDiagram
impl UnwindSafe for PersistenceDiagram
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.