@PublicationReference(title="Minkowski Distance", author="Wikipedia", year=2011, type=WebPage, url="http://en.wikipedia.org/wiki/Minkowski_distance") public class MinkowskiDistanceMetric extends AbstractCloneableSerializable implements Metric<Vectorizable>
ChebyshevDistanceMetric.| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_POWER
The default power is 2.0.
|
protected double |
power
The power that the distance is computed to.
|
| Constructor and Description |
|---|
MinkowskiDistanceMetric()
Creates a new
MinkowskiDistanceMetric with the default power of
2.0. |
MinkowskiDistanceMetric(double power)
Creates a new
MinkowskiDistanceMetric with the given power. |
| Modifier and Type | Method and Description |
|---|---|
double |
evaluate(Vectorizable first,
Vectorizable second)
Evaluates the divergence between the two given objects.
|
double |
getPower()
Gets the power used for the distance.
|
void |
setPower(double power)
Sets the power used for the distance.
|
clonepublic static final double DEFAULT_POWER
protected double power
public MinkowskiDistanceMetric()
MinkowskiDistanceMetric with the default power of
2.0.public MinkowskiDistanceMetric(double power)
MinkowskiDistanceMetric with the given power.power - The power for the distance metric. Must be positive.public double evaluate(Vectorizable first, Vectorizable second)
DivergenceFunctionevaluate in interface DivergenceFunction<Vectorizable,Vectorizable>first - The first object.second - The second object.public double getPower()
public void setPower(double power)
power - The power used for the distance. Must be positive.