O
- Object typeD
- Distance typepublic class MetricalIndexKNNQuery<O,D extends NumberDistance<D,?>> extends AbstractDistanceKNNQuery<O,D>
Modifier and Type | Field and Description |
---|---|
protected AbstractMTree<O,D,?,?,?> |
index
The index to use
|
distanceQuery
relation
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
MetricalIndexKNNQuery(AbstractMTree<O,D,?,?,?> index,
DistanceQuery<O,D> distanceQuery)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
KNNList<D> |
getKNNForObject(O q,
int k)
Get the k nearest neighbors for a particular id.
|
getKNNForBulkDBIDs, getKNNForDBID
getRelation
protected final AbstractMTree<O,D extends NumberDistance<D,?>,?,?,?> index
public MetricalIndexKNNQuery(AbstractMTree<O,D,?,?,?> index, DistanceQuery<O,D> distanceQuery)
index
- Index to usedistanceQuery
- Distance query usedpublic KNNList<D> getKNNForObject(O q, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<O,D extends NumberDistance<D,?>>
getKNNForObject
in class AbstractDistanceKNNQuery<O,D extends NumberDistance<D,?>>
q
- Query objectk
- Number of neighbors requested