Package elki.database.query.knn
Class LinearScanKNNByObject<O>
- java.lang.Object
-
- elki.database.query.knn.LinearScanKNNByObject<O>
-
- Type Parameters:
O
- relation object type
- All Implemented Interfaces:
KNNSearcher<O>
,LinearScanQuery
public class LinearScanKNNByObject<O> extends java.lang.Object implements KNNSearcher<O>, LinearScanQuery
Instance of this query for a particular database.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private DistanceQuery<O>
distanceQuery
Hold the distance function to be used.
-
Constructor Summary
Constructors Constructor Description LinearScanKNNByObject(DistanceQuery<O> distanceQuery)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KNNList
getKNN(O obj, int k)
Get the k nearest neighbors for a particular object.
-
-
-
Field Detail
-
distanceQuery
private final DistanceQuery<O> distanceQuery
Hold the distance function to be used.
-
-
Constructor Detail
-
LinearScanKNNByObject
public LinearScanKNNByObject(DistanceQuery<O> distanceQuery)
Constructor.- Parameters:
distanceQuery
- Distance function to use
-
-
Method Detail
-
getKNN
public KNNList getKNN(O obj, int k)
Description copied from interface:KNNSearcher
Get the k nearest neighbors for a particular object.- Specified by:
getKNN
in interfaceKNNSearcher<O>
- Parameters:
obj
- query objectk
- Number of neighbors requested- Returns:
- neighbors
-
-