
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 Neighborhood preprocessor") @Description(value="Materializes the k nearest neighbors of objects of a database.") public class MaterializeKNNPreprocessor<O,D extends Distance<D>> extends AbstractMaterializeKNNPreprocessor<O,D,KNNResult<D>>
LOF.| Modifier and Type | Class and Description | 
|---|---|
| static class  | MaterializeKNNPreprocessor.Factory<O,D extends Distance<D>>The parameterizable factory. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected KNNQuery<O,D> | knnQueryKNNQuery instance to use. | 
| protected EventListenerList | listenerListHolds the listener. | 
| private static Logging | LOGLogger to use. | 
| private static boolean | usebulkFlag to use bulk operations. | 
distanceFunction, distanceQuery, kstoragerelation| Constructor and Description | 
|---|
| MaterializeKNNPreprocessor(Relation<O> relation,
                          DistanceFunction<? super O,D> distanceFunction,
                          int k)Constructor with preprocessing step. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addKNNListener(KNNListener l)Adds a  KNNListenerwhich will be invoked when the kNNs of objects
 are changing. | 
| boolean | delete(DBIDRef id)Deletes the specified object from this index. | 
| void | deleteAll(DBIDs ids)Deletes the specified objects from this index. | 
| protected void | fireKNNsInserted(DBIDs insertions,
                DBIDs updates)Informs all registered KNNListener that new kNNs have been inserted and as
 a result some kNNs have been changed. | 
| protected void | fireKNNsRemoved(DBIDs removals,
               DBIDs updates)Informs all registered KNNListener that existing kNNs have been removed and
 as a result some kNNs have been changed. | 
| protected Logging | getLogger()Get the classes static logger. | 
| String | getLongName()A "pretty" name for the result, for use in titles, captions and menus. | 
| String | getShortName()A short name for the result, useful for file names. | 
| void | insert(DBIDRef id)Inserts the specified object into this index. | 
| void | insertAll(DBIDs ids)Inserts the specified objects into this index. | 
| 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. | 
| void | removeKNNListener(KNNListener l)Removes a  KNNListenerpreviously added withaddKNNListener(de.lmu.ifi.dbs.elki.index.preprocessed.knn.KNNListener). | 
| private ArrayDBIDs | updateKNNsAfterDeletion(DBIDs ids)Updates the kNNs of the RkNNs of the specified ids. | 
| private ArrayDBIDs | updateKNNsAfterInsertion(DBIDs ids)Updates the kNNs of the RkNNs of the specified ids. | 
createStorage, get, getDistanceFactory, getDistanceQuery, getK, getKNNQuerygetPageFileStatisticsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPageFileStatisticsprivate static final Logging LOG
private static final boolean usebulk
protected final EventListenerList listenerList
public MaterializeKNNPreprocessor(Relation<O> relation, DistanceFunction<? super O,D> distanceFunction, int k)
relation - Relation to preprocessdistanceFunction - the distance function to usek - query kprotected void preprocess()
preprocess in class AbstractMaterializeKNNPreprocessor<O,D extends Distance<D>,KNNResult<D extends Distance<D>>>public final void insert(DBIDRef id)
Indexinsert in interface Indexinsert in class AbstractIndex<O>id - the object to be insertedpublic void insertAll(DBIDs ids)
Indexpublic boolean delete(DBIDRef id)
Indexdelete in interface Indexdelete in class AbstractIndex<O>id - Object to removepublic void deleteAll(DBIDs ids)
IndexdeleteAll in interface IndexdeleteAll in class AbstractIndex<O>ids - Objects to removeprotected void objectsInserted(DBIDs ids)
ids - the ids of the newly inserted objectsprivate ArrayDBIDs updateKNNsAfterInsertion(DBIDs ids)
ids - the ids of newly inserted objects causing a change of
        materialized kNNsprivate ArrayDBIDs updateKNNsAfterDeletion(DBIDs ids)
ids - the ids of deleted objects causing a change of materialized kNNsprotected void objectsRemoved(DBIDs ids)
ids - the ids of the removed objectsprotected void fireKNNsInserted(DBIDs insertions, DBIDs updates)
insertions - the ids of the newly inserted kNNsupdates - the ids of kNNs which have been changed due to the
        insertionsKNNListenerprotected void fireKNNsRemoved(DBIDs removals, DBIDs updates)
removals - the ids of the removed kNNsupdates - the ids of kNNs which have been changed due to the removalsKNNListenerpublic void addKNNListener(KNNListener l)
KNNListener which will be invoked when the kNNs of objects
 are changing.l - the listener to addremoveKNNListener(de.lmu.ifi.dbs.elki.index.preprocessed.knn.KNNListener), 
KNNListenerpublic void removeKNNListener(KNNListener l)
KNNListener previously added with addKNNListener(de.lmu.ifi.dbs.elki.index.preprocessed.knn.KNNListener)
 .l - the listener to removeaddKNNListener(de.lmu.ifi.dbs.elki.index.preprocessed.knn.KNNListener), 
KNNListenerpublic String getLongName()
ResultgetLongName in interface ResultgetLongName in class AbstractIndex<O>public String getShortName()
ResultgetShortName in interface ResultgetShortName in class AbstractIndex<O>protected Logging getLogger()
AbstractPreprocessorIndex