Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction
Class LPNormDistanceFunction<V extends NumberVector<V,N>,N extends Number>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<V,DoubleDistance>
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.LPNormDistanceFunction<V,N>
Type Parameters:
V - the type of FeatureVector to compute the distances in between
N - number type TODO: implement SpatialDistanceFunction
All Implemented Interfaces:
DistanceFunction<V,DoubleDistance>, MeasurementFunction<V,DoubleDistance>, Parameterizable

public class LPNormDistanceFunction<V extends NumberVector<V,N>,N extends Number>
extends AbstractDistanceFunction<V,DoubleDistance>

Provides a LP-Norm for FeatureVectors.

Author:
Arthur Zimek

Field Summary
private  double p
          Keeps the currently set p.
static OptionID P_ID
          OptionID for P_PARAM
private  DoubleParameter P_PARAM
          P parameter
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
distanceFactory
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
LPNormDistanceFunction(Parameterization config)
          Constructor, adhering to Parameterizable
 
Method Summary
 DoubleDistance distance(V v1, V v2)
          Returns the distance between the specified FeatureVectors as a LP-Norm for the currently set p.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction
distance, distance
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
getDatabase, getDistanceFactory, infiniteDistance, nullDistance, setDatabase, undefinedDistance, valueOf
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction
getDistanceFactory, infiniteDistance, nullDistance, setDatabase, undefinedDistance, valueOf
 

Field Detail

P_ID

public static final OptionID P_ID
OptionID for P_PARAM


P_PARAM

private final DoubleParameter P_PARAM
P parameter


p

private double p
Keeps the currently set p.

Constructor Detail

LPNormDistanceFunction

public LPNormDistanceFunction(Parameterization config)
Constructor, adhering to Parameterizable

Parameters:
config - Parameterization
Method Detail

distance

public DoubleDistance distance(V v1,
                               V v2)
Returns the distance between the specified FeatureVectors as a LP-Norm for the currently set p.

Parameters:
v1 - first FeatureVector
v2 - second FeatureVector
Returns:
the distance between the specified FeatureVectors as a LP-Norm for the currently set p

Release 0.3 (2010-03-31_1612)