Top Description Methods
org.apache.commons.math3.ml.distance

public Interface DistanceMeasure

extends Serializable
Known Direct Implementers
org.apache.commons.math3.ml.distance.EarthMoversDistance, org.apache.commons.math3.ml.distance.EuclideanDistance, org.apache.commons.math3.ml.distance.ManhattanDistance, org.apache.commons.math3.ml.distance.CanberraDistance, org.apache.commons.math3.ml.distance.ChebyshevDistance
Imports
java.io.Serializable, org.apache.commons.math3.exception.DimensionMismatchException

Interface for distance measures of n-dimensional vectors.
Since
3.2

Method Summary

Modifier and TypeMethod and Description
public double

Returns:

the distance between the two vectors
compute
(double[]
the first vector
a
,
double[]
the second vector
b
)

Compute the distance between two n-dimensional vectors.

Method Detail

computeback to summary
public double compute(double[] a, double[] b) throws DimensionMismatchException

Compute the distance between two n-dimensional vectors.

The two vectors are required to have the same dimension.

Parameters
a:double[]

the first vector

b:double[]

the second vector

Returns:double

the distance between the two vectors

Exceptions
DimensionMismatchException:
if the array lengths differ.