pub struct MapperGraph {
pub nodes: Vec<MapperNode>,
pub edges: Vec<(usize, usize)>,
}Expand description
Mapper graph: nodes (clusters) connected when adjacent cover intervals share common points.
Implements a simplified version of the Mapper algorithm:
- Cover the filter function range with overlapping intervals.
- Restrict the point cloud to each interval.
- Cluster each restriction (here: single-linkage at
cluster_eps). - Connect clusters from adjacent intervals that share points.
Fields§
§nodes: Vec<MapperNode>Nodes of the graph.
edges: Vec<(usize, usize)>Edges between nodes: (node_i, node_j).
Implementations§
Source§impl MapperGraph
impl MapperGraph
Sourcepub fn build(
points: &[[f64; 2]],
filter_values: &[f64],
n_intervals: usize,
overlap: f64,
cluster_eps: f64,
) -> Self
pub fn build( points: &[[f64; 2]], filter_values: &[f64], n_intervals: usize, overlap: f64, cluster_eps: f64, ) -> Self
Build a MapperGraph from a point cloud using a 1-D filter function.
§Parameters
points: 2-D point cloud.filter_values: scalar filter value for each point (e.g., x-coordinate).n_intervals: number of cover intervals.overlap: fractional overlap between adjacent intervals (in [0, 1)).cluster_eps: distance threshold for single-linkage clustering within each cover interval.
Sourcepub fn total_point_count(&self) -> usize
pub fn total_point_count(&self) -> usize
Total number of points across all nodes (with possible duplicates from overlap).
Trait Implementations§
Source§impl Clone for MapperGraph
impl Clone for MapperGraph
Source§fn clone(&self) -> MapperGraph
fn clone(&self) -> MapperGraph
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MapperGraph
impl Debug for MapperGraph
Source§impl Default for MapperGraph
impl Default for MapperGraph
Source§fn default() -> MapperGraph
fn default() -> MapperGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MapperGraph
impl RefUnwindSafe for MapperGraph
impl Send for MapperGraph
impl Sync for MapperGraph
impl Unpin for MapperGraph
impl UnsafeUnpin for MapperGraph
impl UnwindSafe for MapperGraph
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<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.