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>
- All Implemented Interfaces:
- DistanceFunction<V,DoubleDistance>, MeasurementFunction<V,DoubleDistance>, Loggable, Parameterizable
public class LPNormDistanceFunction<V extends FeatureVector<V,N>,N extends Number>
- extends AbstractDoubleDistanceFunction<V>
Provides a LP-Norm for FeatureVectors.
- Author:
- Arthur Zimek
TODO: implement SpatialDistanceFunction
Field Summary |
private double |
p
Keeps the curerntly set p. |
static String |
P_D
Description for parameter P. |
static String |
P_P
Parameter P. |
Method Summary |
String |
description()
Returns a description of the class and the required parameters. |
DoubleDistance |
distance(V o1,
V o2)
Returns the distance between the specified FeatureVectors as a LP-Norm
for the currently set p. |
String[] |
setParameters(String[] args)
Sets the attributes of the class accordingly to the given parameters. |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
addOption, checkGlobalParameterConstraints, deleteOption, description, description, getAttributeSettings, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
P_P
public static final String P_P
- Parameter P.
- See Also:
- Constant Field Values
P_D
public static final String P_D
- Description for parameter P.
- See Also:
- Constant Field Values
p
private double p
- Keeps the curerntly set p.
LPNormDistanceFunction
public LPNormDistanceFunction()
- Provides a LP-Norm for FeatureVectors.
distance
public DoubleDistance distance(V o1,
V o2)
- Returns the distance between the specified FeatureVectors as a LP-Norm
for the currently set p.
- Parameters:
o1
- first FeatureVectoro2
- second FeatureVector
- Returns:
- the distance between the specified FeatureVectors as a LP-Norm
for the currently set p
- See Also:
DistanceFunction.distance(de.lmu.ifi.dbs.elki.data.DatabaseObject, de.lmu.ifi.dbs.elki.data.DatabaseObject)
description
public String description()
- Description copied from interface:
Parameterizable
- Returns a description of the class and the required parameters.
This description should be suitable for a usage description as for a standalone application.
- Specified by:
description
in interface Parameterizable
- Overrides:
description
in class AbstractParameterizable
- Returns:
- String a description of the class and the required parameters
- See Also:
Parameterizable.description()
setParameters
public String[] setParameters(String[] args)
throws ParameterException
- Description copied from interface:
Parameterizable
- Sets the attributes of the class accordingly to the given parameters.
Returns a new String array containing those entries of the
given array that are neither expected nor used by this
Parameterizable.
- Specified by:
setParameters
in interface Parameterizable
- Overrides:
setParameters
in class AbstractParameterizable
- Parameters:
args
- parameters to set the attributes accordingly to
- Returns:
- String[] an array containing the unused parameters
- Throws:
ParameterException
- in case of wrong parameter-setting- See Also:
Parameterizable.setParameters(String[])