T
- the generic type on which the metric is definedpublic abstract class DistanceMetric<T> extends Object
T
.Constructor and Description |
---|
DistanceMetric() |
Modifier and Type | Method and Description |
---|---|
abstract double |
getDistance(T o1,
T o2)
Returns the distance according to the metric of the two supplied objects.
|
static <T> double[][] |
getPairwiseDistanceMatrix(DistanceMetric<T> metric,
T... objects)
Returns the matrix of all pairwise distance of the supplied objects, where rows and colums are indexed in the order
of the supplied objects.
|
public abstract double getDistance(T o1, T o2) throws Exception
o1
- the first objecto2
- the second objectException
- if the distance could not be computedpublic static <T> double[][] getPairwiseDistanceMatrix(DistanceMetric<T> metric, T... objects) throws Exception
T
- the generic type on which the metric is definedmetric
- the metricobjects
- the objectsException
- if the distance could not be computed for one pair of objects