[][src]Trait acap::distance::Distance

pub trait Distance where
    Self: Copy,
    Self: Into<Self::Value>,
    Self: PartialOrd<Self::Value>,
    Self::Value: PartialOrd<Self>,
    Self: PartialOrd
{ type Value: Value; fn value(self) -> Self::Value { ... } }

A distance between two points.

An implementation may be an actual numerical distance, or an order embedding of the true distance. This allows for optimizations whenever distances can be compared more efficiently than their exact values can be computed, as is the case for Euclidean distance. Implementors must satisfy, for all distances x and y:

  • x < y iff x.value() < y.value()
  • x.value() < y iff x.value() < y.value()
  • x < y.value() iff x.value() < y.value()

Associated Types

type Value: Value

The type of actual numerical distances.

Loading content...

Provided methods

fn value(self) -> Self::Value

Get the real numerical value of this distance.

Loading content...

Implementors

impl Distance for EuclideanDistance<f32>[src]

type Value = f32

impl Distance for EuclideanDistance<f64>[src]

type Value = f64

impl Distance for EuclideanDistance<i16>[src]

type Value = f32

impl Distance for EuclideanDistance<i32>[src]

type Value = f32

impl Distance for EuclideanDistance<i64>[src]

type Value = f64

impl Distance for EuclideanDistance<isize>[src]

type Value = f64

impl<T: Value> Distance for T[src]

Any numerical distance value can be a Distance.

type Value = T

Loading content...