public interface Distance<T>
extends java.util.function.ToDoubleBiFunction<T,T>, java.io.Serializable
d(x, y) ≥ 0
d(x, y) = 0
if and only if x = y
d(x, y) = d(x, y)
|x - y| + |y - z| ≥ |x - z|
, which is necessary for a metric.Modifier and Type | Method and Description |
---|---|
default double |
apply(T x,
T y)
Returns the distance measure between two objects.
|
default double |
applyAsDouble(T x,
T y) |
default Matrix |
D(T[] x)
Returns the pairwise distance matrix.
|
default Matrix |
D(T[] x,
T[] y)
Returns the pairwise distance matrix.
|
double |
d(T x,
T y)
Returns the distance measure between two objects.
|
default double apply(T x, T y)
default Matrix D(T[] x)
x
- samples.