Package elki.index.laesa
Class LAESA.LAESAKNNSearcher<Q>
- java.lang.Object
-
- elki.index.laesa.LAESA.LAESAKNNSearcher<Q>
-
- Type Parameters:
Q- query object
- All Implemented Interfaces:
KNNSearcher<Q>
- Direct Known Subclasses:
LAESA.LAESAKNNByDBIDSearcher,LAESA.LAESAKNNByObjectSearcher
public abstract class LAESA.LAESAKNNSearcher<Q> extends java.lang.Object implements KNNSearcher<Q>
KNN searcher class- Author:
- Robert Gehde
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intmaxncMaximum number of distance computations before also pruning reference points.
-
Constructor Summary
Constructors Constructor Description LAESAKNNSearcher(int k)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private intfindInRef(DBIDRef p, DBIDArrayIter ref)Find the given DBIDVar p in the reference iterprotected voidlaesaKNNSearch(KNNHeap knns)Search the k nearest neighborsprivate intprocessPoints(ModifiableDoubleDBIDList cands, DoubleDBIDListMIter iter, double threshold, double dxs, DoubleDataStore rdists, int nc)Process a set of pointsprotected abstract doublequeryDistance(DBIDRef p)Compute the distance to a candidate object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.database.query.knn.KNNSearcher
getKNN
-
-
-
-
Method Detail
-
laesaKNNSearch
protected void laesaKNNSearch(KNNHeap knns)
Search the k nearest neighbors- Parameters:
knns- result heap
-
processPoints
private int processPoints(ModifiableDoubleDBIDList cands, DoubleDBIDListMIter iter, double threshold, double dxs, DoubleDataStore rdists, int nc)
Process a set of points- Parameters:
cands- Points to processiter- iteratorthreshold- Pruning distancedxs- Distance to current pointrdists- Precomputed distancesnc- Number of distance computations- Returns:
- Index of best candidate
-
findInRef
private int findInRef(DBIDRef p, DBIDArrayIter ref)
Find the given DBIDVar p in the reference iter- Parameters:
p- Object to findref- Reference iterator- Returns:
- index into the reference points list
-
queryDistance
protected abstract double queryDistance(DBIDRef p)
Compute the distance to a candidate object.- Parameters:
p- Object- Returns:
- Distance
-
-