Interface Distance<T>

  • All Superinterfaces:
    java.io.Serializable
    All Known Subinterfaces:
    Metric<T>

    public interface Distance<T>
    extends java.io.Serializable
    An interface to calculate a distance measure between two objects. A distance function maps pairs of points into the nonnegative reals and has to satisfy
    • non-negativity: d(x, y) ≥ 0
    • isolation: d(x, y) = 0 if and only if x = y
    • symmetry: d(x, y) = d(x, y)
    . Note that a distance function is not required to satisfy triangular inequality |x - y| + |y - z| ≥ |x - z|, which is necessary for a metric.
    Author:
    Haifeng Li
    • Method Detail

      • d

        double d​(T x,
                 T y)
        Returns the distance measure between two objects.