Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.metrical
Class MetricalIndex<O extends DatabaseObject,D extends Distance<D>,N extends MetricalNode<N,E>,E extends MetricalEntry>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.index.tree.TreeIndex<O,N,E>
          extended by de.lmu.ifi.dbs.elki.index.tree.metrical.MetricalIndex<O,D,N,E>
Type Parameters:
O - the type of DatabaseObject to be stored in the metrical index
D - the type of Distance used in the metrical index
N - the type of MetricalNode used in the metrical index
E - the type of MetricalEntry used in the metrical index
All Implemented Interfaces:
Index<O>, Parameterizable
Direct Known Subclasses:
AbstractMTree

public abstract class MetricalIndex<O extends DatabaseObject,D extends Distance<D>,N extends MetricalNode<N,E>,E extends MetricalEntry>
extends TreeIndex<O,N,E>

Abstract super class for all metrical index classes.

Author:
Elke Achtert

Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.index.tree.TreeIndex
CACHE_SIZE_ID, cacheSize, dirCapacity, dirMinimum, file, FILE_ID, initialized, leafCapacity, leafMinimum, PAGE_SIZE_ID, pageSize
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
MetricalIndex(Parameterization config)
          Constructor
 
Method Summary
abstract  DistanceFunction<O,D> getDistanceFunction()
          Returns the distance function of this metrical index.
abstract  List<DistanceResultPair<D>> kNNQuery(O object, int k)
          Performs a k-nearest neighbor query for the given object with the given parameter k and the according distance function.
abstract  List<DistanceResultPair<D>> rangeQuery(O object, D epsilon)
          Performs a range query for the given object with the given epsilon range and the according distance function.
abstract  List<DistanceResultPair<D>> rangeQuery(O object, String epsilon)
          Performs a range query for the given object with the given epsilon range and the according distance function.
abstract  List<DistanceResultPair<D>> reverseKNNQuery(O object, int k)
          Performs a reverse k-nearest neighbor query for the given object ID.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.TreeIndex
close, createEmptyRoot, createHeader, createNewDirectoryNode, createNewLeafNode, createRootEntry, getFileName, getLogicalPageAccess, getNode, getNode, getNodeClass, getPhysicalReadAccess, getPhysicalWriteAccess, getRoot, getRootEntry, getRootPath, initialize, initializeCapacities, initializeFromFile, postDelete, preInsert, resetPageAccess
 
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.index.Index
delete, insert, insert, setDatabase
 

Constructor Detail

MetricalIndex

public MetricalIndex(Parameterization config)
Constructor

Parameters:
config - Configuration
Method Detail

rangeQuery

public abstract List<DistanceResultPair<D>> rangeQuery(O object,
                                                       String epsilon)
Performs a range query for the given object with the given epsilon range and the according distance function. The query result is in ascending order to the distance to the query object.

Parameters:
object - the query object
epsilon - the string representation of the query range
Returns:
a List of the query results

rangeQuery

public abstract List<DistanceResultPair<D>> rangeQuery(O object,
                                                       D epsilon)
Performs a range query for the given object with the given epsilon range and the according distance function. The query result is in ascending order to the distance to the query object.

Parameters:
object - the query object
epsilon - the string representation of the query range
Returns:
a List of the query results

kNNQuery

public abstract List<DistanceResultPair<D>> kNNQuery(O object,
                                                     int k)
Performs a k-nearest neighbor query for the given object with the given parameter k and the according distance function. The query result is in ascending order to the distance to the query object.

Parameters:
object - the query object
k - the number of nearest neighbors to be returned
Returns:
a List of the query results

reverseKNNQuery

public abstract List<DistanceResultPair<D>> reverseKNNQuery(O object,
                                                            int k)
Performs a reverse k-nearest neighbor query for the given object ID. The query result is in ascending order to the distance to the query object.

Parameters:
object - the query object
k - the number of nearest neighbors to be returned
Returns:
a List of the query results

getDistanceFunction

public abstract DistanceFunction<O,D> getDistanceFunction()
Returns the distance function of this metrical index.

Returns:
the distance function of this metrical index

Release 0.3 (2010-03-31_1612)