public class LinearScanPrimitiveDistanceKNNQuery<O,D extends Distance<D>> extends LinearScanKNNQuery<O,D>
distanceQuery
relation
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
LinearScanPrimitiveDistanceKNNQuery(PrimitiveDistanceQuery<O,D> distanceQuery)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected void |
linearScanBatchKNN(List<O> objs,
List<KNNHeap<D>> heaps)
Perform a linear scan batch kNN for primitive distance functions.
|
getKNNForObject
getDistanceFactory, getDistanceQuery
getRelation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRelation
public LinearScanPrimitiveDistanceKNNQuery(PrimitiveDistanceQuery<O,D> distanceQuery)
distanceQuery
- Distance function to useprotected void linearScanBatchKNN(List<O> objs, List<KNNHeap<D>> heaps)
objs
- Objects listheaps
- Heaps arraypublic List<DistanceResultPair<D>> getKNNForDBID(DBID id, int k)
KNNQuery
getKNNForDBID
in interface KNNQuery<O,D extends Distance<D>>
getKNNForDBID
in class LinearScanKNNQuery<O,D extends Distance<D>>
id
- query object IDk
- Number of neighbors requestedpublic List<List<DistanceResultPair<D>>> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
getKNNForBulkDBIDs
in interface KNNQuery<O,D extends Distance<D>>
getKNNForBulkDBIDs
in class LinearScanKNNQuery<O,D extends Distance<D>>
ids
- query object IDsk
- Number of neighbors requestedpublic void getKNNForBulkHeaps(Map<DBID,KNNHeap<D>> heaps)
KNNQuery
getKNNForBulkHeaps
in interface KNNQuery<O,D extends Distance<D>>
getKNNForBulkHeaps
in class LinearScanKNNQuery<O,D extends Distance<D>>
heaps
- Map of heaps to fill.