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 for PairwiseDistance<T>
impl<T: RealNumber> PartialEq for PairwiseDistance<T>
Source§impl<T: RealNumber> PartialOrd for PairwiseDistance<T>
impl<T: RealNumber> PartialOrd for PairwiseDistance<T>
impl<T: Copy + RealNumber> Copy for PairwiseDistance<T>
impl<T: RealNumber> Eq for PairwiseDistance<T>
Auto Trait Implementations§
impl<T> Freeze for PairwiseDistance<T>where
T: Freeze,
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