O
- Object typeD
- Distance typeT
- Result typepublic abstract class AbstractMaterializeKNNPreprocessor<O,D extends Distance<D>,T extends KNNList<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 KNNList<D>>
The parameterizable factory.
|
Modifier and Type | Field and Description |
---|---|
protected DistanceFunction<? super O,D> |
distanceFunction
The distance function to be used.
|
protected DistanceQuery<O,D> |
distanceQuery
The distance query we used.
|
protected int |
k
The query k value.
|
storage
relation
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.
|
KNNList<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 |
initialize()
Initialize the index.
|
protected abstract void |
preprocess()
Perform the preprocessing step.
|
getLogger
getLongName, getShortName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
logStatistics
getLongName, getShortName
protected 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 KNNList<D> get(DBIDRef id)
id
- Object IDvoid createStorage()
public void initialize()
Index
initialize
in interface Index
public <S extends Distance<S>> KNNQuery<O,S> getKNNQuery(DistanceQuery<O,S> distQ, Object... hints)
KNNIndex
getKNNQuery
in interface KNNIndex<O>
S
- Distance typedistQ
- Distance queryhints
- Hints for the optimizernull