pub struct LpDist<F: Float>(pub F);Expand description
L-p or Minkowsky distance
Tuple Fields§
§0: FImplementations§
Trait Implementations§
Source§impl<F: Float> Distance<F> for LpDist<F>
impl<F: Float> Distance<F> for LpDist<F>
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 distanceSource§fn dist_to_rdist(&self, dist: F) -> F
fn dist_to_rdist(&self, dist: F) -> F
Converts the result of
distance to rdistanceimpl<F: Float> StructuralPartialEq for LpDist<F>
Auto Trait Implementations§
impl<F> Freeze for LpDist<F>where
F: Freeze,
impl<F> RefUnwindSafe for LpDist<F>where
F: RefUnwindSafe,
impl<F> Send for LpDist<F>
impl<F> Sync for LpDist<F>
impl<F> Unpin for LpDist<F>
impl<F> UnwindSafe for LpDist<F>where
F: 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
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