public class WeightedMinkowskiDistance extends Object implements DistanceMeasure
Constructor and Description |
---|
WeightedMinkowskiDistance(int p,
double[] weights) |
Modifier and Type | Method and Description |
---|---|
double |
compute(Vector a,
Vector b)
Compute the distance between two n-dimensional vectors.
|
boolean |
equals(Object obj) |
int |
getP()
Returns p-norm.
|
double[] |
getWeights()
Returns weights.
|
int |
hashCode() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, readExternal, writeExternal
public WeightedMinkowskiDistance(int p, double[] weights)
public double compute(Vector a, Vector b) throws CardinalityException
The two vectors are required to have the same dimension.
compute
in interface DistanceMeasure
a
- The first vector.b
- The second vector.CardinalityException
- if the array lengths differ.public int getP()
public double[] getWeights()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.0 Release Date : September 11 2021