public class EuclideanDistanceMetric extends SquaredEuclideanDistanceMetric
http://en.wikipedia.org/wiki/Euclidean_distance
If you don't care about the true distance and only need for comparison,
SquaredEuclideanDistanceMetric
will be faster because it doesn't calculate the actual
square root of the distances.
http://en.wikipedia.org/wiki/Euclidean_distance
,
Serialized FormConstructor and Description |
---|
EuclideanDistanceMetric() |
Modifier and Type | Method and Description |
---|---|
static EuclideanDistanceMetric |
apply() |
double |
distance(Vector a,
Vector b)
Returns the distance between the arguments.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkValidArguments
public static EuclideanDistanceMetric apply()
public double distance(Vector a, Vector b)
DistanceMetric
distance
in interface DistanceMetric
distance
in class SquaredEuclideanDistanceMetric
a
- a Vector defining a multi-dimensional point in some spaceb
- a Vector defining a multi-dimensional point in some spaceCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.