public class MinkowskiDistanceMetric extends Object implements DistanceMetric
ManhattanDistanceMetric
, EuclideanDistanceMetric
. This class is
useful for high exponents.
http://en.wikipedia.org/wiki/Minkowski_distance
,
Serialized FormConstructor and Description |
---|
MinkowskiDistanceMetric(double p) |
Modifier and Type | Method and Description |
---|---|
static MinkowskiDistanceMetric |
apply(double p) |
double |
distance(Vector a,
Vector b)
Returns the distance between the arguments.
|
double |
p() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkValidArguments
public static MinkowskiDistanceMetric apply(double p)
public double p()
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.