Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.preprocessing
Class SpatialApproximationMaterializeKNNPreprocessor<O extends NumberVector<O,?>,D extends Distance<D>,N extends SpatialNode<N,E>,E extends SpatialEntry>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.preprocessing.MaterializeKNNPreprocessor<O,D>
              extended by de.lmu.ifi.dbs.elki.preprocessing.SpatialApproximationMaterializeKNNPreprocessor<O,D,N,E>
Type Parameters:
O - the type of database objects the preprocessor can be applied to
D - the type of distance the used distance function will return
N - the type of spatial nodes in the spatial index
E - the type of spatial entries in the spatial index
All Implemented Interfaces:
Preprocessor<O>, Parameterizable

public class SpatialApproximationMaterializeKNNPreprocessor<O extends NumberVector<O,?>,D extends Distance<D>,N extends SpatialNode<N,E>,E extends SpatialEntry>
extends MaterializeKNNPreprocessor<O,D>

A preprocessor for annotation of the k nearest neighbors (and their distances) to each database object. Used for example by LOF.

Author:
Erich Schubert

Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.preprocessing.MaterializeKNNPreprocessor
DISTANCE_FUNCTION_ID, DISTANCE_FUNCTION_PARAM, distanceFunction, k, K_ID, materialized
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
SpatialApproximationMaterializeKNNPreprocessor()
          Provides a k nearest neighbors Preprocessor.
 
Method Summary
private  SpatialIndexDatabase<O,N,E> getSpatialDatabase(Database<O> database)
          Do some (limited) type checking, then cast the database into a spatial database.
 void run(Database<O> database, boolean verbose, boolean time)
          Annotates the nearest neighbors based on the values of MaterializeKNNPreprocessor.k and MaterializeKNNPreprocessor.distanceFunction to each database object.
 String shortDescription()
          Provides a short description of the purpose of this class.
 
Methods inherited from class de.lmu.ifi.dbs.elki.preprocessing.MaterializeKNNPreprocessor
getMaterialized, setParameters
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
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.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters
 

Constructor Detail

SpatialApproximationMaterializeKNNPreprocessor

public SpatialApproximationMaterializeKNNPreprocessor()
Provides a k nearest neighbors Preprocessor.

Method Detail

run

public void run(Database<O> database,
                boolean verbose,
                boolean time)
Annotates the nearest neighbors based on the values of MaterializeKNNPreprocessor.k and MaterializeKNNPreprocessor.distanceFunction to each database object.

Specified by:
run in interface Preprocessor<O extends NumberVector<O,?>>
Overrides:
run in class MaterializeKNNPreprocessor<O extends NumberVector<O,?>,D extends Distance<D>>
Parameters:
database - the database for which the preprocessing is performed
verbose - flag to allow verbose messages while performing the algorithm
time - flag to request output of performance time

getSpatialDatabase

private SpatialIndexDatabase<O,N,E> getSpatialDatabase(Database<O> database)
                                                                                                                        throws IllegalStateException
Do some (limited) type checking, then cast the database into a spatial database.

Parameters:
database - Database
Returns:
Spatial database.
Throws:
IllegalStateException - when the cast fails.

shortDescription

public String shortDescription()
Provides a short description of the purpose of this class.

Specified by:
shortDescription in interface Parameterizable
Overrides:
shortDescription in class MaterializeKNNPreprocessor<O extends NumberVector<O,?>,D extends Distance<D>>
Returns:
Description of the class

Release 0.2.1 (2009-07-13_1605)