Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

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

public class FileBasedFloatDistanceFunction
extends AbstractFloatDistanceFunction<ExternalObject>

Provides a DistanceFunction that is based on float 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
FileBasedFloatDistanceFunction()
           
 
Method Summary
 String description()
          Returns a description of the class and the required parameters.
 FloatDistance distance(ExternalObject o1, ExternalObject o2)
          Computes the distance between two given DatabaseObjects according to this distance function.
 FloatDistance distance(Integer id1, ExternalObject o2)
          Returns the distance between the two specified objects.
 FloatDistance 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.AbstractFloatDistanceFunction
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

FileBasedFloatDistanceFunction

public FileBasedFloatDistanceFunction()
Method Detail

distance

public FloatDistance 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 DatabaseObjects according to this distance function

distance

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

Specified by:
distance in interface DistanceFunction<ExternalObject,FloatDistance>
Overrides:
distance in class AbstractDistanceFunction<ExternalObject,FloatDistance>
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 FloatDistance 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,FloatDistance>
Overrides:
distance in class AbstractDistanceFunction<ExternalObject,FloatDistance>
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)