de.lmu.ifi.dbs.elki.distance.distancefunction
Class AbstractDistanceFunction<O extends DatabaseObject,D extends Distance<D>>
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,D>
- Type Parameters:
O
- the type of DatabaseObject to compute the distances in betweenD
- the type of Distance used
- All Implemented Interfaces:
- DistanceFunction<O,D>, MeasurementFunction<O,D>, Parameterizable
- Direct Known Subclasses:
- AbstractDoubleDistanceFunction, AbstractFloatDistanceFunction, AbstractKernelFunction, AbstractPreprocessorBasedDistanceFunction, RepresentationSelectingDistanceFunction
public abstract class AbstractDistanceFunction<O extends DatabaseObject,D extends Distance<D>>
- extends AbstractMeasurementFunction<O,D>
- implements DistanceFunction<O,D>
AbstractDistanceFunction provides some methods valid for any extending
class.
- Author:
- Arthur Zimek
Method Summary |
D |
distance(Integer id1,
Integer id2)
Returns the distance between the two object specified by their object ids. |
D |
distance(Integer id1,
O o2)
Returns the distance between the two specified objects. |
boolean |
isInfiniteDistance(D distance)
Returns true, if the given distance is an infinite distance, false
otherwise. |
boolean |
isNullDistance(D distance)
Returns true, if the given distance is a null distance, false otherwise. |
boolean |
isUndefinedDistance(D distance)
Returns true, if the given distance is an undefined distance, false
otherwise. |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, setParameters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDistanceFunction
protected AbstractDistanceFunction(Pattern pattern)
- Provides an abstract DistanceFunction based on the given pattern.
- Parameters:
pattern
- a pattern to define the required input format
AbstractDistanceFunction
protected AbstractDistanceFunction()
- Provides an abstract DistanceFunction.
This constructor can be used if the required input pattern is
not yet known at instantiation time and will therefore be set later.
distance
public D distance(Integer id1,
Integer id2)
- Returns the distance between the two object specified by their object ids.
- Specified by:
distance
in interface DistanceFunction<O extends DatabaseObject,D extends Distance<D>>
- Parameters:
id1
- first object idid2
- second object id
- Returns:
- the distance between the two object specified by their object ids
distance
public D distance(Integer id1,
O o2)
- Description copied from interface:
DistanceFunction
- Returns the distance between the two specified objects.
- Specified by:
distance
in interface DistanceFunction<O extends DatabaseObject,D extends Distance<D>>
- Parameters:
id1
- first object ido2
- second DatabaseObject
- Returns:
- the distance between the two object specified by their object ids
isInfiniteDistance
public final boolean isInfiniteDistance(D distance)
- Description copied from interface:
MeasurementFunction
- Returns true, if the given distance is an infinite distance, false
otherwise.
- Specified by:
isInfiniteDistance
in interface MeasurementFunction<O extends DatabaseObject,D extends Distance<D>>
- Parameters:
distance
- the distance to be tested on infinity
- Returns:
- true, if the given distance is an infinite distance, false
otherwise
isNullDistance
public final boolean isNullDistance(D distance)
- Description copied from interface:
MeasurementFunction
- Returns true, if the given distance is a null distance, false otherwise.
- Specified by:
isNullDistance
in interface MeasurementFunction<O extends DatabaseObject,D extends Distance<D>>
- Parameters:
distance
- the distance to be tested whether it is a null distance
- Returns:
- true, if the given distance is a null distance, false otherwise
isUndefinedDistance
public final boolean isUndefinedDistance(D distance)
- Description copied from interface:
MeasurementFunction
- Returns true, if the given distance is an undefined distance, false
otherwise.
- Specified by:
isUndefinedDistance
in interface MeasurementFunction<O extends DatabaseObject,D extends Distance<D>>
- Parameters:
distance
- the distance to be tested whether it is undefined
- Returns:
- true, if the given distance is an undefined distance, false
otherwise