|
||||||||||
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.tree.IndexTree<N,E> de.lmu.ifi.dbs.elki.index.tree.metrical.MetricalIndexTree<O,D,N,E> de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.AbstractMTree<O,D,N,E> de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.AbstractMkTree<O,D,N,E> de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.AbstractMkTreeUnified<O,D,MkMaxTreeNode<O,D>,MkMaxEntry<D>> de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mkmax.MkMaxTree<O,D>
O
- the type of DatabaseObject to be stored in the MkMaxTreeD
- the type of Distance used in the MkMaxTreepublic class MkMaxTree<O,D extends Distance<D>>
MkMaxTree is a metrical index structure based on the concepts of the M-Tree supporting efficient processing of reverse k nearest neighbor queries for parameter k <= k_max. The k-nearest neigbor distance for k = k_max is stored in each entry of a node.
Field Summary | |
---|---|
private static Logging |
logger
The logger for this class. |
private QueryStatistic |
rkNNStatistics
Provides some statistics about performed reverse knn-queries. |
Fields inherited from class de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.AbstractMTree |
---|
distanceFunction, distanceQuery, extraIntegrityChecks |
Fields inherited from class de.lmu.ifi.dbs.elki.index.tree.IndexTree |
---|
dirCapacity, dirMinimum, initialized, leafCapacity, leafMinimum |
Constructor Summary | |
---|---|
MkMaxTree(PageFile<MkMaxTreeNode<O,D>> pagefile,
DistanceQuery<O,D> distanceQuery,
DistanceFunction<O,D> distanceFunction,
int k_max)
Constructor. |
Method Summary | |
---|---|
void |
clearRkNNStatistics()
Clears the values of the statistic for performed rknn queries |
protected MkMaxEntry<D> |
createNewDirectoryEntry(MkMaxTreeNode<O,D> node,
DBID routingObjectID,
D parentDistance)
Creates a new directory entry representing the specified node. |
protected MkMaxTreeNode<O,D> |
createNewDirectoryNode()
Creates a new directory node with the specified capacity. |
protected MkMaxTreeNode<O,D> |
createNewLeafNode()
Creates a new leaf node with the specified capacity. |
protected MkMaxEntry<D> |
createRootEntry()
Creates an entry representing the root node. |
private void |
doReverseKNNQuery(DBID q,
MkMaxTreeNode<O,D> node,
MkMaxEntry<D> node_entry,
List<DistanceResultPair<D>> result)
Performs a reverse k-nearest neighbor query in the specified subtree for the given query object with k = AbstractMkTreeUnified.k_max . |
protected Logging |
getLogger()
Get the (STATIC) logger for this class. |
QueryStatistic |
getRkNNStatistics()
Returns the statistic for performed rknn queries. |
protected void |
initializeCapacities(MkMaxEntry<D> exampleLeaf)
Determines the maximum and minimum number of entries in a node. |
protected void |
kNNdistanceAdjustment(MkMaxEntry<D> entry,
Map<DBID,KNNHeap<D>> knnLists)
Adjusts the knn distance in the subtree of the specified root entry. |
protected void |
preInsert(MkMaxEntry<D> entry)
Adapts the knn distances before insertion of the specified entry. |
private void |
preInsert(MkMaxEntry<D> q,
MkMaxEntry<D> nodeEntry,
KNNHeap<D> knns_q)
Adapts the knn distances before insertion of entry q. |
List<DistanceResultPair<D>> |
reverseKNNQuery(DBID id,
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.metrical.mtreevariants.mktrees.AbstractMkTreeUnified |
---|
createHeader, getKmax, insertAll |
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.AbstractMTree |
---|
batchNN, createEmptyRoot, distance, distance, doKNNQuery, getDistanceFactory, getDistanceFunction, getDistanceQuery, getHeight, getLeaves, getSortedEntries, getSortedEntries, insert, toString |
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.IndexTree |
---|
deleteNode, getFile, getNode, getNode, getPageFileStatistics, getPageID, getPageSize, getRoot, getRootEntry, getRootID, getRootPath, initialize, initialize, initializeFromFile, isRoot, postDelete, writeNode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final Logging logger
private QueryStatistic rkNNStatistics
Constructor Detail |
---|
public MkMaxTree(PageFile<MkMaxTreeNode<O,D>> pagefile, DistanceQuery<O,D> distanceQuery, DistanceFunction<O,D> distanceFunction, int k_max)
pagefile
- Page filedistanceQuery
- Distance querydistanceFunction
- Distance functionk_max
- Maximum value for kMethod Detail |
---|
public List<DistanceResultPair<D>> reverseKNNQuery(DBID id, int k)
AbstractMkTreeUnified.k_max
. Then these candidates are refined
in a second step.
reverseKNNQuery
in class AbstractMkTree<O,D extends Distance<D>,MkMaxTreeNode<O,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
id
- the query object idk
- the number of nearest neighbors to be returned
public QueryStatistic getRkNNStatistics()
public void clearRkNNStatistics()
protected void preInsert(MkMaxEntry<D> entry)
preInsert
in class IndexTree<MkMaxTreeNode<O,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
entry
- the entry to be insertedprotected void kNNdistanceAdjustment(MkMaxEntry<D> entry, Map<DBID,KNNHeap<D>> knnLists)
kNNdistanceAdjustment
in class AbstractMkTreeUnified<O,D extends Distance<D>,MkMaxTreeNode<O,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
entry
- the root entry of the current subtreeknnLists
- a map of knn lists for each leaf entryprivate void doReverseKNNQuery(DBID q, MkMaxTreeNode<O,D> node, MkMaxEntry<D> node_entry, List<DistanceResultPair<D>> result)
AbstractMkTreeUnified.k_max
. It recursively traverses
all paths from the specified node, which cannot be excluded from leading to
qualififying objects.
q
- the id of the query objectnode
- the node of the subtree on which the query is performednode_entry
- the entry representing the noderesult
- the list for the query resultprivate void preInsert(MkMaxEntry<D> q, MkMaxEntry<D> nodeEntry, KNNHeap<D> knns_q)
q
- the entry to be insertednodeEntry
- the entry representing the root of thge current subtreeknns_q
- the knns of qprotected void initializeCapacities(MkMaxEntry<D> exampleLeaf)
IndexTree
initializeCapacities
in class IndexTree<MkMaxTreeNode<O,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
exampleLeaf
- an object that will be stored in the indexprotected MkMaxTreeNode<O,D> createNewLeafNode()
IndexTree
createNewLeafNode
in class IndexTree<MkMaxTreeNode<O,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
protected MkMaxTreeNode<O,D> createNewDirectoryNode()
IndexTree
createNewDirectoryNode
in class IndexTree<MkMaxTreeNode<O,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
protected MkMaxEntry<D> createNewDirectoryEntry(MkMaxTreeNode<O,D> node, DBID routingObjectID, D parentDistance)
AbstractMTree
createNewDirectoryEntry
in class AbstractMTree<O,D extends Distance<D>,MkMaxTreeNode<O,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
node
- the node to be represented by the new entryroutingObjectID
- the id of the routing object of the nodeparentDistance
- the distance from the routing object of the node to
the routing object of the parent node
protected MkMaxEntry<D> createRootEntry()
IndexTree
createRootEntry
in class IndexTree<MkMaxTreeNode<O,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
new MkMaxDirectoryEntry(null, null, 0, null)
protected Logging getLogger()
IndexTree
getLogger
in class IndexTree<MkMaxTreeNode<O,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |