O
- Object typepublic class DoubleOptimizedDistanceKNNQuery<O> extends AbstractDistanceKNNQuery<O,DoubleDistance> implements LinearScanQuery
PrimitiveDoubleDistanceFunction
s.Modifier and Type | Field and Description |
---|---|
(package private) PrimitiveDoubleDistanceFunction<O> |
rawdist
Raw distance function.
|
distanceQuery
relation
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
DoubleOptimizedDistanceKNNQuery(PrimitiveDistanceQuery<O,DoubleDistance> distanceQuery)
Constructor.newDoubleDistanceHeap
|
Modifier and Type | Method and Description |
---|---|
DoubleDistanceKNNList |
getKNNForDBID(DBIDRef id,
int k)
Get the k nearest neighbors for a particular id.
|
DoubleDistanceKNNList |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id.
|
private static <O> void |
linearScan(Relation<? extends O> relation,
DBIDIter iter,
PrimitiveDoubleDistanceFunction<? super O> rawdist,
O obj,
DoubleDistanceKNNHeap heap) |
getKNNForBulkDBIDs
getRelation
PrimitiveDoubleDistanceFunction<O> rawdist
public DoubleOptimizedDistanceKNNQuery(PrimitiveDistanceQuery<O,DoubleDistance> distanceQuery)
distanceQuery
- Distance function to usepublic DoubleDistanceKNNList getKNNForDBID(DBIDRef id, int k)
KNNQuery
getKNNForDBID
in interface KNNQuery<O,DoubleDistance>
getKNNForDBID
in class AbstractDistanceKNNQuery<O,DoubleDistance>
id
- query object IDk
- Number of neighbors requestedpublic DoubleDistanceKNNList getKNNForObject(O obj, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<O,DoubleDistance>
getKNNForObject
in class AbstractDistanceKNNQuery<O,DoubleDistance>
obj
- Query objectk
- Number of neighbors requestedprivate static <O> void linearScan(Relation<? extends O> relation, DBIDIter iter, PrimitiveDoubleDistanceFunction<? super O> rawdist, O obj, DoubleDistanceKNNHeap heap)