Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction
Class AbstractDistanceFunction<O extends DatabaseObject,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<O,D>
Type Parameters:
O - the type of DatabaseObject to compute the distances in between
D - 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

Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
INFINITY_PATTERN
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
protected AbstractDistanceFunction()
          Provides an abstract DistanceFunction.
protected AbstractDistanceFunction(Pattern pattern)
          Provides an abstract DistanceFunction based on the given pattern.
 
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.distance.AbstractMeasurementFunction
getDatabase, matches, requiredInputPattern, setDatabase, setRequiredInputPattern, shortDescription
 
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 de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
distance
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction
infiniteDistance, nullDistance, requiredInputPattern, setDatabase, undefinedDistance, valueOf
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters, setParameters, shortDescription
 

Constructor Detail

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.

Method Detail

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 id
id2 - 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 id
o2 - 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

Release 0.2.1 (2009-07-13_1605)