de.lmu.ifi.dbs.elki.distance.distancefunction
Class MinKDistance.Instance<T extends O>

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.AbstractDatabaseDistanceQuery<T,D>
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.MinKDistance.Instance<T>
All Implemented Interfaces:
DatabaseQuery, DistanceQuery<T,D>
Enclosing class:
MinKDistance<O,D extends Distance<D>>

public class MinKDistance.Instance<T extends O>
extends AbstractDatabaseDistanceQuery<T,D>

Instance for an actual database.


Field Summary
private  int k
          Value for k
private  KNNQuery<T,D> knnQuery
          KNN query instance
 
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
MinKDistance.Instance(Relation<T> relation, int k, DistanceFunction<? super O,D> parentDistance)
          Constructor.
 
Method Summary
 D distance(DBID id1, DBID id2)
          Returns the distance between the two objects specified by their object ids.
 DistanceFunction<? super T,D> getDistanceFunction()
          Get the inner distance function.
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.distance.AbstractDatabaseDistanceQuery
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
getRelation
 

Field Detail

knnQuery

private KNNQuery<T extends O,D extends Distance<D>> knnQuery
KNN query instance


k

private int k
Value for k

Constructor Detail

MinKDistance.Instance

public MinKDistance.Instance(Relation<T> relation,
                             int k,
                             DistanceFunction<? super O,D> parentDistance)
Constructor.

Parameters:
relation - Database
k - Value of k
Method Detail

distance

public D distance(DBID id1,
                  DBID id2)
Description copied from class: AbstractDistanceQuery
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DistanceQuery<T extends O,D extends Distance<D>>
Specified by:
distance in class AbstractDistanceQuery<T extends O,D extends Distance<D>>
Parameters:
id1 - first object id
id2 - second object id
Returns:
the distance between the two objects specified by their object ids

getDistanceFunction

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

Returns:
Distance function

Release 0.4.0 (2011-09-20_1324)