de.lmu.ifi.dbs.elki.distance.distancefunction
Class LPNormDistanceFunction<V extends FeatureVector<V,N>,N extends Number>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<O,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDoubleDistanceFunction<V>
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 FeatureVector<V,N>,N extends Number>
- extends AbstractDoubleDistanceFunction<V>
Provides a LP-Norm for FeatureVectors.
- Author:
- Arthur Zimek
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()
- Provides a LP-Norm for FeatureVectors.
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
shortDescription
public String shortDescription()
- Description copied from class:
AbstractMeasurementFunction
- Returns the required input pattern.
- Specified by:
shortDescription
in interface Parameterizable
- Overrides:
shortDescription
in class AbstractMeasurementFunction<V extends FeatureVector<V,N>,DoubleDistance>
- Returns:
- Description of the class
setParameters
public List<String> setParameters(List<String> args)
throws ParameterException
- Description copied from class:
AbstractParameterizable
- Grabs all specified options from the option handler. Any extending class
should call this method first and return the returned array without further
changes, but after setting further required parameters. An example for
overwriting this method taking advantage from the previously (in
superclasses) defined options would be:
{
List remainingParameters = super.setParameters(args);
// set parameters for your class
// for example like this:
if(isSet(MY_PARAM_VALUE_PARAM))
{
myParamValue = getParameterValue(MY_PARAM_VALUE_PARAM);
}
.
.
.
return remainingParameters;
// or in case of attributes requesting parameters themselves
// return parameterizableAttribbute.setParameters(remainingParameters);
}
- Specified by:
setParameters
in interface Parameterizable
- Overrides:
setParameters
in class AbstractParameterizable
- Parameters:
args
- parameters to set the attributes accordingly to
- Returns:
- a list containing the unused parameters
- Throws:
ParameterException
- in case of wrong parameter-setting