public class SquaredEuclideanDistanceMetric extends Object implements DistanceMetric
EuclideanDistanceMetric
but it does not take the square root.
The value calculated by this class is not exact Euclidean distance, but it saves on computation when you need the value for only comparison.
Constructor and Description |
---|
SquaredEuclideanDistanceMetric() |
Modifier and Type | Method and Description |
---|---|
static SquaredEuclideanDistanceMetric |
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 SquaredEuclideanDistanceMetric apply()
public double distance(Vector a, Vector b)
DistanceMetric
distance
in interface DistanceMetric
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.