de.lmu.ifi.dbs.elki.distance.distancefunction
Class LPNormDistanceFunction<V extends NumberVector<V,N>,N extends Number>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<V,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.distancefunction.LPNormDistanceFunction<V,N>
- Type Parameters:
V
- the type of FeatureVector to compute the distances in betweenN
- 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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
LPNormDistanceFunction
public LPNormDistanceFunction(Parameterization config)
- Constructor, adhering to
Parameterizable
- Parameters:
config
- Parameterization
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 FeatureVectorv2
- second FeatureVector
- Returns:
- the distance between the specified FeatureVectors as a LP-Norm for
the currently set p