
public class LPNormDistanceFunction extends AbstractVectorDoubleDistanceFunction
| Modifier and Type | Class and Description |
|---|---|
static class |
LPNormDistanceFunction.Parameterizer
Parameterization class.
|
| Modifier and Type | Field and Description |
|---|---|
private double |
p
Keeps the currently set p.
|
static OptionID |
P_ID
OptionID for the "p" parameter
|
| Constructor and Description |
|---|
LPNormDistanceFunction(double p)
Constructor, internal version.
|
| Modifier and Type | Method and Description |
|---|---|
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) |
double |
getP()
Get the functions p parameter.
|
boolean |
isMetric()
Is this distance function metric (in particular, does it satisfy the
triangle equation?)
|
String |
toString() |
distance, getDistanceFactory, getInputTypeRestrictioninstantiate, isSymmetricclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinstantiate, isSymmetricpublic static final OptionID P_ID
private double p
public LPNormDistanceFunction(double p)
p - Parameter ppublic double doubleDistance(NumberVector<?,?> v1, NumberVector<?,?> v2)
v1 - first FeatureVectorv2 - second FeatureVectorpublic double getP()
public boolean isMetric()
DistanceFunctionisMetric in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>isMetric in class AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>true when metric.