|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.index.AbstractIndex<O> de.lmu.ifi.dbs.elki.index.preprocessed.AbstractPreprocessorIndex<O,List<DistanceResultPair<D>>> de.lmu.ifi.dbs.elki.index.preprocessed.knn.AbstractMaterializeKNNPreprocessor<O,D> de.lmu.ifi.dbs.elki.index.preprocessed.knn.MaterializeKNNPreprocessor<O,D> de.lmu.ifi.dbs.elki.index.preprocessed.knn.MaterializeKNNAndRKNNPreprocessor<O,D>
O
- the type of database objects the preprocessor can be applied toD
- the type of distance the used distance function will return@Title(value="Materialize kNN and RkNN Neighborhood preprocessor") @Description(value="Materializes the k nearest neighbors and the reverse k nearest neighbors of objects of a database.") public class MaterializeKNNAndRKNNPreprocessor<O,D extends Distance<D>>
A preprocessor for annotation of the k nearest neighbors and the reverse k nearest neighbors (and their distances) to each database object.
Nested Class Summary | |
---|---|
static class |
MaterializeKNNAndRKNNPreprocessor.Factory<O,D extends Distance<D>>
The parameterizable factory. |
Field Summary | |
---|---|
private static Logging |
logger
Logger to use. |
private WritableDataStore<SortedSet<DistanceResultPair<D>>> |
materialized_RkNN
Additional data storage for RkNN. |
Fields inherited from class de.lmu.ifi.dbs.elki.index.preprocessed.knn.MaterializeKNNPreprocessor |
---|
knnQuery |
Fields inherited from class de.lmu.ifi.dbs.elki.index.preprocessed.knn.AbstractMaterializeKNNPreprocessor |
---|
distanceFunction, distanceQuery, k, listenerList |
Fields inherited from class de.lmu.ifi.dbs.elki.index.preprocessed.AbstractPreprocessorIndex |
---|
storage |
Fields inherited from class de.lmu.ifi.dbs.elki.index.AbstractIndex |
---|
relation |
Constructor Summary | |
---|---|
MaterializeKNNAndRKNNPreprocessor(Relation<O> relation,
DistanceFunction<? super O,D> distanceFunction,
int k)
Constructor. |
Method Summary | ||
---|---|---|
List<DistanceResultPair<D>> |
getKNN(DBID id)
Returns the materialized kNNs of the specified id. |
|
protected Logging |
getLogger()
Get the classes static logger. |
|
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus. |
|
List<DistanceResultPair<D>> |
getRKNN(DBID id)
Returns the materialized RkNNs of the specified id. |
|
|
getRKNNQuery(DistanceQuery<O,S> distanceQuery,
Object... hints)
Get a KNN query object for the given distance query and k. |
|
String |
getShortName()
A short name for the result, useful for file names. |
|
private void |
materializeKNNAndRKNNs(ArrayDBIDs ids,
FiniteProgress progress)
Materializes the kNNs and RkNNs of the specified object IDs. |
|
protected void |
objectsInserted(DBIDs ids)
Called after new objects have been inserted, updates the materialized neighborhood. |
|
protected void |
objectsRemoved(DBIDs ids)
Called after objects have been removed, updates the materialized neighborhood. |
|
protected void |
preprocess()
The actual preprocessing step. |
|
private ArrayDBIDs |
updateKNNsAndRkNNs(DBIDs ids)
Updates the kNNs and RkNNs after insertion of the specified ids. |
Methods inherited from class de.lmu.ifi.dbs.elki.index.preprocessed.knn.MaterializeKNNPreprocessor |
---|
addKNNListener, delete, deleteAll, extractAndRemoveIDs, fireKNNsInserted, fireKNNsRemoved, get, insert, insertAll, removeKNNListener |
Methods inherited from class de.lmu.ifi.dbs.elki.index.preprocessed.knn.AbstractMaterializeKNNPreprocessor |
---|
getDistanceFactory, getDistanceQuery, getK, getKNNQuery |
Methods inherited from class de.lmu.ifi.dbs.elki.index.AbstractIndex |
---|
getPageFileStatistics |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.index.Index |
---|
delete, deleteAll, getPageFileStatistics, insert, insertAll |
Field Detail |
---|
private static final Logging logger
private WritableDataStore<SortedSet<DistanceResultPair<D extends Distance<D>>>> materialized_RkNN
Constructor Detail |
---|
public MaterializeKNNAndRKNNPreprocessor(Relation<O> relation, DistanceFunction<? super O,D> distanceFunction, int k)
relation
- Relation to processdistanceFunction
- the distance function to usek
- query kMethod Detail |
---|
protected void preprocess()
MaterializeKNNPreprocessor
preprocess
in class MaterializeKNNPreprocessor<O,D extends Distance<D>>
private void materializeKNNAndRKNNs(ArrayDBIDs ids, FiniteProgress progress)
ids
- the IDs of the objectsprotected void objectsInserted(DBIDs ids)
MaterializeKNNPreprocessor
objectsInserted
in class MaterializeKNNPreprocessor<O,D extends Distance<D>>
ids
- the ids of the newly inserted objectsprivate ArrayDBIDs updateKNNsAndRkNNs(DBIDs ids)
ids
- the ids of newly inserted objects causing a change of
materialized kNNs and RkNNs
protected void objectsRemoved(DBIDs ids)
MaterializeKNNPreprocessor
objectsRemoved
in class MaterializeKNNPreprocessor<O,D extends Distance<D>>
ids
- the ids of the removed objectspublic List<DistanceResultPair<D>> getKNN(DBID id)
id
- the query id
public List<DistanceResultPair<D>> getRKNN(DBID id)
id
- the query id
public <S extends Distance<S>> RKNNQuery<O,S> getRKNNQuery(DistanceQuery<O,S> distanceQuery, Object... hints)
RKNNIndex
getRKNNQuery
in interface RKNNIndex<O>
S
- Distance typedistanceQuery
- Distance queryhints
- Hints for the optimizer
null
public String getLongName()
Result
getLongName
in interface Result
getLongName
in class MaterializeKNNPreprocessor<O,D extends Distance<D>>
public String getShortName()
Result
getShortName
in interface Result
getShortName
in class MaterializeKNNPreprocessor<O,D extends Distance<D>>
protected Logging getLogger()
AbstractPreprocessorIndex
getLogger
in class MaterializeKNNPreprocessor<O,D extends Distance<D>>
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |