de.lmu.ifi.dbs.elki.database.query.knn
Class LinearScanRawDoubleDistanceKNNQuery<O>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery<O>
      extended by de.lmu.ifi.dbs.elki.database.query.knn.AbstractDistanceKNNQuery<O,D>
          extended by de.lmu.ifi.dbs.elki.database.query.knn.LinearScanKNNQuery<O,D>
              extended by de.lmu.ifi.dbs.elki.database.query.knn.LinearScanPrimitiveDistanceKNNQuery<O,DoubleDistance>
                  extended by de.lmu.ifi.dbs.elki.database.query.knn.LinearScanRawDoubleDistanceKNNQuery<O>
Type Parameters:
O - Object type
All Implemented Interfaces:
DatabaseQuery, KNNQuery<O,DoubleDistance>, LinearScanQuery

public class LinearScanRawDoubleDistanceKNNQuery<O>
extends LinearScanPrimitiveDistanceKNNQuery<O,DoubleDistance>

Optimized linear scan query for PrimitiveDoubleDistanceFunctions.


Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.query.knn.AbstractDistanceKNNQuery
distanceQuery
 
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
LinearScanRawDoubleDistanceKNNQuery(PrimitiveDistanceQuery<O,DoubleDistance> distanceQuery)
          Constructor.
 
Method Summary
 List<DistanceResultPair<DoubleDistance>> getKNNForDBID(DBID id, int k)
          Get the k nearest neighbors for a particular id.
 List<DistanceResultPair<DoubleDistance>> getKNNForObject(O obj, int k)
          Get the k nearest neighbors for a particular id.
protected  void linearScanBatchKNN(List<O> objs, List<KNNHeap<DoubleDistance>> heaps)
          Perform a linear scan batch kNN for primitive distance functions.
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.knn.LinearScanPrimitiveDistanceKNNQuery
getKNNForBulkDBIDs, getKNNForBulkHeaps
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.knn.AbstractDistanceKNNQuery
getDistanceFactory, getDistanceQuery
 
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.knn.KNNQuery
getRelation
 

Constructor Detail

LinearScanRawDoubleDistanceKNNQuery

public LinearScanRawDoubleDistanceKNNQuery(PrimitiveDistanceQuery<O,DoubleDistance> distanceQuery)
Constructor.

Parameters:
distanceQuery - Distance function to use
Method Detail

getKNNForDBID

public List<DistanceResultPair<DoubleDistance>> getKNNForDBID(DBID id,
                                                              int k)
Description copied from interface: KNNQuery
Get the k nearest neighbors for a particular id.

Specified by:
getKNNForDBID in interface KNNQuery<O,DoubleDistance>
Overrides:
getKNNForDBID in class LinearScanPrimitiveDistanceKNNQuery<O,DoubleDistance>
Parameters:
id - query object ID
k - Number of neighbors requested
Returns:
neighbors

getKNNForObject

public List<DistanceResultPair<DoubleDistance>> getKNNForObject(O obj,
                                                                int k)
Description copied from interface: KNNQuery
Get the k nearest neighbors for a particular id.

Specified by:
getKNNForObject in interface KNNQuery<O,DoubleDistance>
Overrides:
getKNNForObject in class LinearScanKNNQuery<O,DoubleDistance>
Parameters:
obj - Query object
k - Number of neighbors requested
Returns:
neighbors

linearScanBatchKNN

protected void linearScanBatchKNN(List<O> objs,
                                  List<KNNHeap<DoubleDistance>> heaps)
Description copied from class: LinearScanPrimitiveDistanceKNNQuery
Perform a linear scan batch kNN for primitive distance functions.

Overrides:
linearScanBatchKNN in class LinearScanPrimitiveDistanceKNNQuery<O,DoubleDistance>
Parameters:
objs - Objects list
heaps - Heaps array

Release 0.4.0 (2011-09-20_1324)