
public class WeightedSquaredEuclideanDistanceFunction extends AbstractVectorDoubleDistanceFunction
| Modifier and Type | Field and Description |
|---|---|
protected double[] |
weights
Weight array
|
| Constructor and Description |
|---|
WeightedSquaredEuclideanDistanceFunction(double[] weights)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
doubleDistance(NumberVector<?,?> v1,
NumberVector<?,?> v2)
Provides the squared Euclidean distance between the given two vectors.
|
boolean |
equals(Object obj) |
boolean |
isMetric()
Is this distance function metric (in particular, does it satisfy the
triangle equation?)
|
distance, getDistanceFactory, getInputTypeRestrictioninstantiate, isSymmetricclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinstantiate, isSymmetricpublic WeightedSquaredEuclideanDistanceFunction(double[] weights)
weights - public double doubleDistance(NumberVector<?,?> v1, NumberVector<?,?> v2)
v1 - first Objectv2 - second Objectpublic boolean isMetric()
DistanceFunctionisMetric in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>isMetric in class AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>true when metric.