Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction
Class EuclideanDistanceFunction<V extends NumberVector<V,?>>

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<V>
                      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.EuclideanDistanceFunction<V>
Type Parameters:
V - the type of NumberVector to compute the distances in between
All Implemented Interfaces:
DistanceFunction<V,DoubleDistance>, MeasurementFunction<V,DoubleDistance>, SpatialDistanceFunction<V,DoubleDistance>, Parameterizable

public class EuclideanDistanceFunction<V extends NumberVector<V,?>>
extends AbstractDoubleDistanceFunction<V>
implements SpatialDistanceFunction<V,DoubleDistance>

Provides the Euclidean distance for NumberVectors.

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
EuclideanDistanceFunction()
          Provides a Euclidean distance function that can compute the Euclidean distance (that is a DoubleDistance) for NumberVectors.
 
Method Summary
 DoubleDistance centerDistance(HyperBoundingBox mbr1, HyperBoundingBox mbr2)
          Computes the distance between the centroids of the two given MBRs according to this distance function.
 DoubleDistance distance(HyperBoundingBox mbr1, HyperBoundingBox mbr2)
          Computes the distance between the two given MBRs according to this distance function.
 DoubleDistance distance(V v1, V v2)
          Provides the Euclidean distance between the given two vectors.
 DoubleDistance minDist(HyperBoundingBox mbr, Integer id)
          Computes the minimum distance between the given MBR and the FeatureVector object with the given id according to this distance function.
 DoubleDistance minDist(HyperBoundingBox mbr, V v)
          Computes the minimum distance between the given MBR and the FeatureVector object according to this distance function.
 String shortDescription()
          Returns the required input pattern.
 
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
distance, distance, 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, 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, distance
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction
infiniteDistance, isInfiniteDistance, isNullDistance, isUndefinedDistance, nullDistance, requiredInputPattern, setDatabase, undefinedDistance, valueOf
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters, setParameters
 

Constructor Detail

EuclideanDistanceFunction

public EuclideanDistanceFunction()
Provides a Euclidean distance function that can compute the Euclidean distance (that is a DoubleDistance) for NumberVectors.

Method Detail

distance

public DoubleDistance distance(V v1,
                               V v2)
Provides the Euclidean distance between the given two vectors.

Specified by:
distance in interface DistanceFunction<V extends NumberVector<V,?>,DoubleDistance>
Parameters:
v1 - first DatabaseObject
v2 - second DatabaseObject
Returns:
the Euclidean distance between the given two vectors as an instance of DoubleDistance.

shortDescription

public String shortDescription()
Description copied from class: AbstractMeasurementFunction
Returns the required input pattern.

Specified by:
shortDescription in interface Parameterizable
Overrides:
shortDescription in class AbstractMeasurementFunction<V extends NumberVector<V,?>,DoubleDistance>
Returns:
Description of the class

minDist

public DoubleDistance minDist(HyperBoundingBox mbr,
                              V v)
Description copied from interface: SpatialDistanceFunction
Computes the minimum distance between the given MBR and the FeatureVector object according to this distance function.

Specified by:
minDist in interface SpatialDistanceFunction<V extends NumberVector<V,?>,DoubleDistance>
Parameters:
mbr - the MBR object
v - the FeatureVector object
Returns:
the minimum distance between the given MBR and the FeatureVector object according to this distance function

minDist

public DoubleDistance minDist(HyperBoundingBox mbr,
                              Integer id)
Description copied from interface: SpatialDistanceFunction
Computes the minimum distance between the given MBR and the FeatureVector object with the given id according to this distance function.

Specified by:
minDist in interface SpatialDistanceFunction<V extends NumberVector<V,?>,DoubleDistance>
Parameters:
mbr - the MBR object
id - the id of the FeatureVector object
Returns:
the minimum distance between the given MBR and the FeatureVector object according to this distance function

distance

public DoubleDistance distance(HyperBoundingBox mbr1,
                               HyperBoundingBox mbr2)
Description copied from interface: SpatialDistanceFunction
Computes the distance between the two given MBRs according to this distance function.

Specified by:
distance in interface SpatialDistanceFunction<V extends NumberVector<V,?>,DoubleDistance>
Parameters:
mbr1 - the first MBR object
mbr2 - the second MBR object
Returns:
the distance between the two given MBRs according to this distance function

centerDistance

public DoubleDistance centerDistance(HyperBoundingBox mbr1,
                                     HyperBoundingBox mbr2)
Description copied from interface: SpatialDistanceFunction
Computes the distance between the centroids of the two given MBRs according to this distance function.

Specified by:
centerDistance in interface SpatialDistanceFunction<V extends NumberVector<V,?>,DoubleDistance>
Parameters:
mbr1 - the first MBR object
mbr2 - the second MBR object
Returns:
the distance between the centroids of the two given MBRs according to this distance function

Release 0.2.1 (2009-07-13_1605)