O
- Object typepublic class LinearScanRawDoubleDistanceKNNQuery<O> extends LinearScanPrimitiveDistanceKNNQuery<O,DoubleDistance>
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 |
---|
LinearScanRawDoubleDistanceKNNQuery(PrimitiveDistanceQuery<O,DoubleDistance> distanceQuery)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
KNNResult<DoubleDistance> |
getKNNForDBID(DBIDRef id,
int k)
Get the k nearest neighbors for a particular id.
|
KNNResult<DoubleDistance> |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id.
|
(package private) KNNResult<DoubleDistance> |
getKNNForObjectBenchmarked(O obj,
int k)
It does not make sense, but this version is faster in our larger
benchmarks.
|
(package private) KNNResult<DoubleDistance> |
getKNNForObjectClean(O obj,
int k)
This is the cleaner, supposedly faster implementation.
|
getKNNForBulkDBIDs, linearScanBatchKNN
getRelation
PrimitiveDoubleDistanceFunction<O> rawdist
public LinearScanRawDoubleDistanceKNNQuery(PrimitiveDistanceQuery<O,DoubleDistance> distanceQuery)
distanceQuery
- Distance function to usepublic KNNResult<DoubleDistance> getKNNForDBID(DBIDRef id, int k)
KNNQuery
getKNNForDBID
in interface KNNQuery<O,DoubleDistance>
getKNNForDBID
in class LinearScanPrimitiveDistanceKNNQuery<O,DoubleDistance>
id
- query object IDk
- Number of neighbors requestedpublic KNNResult<DoubleDistance> getKNNForObject(O obj, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<O,DoubleDistance>
getKNNForObject
in class LinearScanKNNQuery<O,DoubleDistance>
obj
- Query objectk
- Number of neighbors requestedKNNResult<DoubleDistance> getKNNForObjectClean(O obj, int k)
obj
- Query objectk
- Desired number of neighborsKNNResult<DoubleDistance> getKNNForObjectBenchmarked(O obj, int k)
obj
- Query objectk
- Desired number of neighbors