
O - Object typeD - Distance typeT - Result typepublic abstract class AbstractMaterializeKNNPreprocessor<O,D extends Distance<D>,T extends KNNResult<D>> extends AbstractPreprocessorIndex<O,T> implements KNNIndex<O>
| Modifier and Type | Class and Description | 
|---|---|
| static class  | AbstractMaterializeKNNPreprocessor.Factory<O,D extends Distance<D>,T extends KNNResult<D>>The parameterizable factory. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected DistanceFunction<? super O,D> | distanceFunctionThe distance function to be used. | 
| protected DistanceQuery<O,D> | distanceQueryThe distance query we used. | 
| protected int | kThe query k value. | 
storagerelation| Constructor and Description | 
|---|
| AbstractMaterializeKNNPreprocessor(Relation<O> relation,
                                  DistanceFunction<? super O,D> distanceFunction,
                                  int k)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| (package private) void | createStorage()Create the default storage. | 
| KNNResult<D> | get(DBIDRef id)Get the k nearest neighbors. | 
| D | getDistanceFactory()Get the distance factory. | 
| DistanceQuery<O,D> | getDistanceQuery()The distance query we used. | 
| int | getK()Get the value of 'k' supported by this preprocessor. | 
| <S extends Distance<S>>  | getKNNQuery(DistanceQuery<O,S> distQ,
           Object... hints)Get a KNN query object for the given distance query and k. | 
| void | insertAll(DBIDs ids)Inserts the specified objects into this index. | 
| protected abstract void | preprocess()Perform the preprocessing step. | 
getLoggerdelete, deleteAll, getLongName, getPageFileStatistics, getShortName, insertclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdelete, deleteAll, getPageFileStatistics, insertgetLongName, getShortNameprotected final int k
protected final DistanceFunction<? super O,D extends Distance<D>> distanceFunction
protected final DistanceQuery<O,D extends Distance<D>> distanceQuery
public AbstractMaterializeKNNPreprocessor(Relation<O> relation, DistanceFunction<? super O,D> distanceFunction, int k)
relation - RelationdistanceFunction - Distance functionk - kpublic D getDistanceFactory()
public DistanceQuery<O,D> getDistanceQuery()
public int getK()
protected abstract void preprocess()
public KNNResult<D> get(DBIDRef id)
id - Object IDvoid createStorage()
public void insertAll(DBIDs ids)
IndexinsertAll in interface IndexinsertAll in class AbstractIndex<O>ids - the objects to be insertedpublic <S extends Distance<S>> KNNQuery<O,S> getKNNQuery(DistanceQuery<O,S> distQ, Object... hints)
KNNIndexgetKNNQuery in interface KNNIndex<O>S - Distance typedistQ - Distance queryhints - Hints for the optimizernull