Class MTreeKNNByDBID<O>
- java.lang.Object
-
- elki.index.tree.metrical.mtreevariants.query.MTreeKNNByDBID<O>
-
- Type Parameters:
O- Object type
- All Implemented Interfaces:
KNNSearcher<DBIDRef>
public class MTreeKNNByDBID<O> extends java.lang.Object implements KNNSearcher<DBIDRef>
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>distanceQueryHold the distance function to be used.protected AbstractMTree<O,?,?,?>indexThe index to use
-
Constructor Summary
Constructors Constructor Description MTreeKNNByDBID(AbstractMTree<O,?,?,?> index, DistanceQuery<O> distanceQuery)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KNNListgetKNN(DBIDRef 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
-
MTreeKNNByDBID
public MTreeKNNByDBID(AbstractMTree<O,?,?,?> index, DistanceQuery<O> distanceQuery)
Constructor.- Parameters:
index- Index to usedistanceQuery- Distance query used
-
-
Method Detail
-
getKNN
public KNNList getKNN(DBIDRef q, int k)
Description copied from interface:KNNSearcherGet the k nearest neighbors for a particular object.- Specified by:
getKNNin interfaceKNNSearcher<O>- Parameters:
q- query objectk- Number of neighbors requested- Returns:
- neighbors
-
-