public class PreprocessorKNNQuery<O,D extends Distance<D>,T extends KNNList<D>> extends AbstractDataBasedQuery<O> implements KNNQuery<O,D>
Modifier and Type | Field and Description |
---|---|
private AbstractMaterializeKNNPreprocessor<O,D,T> |
preprocessor
The last preprocessor result
|
private boolean |
warned
Warn only once.
|
relation
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
Constructor and Description |
---|
PreprocessorKNNQuery(Relation<O> database,
AbstractMaterializeKNNPreprocessor.Factory<O,D,T> preprocessor)
Constructor.
|
PreprocessorKNNQuery(Relation<O> database,
AbstractMaterializeKNNPreprocessor<O,D,T> preprocessor)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
List<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.
|
KNNList<D> |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id.
|
AbstractMaterializeKNNPreprocessor<O,D,T> |
getPreprocessor()
Get the preprocessor instance.
|
getRelation
private final AbstractMaterializeKNNPreprocessor<O,D extends Distance<D>,T extends KNNList<D>> preprocessor
private boolean warned
public PreprocessorKNNQuery(Relation<O> database, AbstractMaterializeKNNPreprocessor<O,D,T> preprocessor)
database
- Database to querypreprocessor
- Preprocessor instance to usepublic KNNList<D> getKNNForDBID(DBIDRef id, int k)
KNNQuery
public List<KNNList<D>> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
public KNNList<D> getKNNForObject(O obj, int k)
KNNQuery
public AbstractMaterializeKNNPreprocessor<O,D,T> getPreprocessor()