de.lmu.ifi.dbs.elki.distance.distancefunction
Class WeightedLPNormDistanceFunction
java.lang.Object
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
de.lmu.ifi.dbs.elki.distance.distancefunction.LPNormDistanceFunction
de.lmu.ifi.dbs.elki.distance.distancefunction.WeightedLPNormDistanceFunction
- All Implemented Interfaces:
- DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable
public class WeightedLPNormDistanceFunction
- extends LPNormDistanceFunction
Weighted version of the Euclidean distance function.
Field Summary |
protected double[] |
weights
Weight array |
weights
protected double[] weights
- Weight array
WeightedLPNormDistanceFunction
public WeightedLPNormDistanceFunction(double p,
double[] weights)
- Constructor.
- Parameters:
p
- p valueweights
- Weight vector
doubleDistance
public double doubleDistance(NumberVector<?,?> v1,
NumberVector<?,?> v2)
- Description copied from class:
LPNormDistanceFunction
- Returns the distance between the specified FeatureVectors as a LP-Norm for
the currently set p.
- Specified by:
doubleDistance
in interface PrimitiveDoubleDistanceFunction<NumberVector<?,?>>
- Overrides:
doubleDistance
in class LPNormDistanceFunction
- Parameters:
v1
- first FeatureVectorv2
- second FeatureVector
- Returns:
- the distance between the specified FeatureVectors as a LP-Norm for
the currently set p
equals
public boolean equals(Object obj)
- Overrides:
equals
in class LPNormDistanceFunction