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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.LPNormDistanceFunction
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.MaximumDistanceFunction
All Implemented Interfaces:
DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, SpatialPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, SpatialPrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable

public class MaximumDistanceFunction
extends LPNormDistanceFunction
implements SpatialPrimitiveDoubleDistanceFunction<NumberVector<?,?>>

Maximum distance function to compute the Maximum distance for a pair of FeatureVectors.


Nested Class Summary
static class MaximumDistanceFunction.Parameterizer
          Parameterization class.
 
Field Summary
static MaximumDistanceFunction STATIC
          Static instance.
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.LPNormDistanceFunction
P_ID
 
Constructor Summary
MaximumDistanceFunction()
          Deprecated. Use static instance!
 
Method Summary
 DoubleDistance centerDistance(SpatialComparable mbr1, SpatialComparable mbr2)
          Computes the distance between the centroids of the two given MBRs according to this distance function.
 double doubleCenterDistance(SpatialComparable mbr1, SpatialComparable mbr2)
          Computes the distance between the centroids of the two given MBRs according to this distance function.
 double doubleDistance(NumberVector<?,?> v1, NumberVector<?,?> v2)
          Returns the distance between the specified FeatureVectors as a LP-Norm for the currently set p.
 double doubleMinDist(SpatialComparable mbr1, SpatialComparable mbr2)
          Computes the distance between the two given MBRs according to this distance function.
 boolean equals(Object obj)
           
<T extends NumberVector<?,?>>
SpatialDistanceQuery<T,DoubleDistance>
instantiate(Relation<T> relation)
          Instantiate with a database to get the actual distance query.
 boolean isMetric()
          Is this distance function metric (in particular, does it satisfy the triangle equation?)
 DoubleDistance minDist(SpatialComparable mbr1, SpatialComparable mbr2)
          Computes the distance between the two given MBRs according to this distance function.
 String toString()
           
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.LPNormDistanceFunction
getP
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
distance, getDistanceFactory, getInputTypeRestriction
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction
isSymmetric
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.PrimitiveDistanceFunction
distance, getInputTypeRestriction
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
getDistanceFactory, isSymmetric
 

Field Detail

STATIC

public static final MaximumDistanceFunction STATIC
Static instance.

Constructor Detail

MaximumDistanceFunction

@Deprecated
public MaximumDistanceFunction()
Deprecated. Use static instance!

Provides a Maximum distance function that can compute the Manhattan distance (that is a DoubleDistance) for FeatureVectors.

Method Detail

doubleDistance

public double doubleDistance(NumberVector<?,?> v1,
                             NumberVector<?,?> v2)
Description copied from class: LPNormDistanceFunction
Returns the distance between the specified FeatureVectors as a LP-Norm for the currently set p.

Specified by:
doubleDistance in interface PrimitiveDoubleDistanceFunction<NumberVector<?,?>>
Overrides:
doubleDistance in class LPNormDistanceFunction
Parameters:
v1 - first FeatureVector
v2 - second FeatureVector
Returns:
the distance between the specified FeatureVectors as a LP-Norm for the currently set p

doubleMinDist

public double doubleMinDist(SpatialComparable mbr1,
                            SpatialComparable mbr2)
Description copied from interface: SpatialPrimitiveDoubleDistanceFunction
Computes the distance between the two given MBRs according to this distance function.

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

doubleCenterDistance

public double doubleCenterDistance(SpatialComparable mbr1,
                                   SpatialComparable mbr2)
Description copied from interface: SpatialPrimitiveDoubleDistanceFunction
Computes the distance between the centroids of the two given MBRs according to this distance function.

Specified by:
doubleCenterDistance in interface SpatialPrimitiveDoubleDistanceFunction<NumberVector<?,?>>
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

minDist

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

Specified by:
minDist in interface SpatialPrimitiveDistanceFunction<NumberVector<?,?>,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(SpatialComparable mbr1,
                                     SpatialComparable mbr2)
Description copied from interface: SpatialPrimitiveDistanceFunction
Computes the distance between the centroids of the two given MBRs according to this distance function.

Specified by:
centerDistance in interface SpatialPrimitiveDistanceFunction<NumberVector<?,?>,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

isMetric

public boolean isMetric()
Description copied from interface: DistanceFunction
Is this distance function metric (in particular, does it satisfy the triangle equation?)

Specified by:
isMetric in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>
Overrides:
isMetric in class LPNormDistanceFunction
Returns:
true when metric.

instantiate

public <T extends NumberVector<?,?>> SpatialDistanceQuery<T,DoubleDistance> instantiate(Relation<T> relation)
Description copied from class: AbstractPrimitiveDistanceFunction
Instantiate with a database to get the actual distance query.

Specified by:
instantiate in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>
Specified by:
instantiate in interface SpatialPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
Overrides:
instantiate in class AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
Parameters:
relation - Representation
Returns:
Actual distance query.

toString

public String toString()
Overrides:
toString in class LPNormDistanceFunction

equals

public boolean equals(Object obj)
Overrides:
equals in class LPNormDistanceFunction

Release 0.4.0 (2011-09-20_1324)