de.lmu.ifi.dbs.elki.distance.distancefunction
Class WeightedLPNormDistanceFunction

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.LPNormDistanceFunction
              extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.LPNormDistanceFunction
LPNormDistanceFunction.Parameterizer
 
Field Summary
protected  double[] weights
          Weight array
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.LPNormDistanceFunction
P_ID
 
Constructor Summary
WeightedLPNormDistanceFunction(double p, double[] weights)
          Constructor.
 
Method Summary
 double doubleDistance(NumberVector<?,?> v1, NumberVector<?,?> v2)
          Returns the distance between the specified FeatureVectors as a LP-Norm for the currently set p.
 boolean equals(Object obj)
           
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.LPNormDistanceFunction
getP, isMetric, toString
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
distance, getDistanceFactory, getInputTypeRestriction
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction
instantiate, isSymmetric
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
instantiate, isSymmetric
 

Field Detail

weights

protected double[] weights
Weight array

Constructor Detail

WeightedLPNormDistanceFunction

public WeightedLPNormDistanceFunction(double p,
                                      double[] weights)
Constructor.

Parameters:
p - p value
weights - Weight vector
Method Detail

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 FeatureVector
v2 - 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

Release 0.4.0 (2011-09-20_1324)