|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.index.tree.TreeIndex<O,N,E>
de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialIndex<O,N,E>
de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.AbstractRStarTree<O,N,E>
de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.NonFlatRStarTree<O,RdKNNNode<D,N>,RdKNNEntry<D,N>>
de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.rdknn.RdKNNTree<O,D,N>
O
- Object typeD
- Distance typeN
- Number typepublic class RdKNNTree<O extends NumberVector<O,?>,D extends NumberDistance<D,N>,N extends Number>
RDkNNTree is a spatial index structure based on the concepts of the R*-Tree supporting efficient processing of reverse k nearest neighbor queries. The k-nn distance is stored in each entry of a node.
TODO: noch nicht fertig!!!
Field Summary | |
---|---|
static String |
DEFAULT_DISTANCE_FUNCTION
The default distance function. |
static OptionID |
DISTANCE_FUNCTION_ID
OptionID for DISTANCE_FUNCTION_PARAM |
private ClassParameter<SpatialDistanceFunction<O,D>> |
DISTANCE_FUNCTION_PARAM
Parameter for distance function |
private SpatialDistanceFunction<O,D> |
distanceFunction
The distance function. |
static OptionID |
K_ID
OptionID for K_PARAM |
private int |
k_max
Parameter k. |
private IntParameter |
K_PARAM
Parameter for k |
Fields inherited from class de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.AbstractRStarTree |
---|
extraIntegrityChecks |
Fields inherited from class de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialIndex |
---|
bulk, BULK_LOAD_ID, BULK_LOAD_STRATEGY_ID, bulkLoadStrategy |
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.utilities.optionhandling.AbstractParameterizable |
---|
optionHandler |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug, logger |
Constructor Summary | |
---|---|
RdKNNTree()
Creates a new DeLiClu-Tree. |
Method Summary | ||
---|---|---|
private void |
adjustKNNDistance(RdKNNEntry<D,N> entry,
Map<Integer,KNNList<D>> knnLists)
Adjusts the knn distance in the subtree of the specified root entry. |
|
protected void |
bulkLoad(List<O> objects)
Performs a bulk load on this RTree with the specified data. |
|
protected TreeIndexHeader |
createHeader()
Creates a header for this index structure which is an instance of TreeIndexHeader . |
|
protected RdKNNEntry<D,N> |
createNewDirectoryEntry(RdKNNNode<D,N> node)
Creates a new directory entry representing the specified node. |
|
protected RdKNNNode<D,N> |
createNewDirectoryNode(int capacity)
Creates a new directory node with the specified capacity. |
|
protected RdKNNEntry<D,N> |
createNewLeafEntry(O object)
Creates a new leaf entry representing the specified data object. |
|
protected RdKNNNode<D,N> |
createNewLeafNode(int capacity)
Creates a new leaf node with the specified capacity. |
|
protected RdKNNEntry<D,N> |
createRootEntry()
Creates an entry representing the root node. |
|
private void |
doReverseKNN(RdKNNNode<D,N> node,
O o,
List<DistanceResultPair<D>> result)
Performs a reverse knn query in the specified subtree. |
|
protected void |
initializeCapacities(O object,
boolean verbose)
Determines the maximum and minimum number of entries in a node. |
|
protected void |
postDelete(O o)
Performs necessary operations after deleting the specified object. |
|
protected void |
preInsert(RdKNNEntry<D,N> entry)
Performs necessary operations before inserting the specified entry. |
|
private void |
preInsert(RdKNNEntry<D,N> q,
RdKNNEntry<D,N> nodeEntry,
KNNList<D> knns_q)
Adapts the knn distances before insertion of entry q. |
|
|
reverseKNNQuery(O object,
int k,
SpatialDistanceFunction<O,T> distanceFunction)
Performs a reverse k-nearest neighbor query for the given object ID. |
|
void |
setDatabase(Database<O> database)
Sets the database in the distance function of this index. |
|
List<String> |
setParameters(List<String> args)
todo |
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.NonFlatRStarTree |
---|
computeHeight, createEmptyRoot, hasOverflow, hasUnderflow |
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.AbstractRStarTree |
---|
batchNN, bulkKNNQueryForIDs, clearReinsertions, createLeafNodes, delete, doKNNQuery, findPathToObject, getHeight, getLeaves, getSortedEntries, getSortedEntries, getValues, initializeFromFile, insert, insert, kNNQuery, rangeQuery, setHeight, toString |
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.TreeIndex |
---|
close, getLogicalPageAccess, getNode, getNode, getPhysicalReadAccess, getPhysicalWriteAccess, getRoot, getRootEntry, getRootPath, initialize, resetPageAccess |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription |
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, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription |
Field Detail |
---|
public static final OptionID K_ID
K_PARAM
private final IntParameter K_PARAM
public static final String DEFAULT_DISTANCE_FUNCTION
public static final OptionID DISTANCE_FUNCTION_ID
DISTANCE_FUNCTION_PARAM
private final ClassParameter<SpatialDistanceFunction<O extends NumberVector<O,?>,D extends NumberDistance<D,N>>> DISTANCE_FUNCTION_PARAM
private int k_max
private SpatialDistanceFunction<O extends NumberVector<O,?>,D extends NumberDistance<D,N>> distanceFunction
Constructor Detail |
---|
public RdKNNTree()
Method Detail |
---|
protected void preInsert(RdKNNEntry<D,N> entry)
preInsert
in class TreeIndex<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
entry
- the entry to be insertedprotected void postDelete(O o)
postDelete
in class TreeIndex<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
o
- the object to be deletedprotected void bulkLoad(List<O> objects)
bulkLoad
in class NonFlatRStarTree<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
objects
- the data objects to be indexedpublic <T extends Distance<T>> List<DistanceResultPair<T>> reverseKNNQuery(O object, int k, SpatialDistanceFunction<O,T> distanceFunction)
reverseKNNQuery
in class AbstractRStarTree<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
T
- distance typeobject
- the query objectk
- the number of nearest neighbors to be returneddistanceFunction
- the distance function that computes the distances
between the objects
protected TreeIndexHeader createHeader()
TreeIndex
TreeIndexHeader
. Subclasses may need to overwrite this method if
they need a more specialized header.
createHeader
in class TreeIndex<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
protected void initializeCapacities(O object, boolean verbose)
TreeIndex
initializeCapacities
in class AbstractRStarTree<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
object
- an object that will be stored in the indexverbose
- flag to allow verbose messagespublic List<String> setParameters(List<String> args) throws ParameterException
SpatialIndex
setParameters
in interface Parameterizable
setParameters
in class SpatialIndex<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingpublic void setDatabase(Database<O> database)
setDatabase
in interface Index<O extends NumberVector<O,?>>
setDatabase
in class SpatialIndex<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
database
- the databaseprivate void preInsert(RdKNNEntry<D,N> q, RdKNNEntry<D,N> nodeEntry, KNNList<D> knns_q)
q
- the entry to be insertednodeEntry
- the entry representing the root of the current subtreeknns_q
- the knns of qprivate void doReverseKNN(RdKNNNode<D,N> node, O o, List<DistanceResultPair<D>> result)
node
- the root node of the current subtreeo
- the id of the object for which the rknn query is performedresult
- the list containing the query resultsprivate void adjustKNNDistance(RdKNNEntry<D,N> entry, Map<Integer,KNNList<D>> knnLists)
entry
- the root entry of the current subtreeknnLists
- a map of knn lists for each leaf entryprotected RdKNNNode<D,N> createNewLeafNode(int capacity)
createNewLeafNode
in class TreeIndex<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
capacity
- the capacity of the new node
protected RdKNNNode<D,N> createNewDirectoryNode(int capacity)
createNewDirectoryNode
in class TreeIndex<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
capacity
- the capacity of the new node
protected RdKNNEntry<D,N> createNewLeafEntry(O object)
createNewLeafEntry
in class AbstractRStarTree<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
object
- the data object to be represented by the new entry
protected RdKNNEntry<D,N> createNewDirectoryEntry(RdKNNNode<D,N> node)
createNewDirectoryEntry
in class AbstractRStarTree<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
node
- the node to be represented by the new entry
protected RdKNNEntry<D,N> createRootEntry()
createRootEntry
in class TreeIndex<O extends NumberVector<O,?>,RdKNNNode<D extends NumberDistance<D,N>,N extends Number>,RdKNNEntry<D extends NumberDistance<D,N>,N extends Number>>
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |