public class LinearScanDistanceKNNQuery<O> extends AbstractDistanceKNNQuery<O> implements LinearScanQuery
distanceQuery
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
LinearScanDistanceKNNQuery(DistanceQuery<O> distanceQuery)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<KNNList> |
getKNNForBulkDBIDs(ArrayDBIDs ids,
int k)
Bulk query method
|
KNNList |
getKNNForDBID(DBIDRef id,
int k)
Get the k nearest neighbors for a particular id.
|
KNNList |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id.
|
private void |
linearScanBatchKNN(ArrayDBIDs ids,
java.util.List<KNNHeap> heaps)
Linear batch knn for arbitrary distance functions.
|
getRelation
public LinearScanDistanceKNNQuery(DistanceQuery<O> distanceQuery)
distanceQuery
- Distance function to usepublic KNNList getKNNForDBID(DBIDRef id, int k)
KNNQuery
getKNNForDBID
in interface KNNQuery<O>
getKNNForDBID
in class AbstractDistanceKNNQuery<O>
id
- query object IDk
- Number of neighbors requestedpublic KNNList getKNNForObject(O obj, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<O>
getKNNForObject
in class AbstractDistanceKNNQuery<O>
obj
- Query objectk
- Number of neighbors requestedpublic java.util.List<KNNList> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
getKNNForBulkDBIDs
in interface KNNQuery<O>
getKNNForBulkDBIDs
in class AbstractDistanceKNNQuery<O>
ids
- query object IDsk
- Number of neighbors requestedprivate void linearScanBatchKNN(ArrayDBIDs ids, java.util.List<KNNHeap> heaps)
ids
- DBIDs to processheaps
- Heaps to store the results inCopyright © 2019 ELKI Development Team. License information.