pub struct L1Dist;
Expand description
L1 or Manhattan distance
Trait Implementations§
source§impl<F: Float> Distance<F> for L1Dist
impl<F: Float> Distance<F> for L1Dist
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
source§impl PartialEq for L1Dist
impl PartialEq for L1Dist
impl Eq for L1Dist
impl StructuralEq for L1Dist
impl StructuralPartialEq for L1Dist
Auto Trait Implementations§
impl RefUnwindSafe for L1Dist
impl Send for L1Dist
impl Sync for L1Dist
impl Unpin for L1Dist
impl UnwindSafe for L1Dist
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<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.