pub struct DistanceMatrix { /* private fields */ }Expand description
Symmetric dissimilarity matrix. No metric assumptions: entries need not satisfy the triangle inequality. Entries must be non-negative and not NaN; +inf is legal and equivalent to an absent edge.
The matrix has two storage forms. The compact form holds the condensed
lower triangle, n(n-1)/2 entries, and is the form every constructor
builds. The full form holds both triangles row-major, n * n entries,
so that a cofacet diameter fold reads one contiguous row per simplex
vertex instead of one strided column.
Implementations§
Source§impl DistanceMatrix
impl DistanceMatrix
Sourcepub fn from_points(points: &[Vec<f64>]) -> Result<Self>
pub fn from_points(points: &[Vec<f64>]) -> Result<Self>
Euclidean distances of a point cloud. Coordinates must be finite.
Sourcepub fn from_condensed(condensed: Vec<f64>) -> Result<Self>
pub fn from_condensed(condensed: Vec<f64>) -> Result<Self>
Build from the condensed lower triangle, row by row: d(1,0), d(2,0),
d(2,1), d(3,0), and so on. An empty vector means one point (n = 1).
Only DistanceMatrix::from_points can build an empty space
(n = 0).
Source§impl DistanceMatrix
impl DistanceMatrix
Trait Implementations§
Source§impl Clone for DistanceMatrix
impl Clone for DistanceMatrix
Source§fn clone(&self) -> DistanceMatrix
fn clone(&self) -> DistanceMatrix
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 DistanceMatrix
impl RefUnwindSafe for DistanceMatrix
impl Send for DistanceMatrix
impl Sync for DistanceMatrix
impl Unpin for DistanceMatrix
impl UnsafeUnpin for DistanceMatrix
impl UnwindSafe for DistanceMatrix
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<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> ⓘ
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> ⓘ
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 more