de.lmu.ifi.dbs.elki.database.query.distance
Class SpatialPrimitiveDistanceQuery<V extends SpatialComparable,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery<O>
      extended by de.lmu.ifi.dbs.elki.database.query.distance.AbstractDistanceQuery<O,D>
          extended by de.lmu.ifi.dbs.elki.database.query.distance.PrimitiveDistanceQuery<V,D>
              extended by de.lmu.ifi.dbs.elki.database.query.distance.SpatialPrimitiveDistanceQuery<V,D>
Type Parameters:
V - Vector type to use
D - Distance result type
All Implemented Interfaces:
DatabaseQuery, DistanceQuery<V,D>, SpatialDistanceQuery<V,D>

public class SpatialPrimitiveDistanceQuery<V extends SpatialComparable,D extends Distance<D>>
extends PrimitiveDistanceQuery<V,D>
implements SpatialDistanceQuery<V,D>

Distance query for spatial distance functions


Field Summary
protected  SpatialPrimitiveDistanceFunction<? super V,D> distanceFunction
          The distance function we use.
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
relation
 
Fields inherited from interface de.lmu.ifi.dbs.elki.database.query.DatabaseQuery
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
 
Constructor Summary
SpatialPrimitiveDistanceQuery(Relation<? extends V> relation, SpatialPrimitiveDistanceFunction<? super V,D> distanceFunction)
           
 
Method Summary
 D centerDistance(SpatialComparable mbr1, SpatialComparable mbr2)
          Computes the distance between the centroids of the two given MBRs according to this distance function.
 SpatialPrimitiveDistanceFunction<? super V,D> getDistanceFunction()
          Get the inner distance function.
 D mbrDist(SpatialComparable mbr1, SpatialComparable mbr2)
          Computes the distance between the two given MBRs according to this distance function.
 D minDist(SpatialComparable mbr, DBID id)
          Computes the minimum distance between the given MBR and the FeatureVector object according to this distance function.
 D minDist(SpatialComparable mbr, V v)
          Computes the minimum distance between the given MBR and the FeatureVector object according to this distance function.
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.distance.PrimitiveDistanceQuery
distance, distance, distance, distance
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.distance.AbstractDistanceQuery
getDistanceFactory, infiniteDistance, nullDistance, undefinedDistance
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
getRelation
 
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.database.query.distance.DistanceQuery
distance, distance, distance, distance, getDistanceFactory, getRelation, infiniteDistance, nullDistance, undefinedDistance
 

Field Detail

distanceFunction

protected final SpatialPrimitiveDistanceFunction<? super V extends SpatialComparable,D extends Distance<D>> distanceFunction
The distance function we use.

Constructor Detail

SpatialPrimitiveDistanceQuery

public SpatialPrimitiveDistanceQuery(Relation<? extends V> relation,
                                     SpatialPrimitiveDistanceFunction<? super V,D> distanceFunction)
Parameters:
relation - Representation to use
distanceFunction - Distance function to use
Method Detail

centerDistance

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

Specified by:
centerDistance in interface SpatialDistanceQuery<V extends SpatialComparable,D extends Distance<D>>
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

mbrDist

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

Specified by:
mbrDist in interface SpatialDistanceQuery<V extends SpatialComparable,D extends Distance<D>>
Parameters:
mbr1 - the first MBR object
mbr2 - the second MBR object
Returns:
the distance between the two given MBRs according to this distance function

minDist

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

Specified by:
minDist in interface SpatialDistanceQuery<V extends SpatialComparable,D extends Distance<D>>
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 D minDist(SpatialComparable mbr,
                 DBID id)
Description copied from interface: SpatialDistanceQuery
Computes the minimum distance between the given MBR and the FeatureVector object according to this distance function.

Specified by:
minDist in interface SpatialDistanceQuery<V extends SpatialComparable,D extends Distance<D>>
Parameters:
mbr - the MBR object
id - the query object id
Returns:
the minimum distance between the given MBR and the FeatureVector object according to this distance function

getDistanceFunction

public SpatialPrimitiveDistanceFunction<? super V,D> getDistanceFunction()
Description copied from interface: DistanceQuery
Get the inner distance function.

Specified by:
getDistanceFunction in interface DistanceQuery<V extends SpatialComparable,D extends Distance<D>>
Specified by:
getDistanceFunction in interface SpatialDistanceQuery<V extends SpatialComparable,D extends Distance<D>>
Overrides:
getDistanceFunction in class PrimitiveDistanceQuery<V extends SpatialComparable,D extends Distance<D>>
Returns:
Distance function

Release 0.4.0 (2011-09-20_1324)