pub struct VietorisRips {
pub points: Vec<[f64; 2]>,
pub epsilon: f64,
}Expand description
Vietoris–Rips complex construction from a 2-D point cloud.
The complex includes all simplices (vertices, edges, triangles) whose
maximum pairwise distance is at most epsilon.
Fields§
§points: Vec<[f64; 2]>The 2-D point cloud.
epsilon: f64Maximum edge length (epsilon radius).
Implementations§
Source§impl VietorisRips
impl VietorisRips
Sourcepub fn new(points: Vec<[f64; 2]>, epsilon: f64) -> Self
pub fn new(points: Vec<[f64; 2]>, epsilon: f64) -> Self
Create a new VietorisRips complex from a point cloud with radius epsilon.
Sourcepub fn edges(&self) -> Vec<(usize, usize, f64)>
pub fn edges(&self) -> Vec<(usize, usize, f64)>
All edges (pairs) within epsilon distance.
Returns a list of (i, j, distance) tuples.
Sourcepub fn triangles(&self) -> Vec<(usize, usize, usize)>
pub fn triangles(&self) -> Vec<(usize, usize, usize)>
All triangles (triples) where every pair is within epsilon.
Returns a list of (i, j, k) index triples.
Sourcepub fn n_vertices(&self) -> usize
pub fn n_vertices(&self) -> usize
Number of vertices (all points are 0-simplices).
Sourcepub fn n_triangles(&self) -> usize
pub fn n_triangles(&self) -> usize
Number of triangles (2-simplices) within epsilon.
Sourcepub fn euler_characteristic(&self) -> i64
pub fn euler_characteristic(&self) -> i64
Euler characteristic χ = V − E + F.
Sourcepub fn betti_numbers(&self) -> BettiNumbers
pub fn betti_numbers(&self) -> BettiNumbers
Betti numbers via the Euler formula and a union-find for β₀.
β₀ is the number of connected components. β₁ is estimated as β₁ = E − V + β₀ (first Betti number from spanning tree). β₂ is estimated from the Euler characteristic.
Sourcepub fn persistent_h0(&self) -> Vec<PersistentInterval>
pub fn persistent_h0(&self) -> Vec<PersistentInterval>
Compute the 0-dimensional persistent homology (H₀) via Kruskal.
Trait Implementations§
Source§impl Clone for VietorisRips
impl Clone for VietorisRips
Source§fn clone(&self) -> VietorisRips
fn clone(&self) -> VietorisRips
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 VietorisRips
impl RefUnwindSafe for VietorisRips
impl Send for VietorisRips
impl Sync for VietorisRips
impl Unpin for VietorisRips
impl UnsafeUnpin for VietorisRips
impl UnwindSafe for VietorisRips
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.