Interface DistanceMeasure
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
CanberraDistance,ChebyshevDistance,EarthMoversDistance,EuclideanDistance,ManhattanDistance
public interface DistanceMeasure extends java.io.SerializableInterface for distance measures of n-dimensional vectors.- Since:
- 3.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description doublecompute(double[] a, double[] b)Compute the distance between two n-dimensional vectors.
-
-
-
Method Detail
-
compute
double compute(double[] a, double[] b) throws DimensionMismatchExceptionCompute the distance between two n-dimensional vectors.The two vectors are required to have the same dimension.
- Parameters:
a- the first vectorb- the second vector- Returns:
- the distance between the two vectors
- Throws:
DimensionMismatchException- if the array lengths differ.
-
-