Trait renforce::util::Metric [] [src]

pub trait Metric {
    fn dist2(x: &Self, y: &Self) -> f64;

    fn dist(x: &Self, y: &Self) -> f64 { ... }
}

A type with a notion of distance The distance function should satisfy the triangle inequality (and the other metric properties)

d(x,z) <= d(x,y) + d(y,z)

Required Methods

Returns the squared distance between x and y

Provided Methods

Returns the distance between x and y

Implementors