public abstract class AbstractDistanceKNNQuery<O> extends java.lang.Object implements KNNQuery<O>
Modifier and Type | Field and Description |
---|---|
protected DistanceQuery<O> |
distanceQuery
Hold the distance function to be used.
|
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
AbstractDistanceKNNQuery(DistanceQuery<O> distanceQuery)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<? extends KNNList> |
getKNNForBulkDBIDs(ArrayDBIDs ids,
int k)
Bulk query method
|
KNNList |
getKNNForDBID(DBIDRef id,
int k)
Get the k nearest neighbors for a particular id.
|
abstract KNNList |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id.
|
protected Relation<? extends O> |
getRelation()
Get the relation to query.
|
protected final DistanceQuery<O> distanceQuery
public AbstractDistanceKNNQuery(DistanceQuery<O> distanceQuery)
distanceQuery
- Distance query usedpublic java.util.List<? extends KNNList> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
getKNNForBulkDBIDs
in interface KNNQuery<O>
ids
- query object IDsk
- Number of neighbors requestedpublic KNNList getKNNForDBID(DBIDRef id, int k)
KNNQuery
getKNNForDBID
in interface KNNQuery<O>
id
- query object IDk
- Number of neighbors requestedprotected Relation<? extends O> getRelation()
public abstract KNNList getKNNForObject(O obj, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<O>
obj
- Query objectk
- Number of neighbors requestedCopyright © 2019 ELKI Development Team. License information.