de.lmu.ifi.dbs.elki.database.query.knn
Interface KNNQuery<O,D extends Distance<D>>

Type Parameters:
O - Object type
D - Distance type
All Superinterfaces:
DatabaseQuery
All Known Implementing Classes:
AbstractDistanceKNNQuery, DoubleDistanceRStarTreeKNNQuery, GenericRStarTreeKNNQuery, LinearScanKNNQuery, LinearScanPrimitiveDistanceKNNQuery, LinearScanRawDoubleDistanceKNNQuery, MetricalIndexKNNQuery, PreprocessorKNNQuery

public interface KNNQuery<O,D extends Distance<D>>
extends DatabaseQuery

The interface of an actual instance.


Field Summary
 
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
 
Method Summary
 D getDistanceFactory()
          Get the distance data type of the function.
 DistanceQuery<O,D> getDistanceQuery()
          Get the distance query for this function.
 List<List<DistanceResultPair<D>>> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
          Bulk query method
 void getKNNForBulkHeaps(Map<DBID,KNNHeap<D>> heaps)
          Bulk query method configured by a map.
 List<DistanceResultPair<D>> getKNNForDBID(DBID id, int k)
          Get the k nearest neighbors for a particular id.
 List<DistanceResultPair<D>> getKNNForObject(O obj, int k)
          Get the k nearest neighbors for a particular id.
 Relation<? extends O> getRelation()
          Access the underlying data query.
 

Method Detail

getKNNForDBID

List<DistanceResultPair<D>> getKNNForDBID(DBID id,
                                          int k)
Get the k nearest neighbors for a particular id.

Parameters:
id - query object ID
k - Number of neighbors requested
Returns:
neighbors

getKNNForBulkDBIDs

List<List<DistanceResultPair<D>>> getKNNForBulkDBIDs(ArrayDBIDs ids,
                                                     int k)
Bulk query method

Parameters:
ids - query object IDs
k - Number of neighbors requested
Returns:
neighbors

getKNNForBulkHeaps

void getKNNForBulkHeaps(Map<DBID,KNNHeap<D>> heaps)
Bulk query method configured by a map. Warning: this API is not optimal, and might be removed soon (in fact, it is used in a single place)

Parameters:
heaps - Map of heaps to fill.

getKNNForObject

List<DistanceResultPair<D>> getKNNForObject(O obj,
                                            int k)
Get the k nearest neighbors for a particular id.

Parameters:
obj - Query object
k - Number of neighbors requested
Returns:
neighbors

getDistanceQuery

DistanceQuery<O,D> getDistanceQuery()
Get the distance query for this function.


getDistanceFactory

D getDistanceFactory()
Get the distance data type of the function.


getRelation

Relation<? extends O> getRelation()
Access the underlying data query.

Returns:
data query in use

Release 0.4.0 (2011-09-20_1324)