Class MTreeKNNByObject<O>
- java.lang.Object
-
- elki.index.tree.metrical.mtreevariants.query.MTreeKNNByObject<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
KNNSearcher<O>
public class MTreeKNNByObject<O> extends java.lang.Object implements KNNSearcher<O>
Instance of a KNN query for a particular spatial index.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description protected DistanceQuery<O>
distanceQuery
Hold the distance function to be used.protected AbstractMTree<O,?,?,?>
index
The index to use
-
Constructor Summary
Constructors Constructor Description MTreeKNNByObject(AbstractMTree<O,?,?,?> index, DistanceQuery<O> distanceQuery)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KNNList
getKNN(O q, int k)
Get the k nearest neighbors for a particular object.
-
-
-
Field Detail
-
index
protected final AbstractMTree<O,?,?,?> index
The index to use
-
distanceQuery
protected final DistanceQuery<O> distanceQuery
Hold the distance function to be used.
-
-
Constructor Detail
-
MTreeKNNByObject
public MTreeKNNByObject(AbstractMTree<O,?,?,?> index, DistanceQuery<O> distanceQuery)
Constructor.- Parameters:
index
- Index to usedistanceQuery
- Distance query used
-
-
Method Detail
-
getKNN
public KNNList getKNN(O q, int k)
Description copied from interface:KNNSearcher
Get the k nearest neighbors for a particular object.- Specified by:
getKNN
in interfaceKNNSearcher<O>
- Parameters:
q
- query objectk
- Number of neighbors requested- Returns:
- neighbors
-
-