pub struct L2Dist;
Expand description
L2 or Euclidean distance
Trait Implementations§
Source§impl<F: Float> Distance<F> for L2Dist
impl<F: Float> Distance<F> for L2Dist
Source§fn distance<D: Dimension>(
&self,
a: ArrayView<'_, F, D>,
b: ArrayView<'_, F, D>,
) -> F
fn distance<D: Dimension>( &self, a: ArrayView<'_, F, D>, b: ArrayView<'_, F, D>, ) -> F
Computes the distance between two points. For most spatial algorithms to work correctly,
this metric must satisfy the Triangle Inequality. Read more
Source§fn rdistance<D: Dimension>(
&self,
a: ArrayView<'_, F, D>,
b: ArrayView<'_, F, D>,
) -> F
fn rdistance<D: Dimension>( &self, a: ArrayView<'_, F, D>, b: ArrayView<'_, F, D>, ) -> F
A faster version of the distance metric that keeps the order of the distance function. That
is,
dist(a, b) > dist(c, d)
implies rdist(a, b) > rdist(c, d)
. For most algorithms this
is the same as distance
. Unlike distance
, this function does not need to satisfy
the Triangle Inequality.Source§fn rdist_to_dist(&self, rdist: F) -> F
fn rdist_to_dist(&self, rdist: F) -> F
Converts the result of
rdistance
to distance
Source§fn dist_to_rdist(&self, dist: F) -> F
fn dist_to_rdist(&self, dist: F) -> F
Converts the result of
distance
to rdistance
impl Eq for L2Dist
impl StructuralPartialEq for L2Dist
Auto Trait Implementations§
impl Freeze for L2Dist
impl RefUnwindSafe for L2Dist
impl Send for L2Dist
impl Sync for L2Dist
impl Unpin for L2Dist
impl UnwindSafe for L2Dist
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.