Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction
Class FileBasedDoubleDistanceFunction

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,DoubleDistance>
                  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDoubleDistanceFunction<ExternalObject>
                      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.FileBasedDoubleDistanceFunction
All Implemented Interfaces:
DistanceFunction<ExternalObject,DoubleDistance>, MeasurementFunction<ExternalObject,DoubleDistance>, Loggable, Parameterizable

public class FileBasedDoubleDistanceFunction
extends AbstractDoubleDistanceFunction<ExternalObject>

Provides a DistanceFunction that is based on double distances given by a distance matrix of an external file.

Author:
Elke Achtert

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
 
Constructor Summary
FileBasedDoubleDistanceFunction()
           
 
Method Summary
 String description()
          Returns a description of the class and the required parameters.
 DoubleDistance distance(ExternalObject o1, ExternalObject o2)
          Computes the distance between two given DatabaseObjects according to this distance function.
 DoubleDistance distance(Integer id1, ExternalObject o2)
          Returns the distance between the two specified objects.
 DoubleDistance distance(Integer id1, Integer id2)
          Returns the distance between the two objcts specified by their obejct ids.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDoubleDistanceFunction
infiniteDistance, nullDistance, undefinedDistance, valueOf
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction
isInfiniteDistance, isNullDistance, isUndefinedDistance
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
getDatabase, matches, requiredInputPattern, setDatabase, setRequiredInputPattern
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, checkGlobalParameterConstraints, deleteOption, description, description, getAttributeSettings, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters, 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
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction
requiredInputPattern, setDatabase
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, getAttributeSettings, getParameters, getPossibleOptions, inlineDescription, setParameters
 

Constructor Detail

FileBasedDoubleDistanceFunction

public FileBasedDoubleDistanceFunction()
Method Detail

distance

public DoubleDistance distance(ExternalObject o1,
                               ExternalObject o2)
Computes the distance between two given DatabaseObjects according to this distance function.

Parameters:
o1 - first DatabaseObject
o2 - second DatabaseObject
Returns:
the distance between two given DatabaseObject according to this distance function

distance

public DoubleDistance distance(Integer id1,
                               ExternalObject o2)
Returns the distance between the two specified objects.

Specified by:
distance in interface DistanceFunction<ExternalObject,DoubleDistance>
Overrides:
distance in class AbstractDistanceFunction<ExternalObject,DoubleDistance>
Parameters:
id1 - first object id
o2 - second DatabaseObject
Returns:
the distance between the two objcts specified by their obejct ids
See Also:
DistanceFunction.distance(Integer, Integer)

distance

public DoubleDistance distance(Integer id1,
                               Integer id2)
Returns the distance between the two objcts specified by their obejct ids. If a cache is used, the distance value is looked up in the cache. If the distance does not yet exists in cache, it will be computed an put to cache. If no cache is used, the distance is computed.

Specified by:
distance in interface DistanceFunction<ExternalObject,DoubleDistance>
Overrides:
distance in class AbstractDistanceFunction<ExternalObject,DoubleDistance>
Parameters:
id1 - first object id
id2 - second object id
Returns:
the distance between the two objcts specified by their obejct ids

description

public String description()
Returns a description of the class and the required parameters. This description should be suitable for a usage description.

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()

Release 0.1 (2008-07-10_1838)