pub struct PointCloud {
pub points: Vec<Vec<f64>>,
pub distance_matrix: Vec<Vec<f64>>,
}Expand description
A set of points in Euclidean space with a precomputed distance matrix.
Fields§
§points: Vec<Vec<f64>>§distance_matrix: Vec<Vec<f64>>Implementations§
Source§impl PointCloud
impl PointCloud
Sourcepub fn new(points: Vec<Vec<f64>>) -> Result<Self, PersistenceError>
pub fn new(points: Vec<Vec<f64>>) -> Result<Self, PersistenceError>
Build a point cloud, computing the pairwise Euclidean distance matrix.
pub fn n_points(&self) -> usize
pub fn dimension(&self) -> usize
Sourcepub fn knn(&self, k: usize) -> Result<Vec<Vec<usize>>, PersistenceError>
pub fn knn(&self, k: usize) -> Result<Vec<Vec<usize>>, PersistenceError>
k-nearest-neighbor graph: returns for each point the indices of its k nearest neighbors (excluding itself), sorted by distance ascending.
Sourcepub fn max_distance(&self) -> f64
pub fn max_distance(&self) -> f64
Maximum pairwise distance in the cloud.
Sourcepub fn unique_distances(&self) -> Vec<f64>
pub fn unique_distances(&self) -> Vec<f64>
Return the sorted list of unique pairwise distances (filtration thresholds).
Trait Implementations§
Source§impl Clone for PointCloud
impl Clone for PointCloud
Source§fn clone(&self) -> PointCloud
fn clone(&self) -> PointCloud
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 moreAuto Trait Implementations§
impl Freeze for PointCloud
impl RefUnwindSafe for PointCloud
impl Send for PointCloud
impl Sync for PointCloud
impl Unpin for PointCloud
impl UnsafeUnpin for PointCloud
impl UnwindSafe for PointCloud
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