public class PreprocessorKNNQuery<O,D extends Distance<D>> extends AbstractDataBasedQuery<O> implements KNNQuery<O,D>
Modifier and Type | Field and Description |
---|---|
private MaterializeKNNPreprocessor<O,D> |
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,
MaterializeKNNPreprocessor.Factory<O,D> preprocessor)
Constructor.
|
PreprocessorKNNQuery(Relation<O> database,
MaterializeKNNPreprocessor<O,D> preprocessor)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
D |
getDistanceFactory()
Get the distance data type of the function.
|
DistanceQuery<O,D> |
getDistanceQuery()
Get the distance query for this function.
|
List<List<DistanceResultPair<D>>> |
getKNNForBulkDBIDs(ArrayDBIDs ids,
int k)
Bulk query method
|
void |
getKNNForBulkHeaps(Map<DBID,KNNHeap<D>> heaps)
Bulk query method configured by a map.
|
List<DistanceResultPair<D>> |
getKNNForDBID(DBID id,
int k)
Get the k nearest neighbors for a particular id.
|
List<DistanceResultPair<D>> |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id.
|
AbstractMaterializeKNNPreprocessor<O,D> |
getPreprocessor()
Get the preprocessor instance.
|
getRelation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRelation
private final MaterializeKNNPreprocessor<O,D extends Distance<D>> preprocessor
private boolean warned
public PreprocessorKNNQuery(Relation<O> database, MaterializeKNNPreprocessor<O,D> preprocessor)
database
- Database to querypreprocessor
- Preprocessor instance to usepublic PreprocessorKNNQuery(Relation<O> database, MaterializeKNNPreprocessor.Factory<O,D> preprocessor)
database
- Database to querypreprocessor
- Preprocessor to usepublic List<DistanceResultPair<D>> getKNNForDBID(DBID id, int k)
KNNQuery
public List<List<DistanceResultPair<D>>> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
public void getKNNForBulkHeaps(Map<DBID,KNNHeap<D>> heaps)
KNNQuery
public List<DistanceResultPair<D>> getKNNForObject(O obj, int k)
KNNQuery
public AbstractMaterializeKNNPreprocessor<O,D> getPreprocessor()
public D getDistanceFactory()
KNNQuery
public DistanceQuery<O,D> getDistanceQuery()
KNNQuery