public abstract class AbstractDistanceKNNQuery<O,D extends Distance<D>> extends AbstractDataBasedQuery<O> implements KNNQuery<O,D>
Modifier and Type | Field and Description |
---|---|
protected DistanceQuery<O,D> |
distanceQuery
Hold the distance function to be used.
|
relation
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
AbstractDistanceKNNQuery(DistanceQuery<O,D> distanceQuery)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
List<? extends KNNList<D>> |
getKNNForBulkDBIDs(ArrayDBIDs ids,
int k)
Bulk query method
|
KNNList<D> |
getKNNForDBID(DBIDRef id,
int k)
Get the k nearest neighbors for a particular id.
|
abstract KNNList<D> |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id.
|
getRelation
protected DistanceQuery<O,D extends Distance<D>> distanceQuery
public AbstractDistanceKNNQuery(DistanceQuery<O,D> distanceQuery)
distanceQuery
- Distance query usedpublic List<? extends KNNList<D>> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
public KNNList<D> getKNNForDBID(DBIDRef id, int k)
KNNQuery