pub struct SparseDistanceMatrix { /* private fields */ }Expand description
Sparse dissimilarities: only listed pairs have finite distance. An
unlisted pair is an absent edge (+inf). No metric assumptions, same
entry rules as DistanceMatrix.
The neighbor lists live in one compressed block: an offset for each
vertex, then the neighbor vertices as u32 and their distances in two
arrays of the same length. A list is sorted by neighbor vertex. The
cofacet merge then walks four bytes an entry and reads a distance only
where two lists meet.
Implementations§
Source§impl SparseDistanceMatrix
impl SparseDistanceMatrix
Sourcepub fn from_triplets(n: usize, triplets: &[(usize, usize, f64)]) -> Result<Self>
pub fn from_triplets(n: usize, triplets: &[(usize, usize, f64)]) -> Result<Self>
Build from (i, j, d) triplets over n points. A repeated unordered
pair must carry an identical distance. Entries must be finite and
non-negative. Omit a pair to make it absent. n must be at or below
u32::MAX.
Trait Implementations§
Source§impl Clone for SparseDistanceMatrix
impl Clone for SparseDistanceMatrix
Source§fn clone(&self) -> SparseDistanceMatrix
fn clone(&self) -> SparseDistanceMatrix
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 SparseDistanceMatrix
impl RefUnwindSafe for SparseDistanceMatrix
impl Send for SparseDistanceMatrix
impl Sync for SparseDistanceMatrix
impl Unpin for SparseDistanceMatrix
impl UnsafeUnpin for SparseDistanceMatrix
impl UnwindSafe for SparseDistanceMatrix
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 more