Struct smartcore::metrics::distance::PairwiseDistance
source · pub struct PairwiseDistance<T: RealNumber> {
pub node: usize,
pub neighbour: Option<usize>,
pub distance: Option<T>,
}
Expand description
Pairwise dissimilarities.
Representing distances as pairwise dissimilarities, so to build a
graph of closest neighbours. This representation can be reused for
different implementations
(initially used in this library for FastPair).
The edge of the subgraph is defined by PairwiseDistance
.
The calling algorithm can store a list of distances as
a list of these structures.
Fields§
§node: usize
index of the vector in the original Matrix
or list
neighbour: Option<usize>
index of the closest neighbor in the original Matrix
or same list
distance: Option<T>
measure of distance, according to the algorithm distance function if the distance is None, the edge has value “infinite” or max distance each algorithm has to match
Trait Implementations§
source§impl<T: Clone + RealNumber> Clone for PairwiseDistance<T>
impl<T: Clone + RealNumber> Clone for PairwiseDistance<T>
source§fn clone(&self) -> PairwiseDistance<T>
fn clone(&self) -> PairwiseDistance<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug + RealNumber> Debug for PairwiseDistance<T>
impl<T: Debug + RealNumber> Debug for PairwiseDistance<T>
source§impl<T: RealNumber> PartialEq<PairwiseDistance<T>> for PairwiseDistance<T>
impl<T: RealNumber> PartialEq<PairwiseDistance<T>> for PairwiseDistance<T>
source§impl<T: RealNumber> PartialOrd<PairwiseDistance<T>> for PairwiseDistance<T>
impl<T: RealNumber> PartialOrd<PairwiseDistance<T>> for PairwiseDistance<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Copy + RealNumber> Copy for PairwiseDistance<T>
impl<T: RealNumber> Eq for PairwiseDistance<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for PairwiseDistance<T>where T: RefUnwindSafe,
impl<T> Send for PairwiseDistance<T>where T: Send,
impl<T> Sync for PairwiseDistance<T>where T: Sync,
impl<T> Unpin for PairwiseDistance<T>where T: Unpin,
impl<T> UnwindSafe for PairwiseDistance<T>where T: UnwindSafe,
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