de.lmu.ifi.dbs.elki.database.query.knn
Class LinearScanRawDoubleDistanceKNNQuery<O>
java.lang.Object
de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery<O>
de.lmu.ifi.dbs.elki.database.query.knn.AbstractDistanceKNNQuery<O,D>
de.lmu.ifi.dbs.elki.database.query.knn.LinearScanKNNQuery<O,D>
de.lmu.ifi.dbs.elki.database.query.knn.LinearScanPrimitiveDistanceKNNQuery<O,DoubleDistance>
de.lmu.ifi.dbs.elki.database.query.knn.LinearScanRawDoubleDistanceKNNQuery<O>
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
- DatabaseQuery, KNNQuery<O,DoubleDistance>, LinearScanQuery
public class LinearScanRawDoubleDistanceKNNQuery<O>
- extends LinearScanPrimitiveDistanceKNNQuery<O,DoubleDistance>
Optimized linear scan query for PrimitiveDoubleDistanceFunction
s.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinearScanRawDoubleDistanceKNNQuery
public LinearScanRawDoubleDistanceKNNQuery(PrimitiveDistanceQuery<O,DoubleDistance> distanceQuery)
- Constructor.
- Parameters:
distanceQuery
- Distance function to use
getKNNForDBID
public List<DistanceResultPair<DoubleDistance>> getKNNForDBID(DBID id,
int k)
- Description copied from interface:
KNNQuery
- Get the k nearest neighbors for a particular id.
- Specified by:
getKNNForDBID
in interface KNNQuery<O,DoubleDistance>
- Overrides:
getKNNForDBID
in class LinearScanPrimitiveDistanceKNNQuery<O,DoubleDistance>
- Parameters:
id
- query object IDk
- Number of neighbors requested
- Returns:
- neighbors
getKNNForObject
public List<DistanceResultPair<DoubleDistance>> getKNNForObject(O obj,
int k)
- Description copied from interface:
KNNQuery
- Get the k nearest neighbors for a particular id.
- Specified by:
getKNNForObject
in interface KNNQuery<O,DoubleDistance>
- Overrides:
getKNNForObject
in class LinearScanKNNQuery<O,DoubleDistance>
- Parameters:
obj
- Query objectk
- Number of neighbors requested
- Returns:
- neighbors
linearScanBatchKNN
protected void linearScanBatchKNN(List<O> objs,
List<KNNHeap<DoubleDistance>> heaps)
- Description copied from class:
LinearScanPrimitiveDistanceKNNQuery
- Perform a linear scan batch kNN for primitive distance functions.
- Overrides:
linearScanBatchKNN
in class LinearScanPrimitiveDistanceKNNQuery<O,DoubleDistance>
- Parameters:
objs
- Objects listheaps
- Heaps array