|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.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,MkTabTreeNode<O,D>,MkTabEntry<D>>
de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mktab.MkTabTree<O,D>
O - Object typeD - Distance typepublic class MkTabTree<O,D extends Distance<D>>

MkTabTree 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 < kmax. All knn distances for k <= kmax are stored in each entry of a node.
| Field Summary | |
|---|---|
private static Logging |
logger
The logger for this class. |
| 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 | |
|---|---|
MkTabTree(PageFile<MkTabTreeNode<O,D>> pagefile,
DistanceQuery<O,D> distanceQuery,
DistanceFunction<O,D> distanceFunction,
int k_max)
Constructor. |
|
| Method Summary | |
|---|---|
protected MkTabEntry<D> |
createNewDirectoryEntry(MkTabTreeNode<O,D> node,
DBID routingObjectID,
D parentDistance)
Creates a new directory entry representing the specified node. |
protected MkTabTreeNode<O,D> |
createNewDirectoryNode()
Creates a new directory node with the specified capacity. |
protected MkTabTreeNode<O,D> |
createNewLeafNode()
Creates a new leaf node with the specified capacity. |
protected MkTabEntry<D> |
createRootEntry()
Creates an entry representing the root node. |
private void |
doReverseKNNQuery(int k,
DBID q,
MkTabEntry<D> node_entry,
MkTabTreeNode<O,D> node,
List<DistanceResultPair<D>> result)
Performs a k-nearest neighbor query in the specified subtree for the given query object and the given parameter k. |
protected Logging |
getLogger()
Get the (STATIC) logger for this class. |
protected void |
initializeCapacities(MkTabEntry<D> exampleLeaf)
Determines the maximum and minimum number of entries in a node. |
private List<D> |
initKnnDistanceList()
Returns a knn distance list with all distances set to null distance. |
void |
insert(MkTabEntry<D> entry,
boolean withPreInsert)
Inserts the specified object into this M-Tree. |
protected void |
kNNdistanceAdjustment(MkTabEntry<D> entry,
Map<DBID,KNNHeap<D>> knnLists)
Performs a distance adjustment in the subtree of the specified root entry. |
private List<D> |
max(List<D> distances1,
List<D> distances2)
Returns an array that holds the maximum values of the both specified arrays in each index. |
protected void |
preInsert(MkTabEntry<D> entry)
Performs necessary operations before inserting the specified entry. |
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, 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
| Constructor Detail |
|---|
public MkTabTree(PageFile<MkTabTreeNode<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 k| Method Detail |
|---|
protected void preInsert(MkTabEntry<D> entry)
IndexTree
preInsert in class IndexTree<MkTabTreeNode<O,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>entry - the entry to be inserted
UnsupportedOperationException - since insertion of single objects is
not supported
public void insert(MkTabEntry<D> entry,
boolean withPreInsert)
AbstractMTree
insert in class AbstractMTree<O,D extends Distance<D>,MkTabTreeNode<O,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>entry - the entry to be insertedwithPreInsert - if this flag is true, the preInsert method will be
called before inserting the object
UnsupportedOperationException - since insertion of single objects is
not supported
public List<DistanceResultPair<D>> reverseKNNQuery(DBID id,
int k)
AbstractMkTree
reverseKNNQuery in class AbstractMkTree<O,D extends Distance<D>,MkTabTreeNode<O,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>id - the query object idk - the number of nearest neighbors to be returned
protected void initializeCapacities(MkTabEntry<D> exampleLeaf)
IndexTree
initializeCapacities in class IndexTree<MkTabTreeNode<O,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>exampleLeaf - an object that will be stored in the index
protected void kNNdistanceAdjustment(MkTabEntry<D> entry,
Map<DBID,KNNHeap<D>> knnLists)
AbstractMkTreeUnified
kNNdistanceAdjustment in class AbstractMkTreeUnified<O,D extends Distance<D>,MkTabTreeNode<O,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>entry - the root entry of the current subtreeknnLists - a map of knn lists for each leaf entryprotected MkTabTreeNode<O,D> createNewLeafNode()
IndexTree
createNewLeafNode in class IndexTree<MkTabTreeNode<O,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>protected MkTabTreeNode<O,D> createNewDirectoryNode()
createNewDirectoryNode in class IndexTree<MkTabTreeNode<O,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>
protected MkTabEntry<D> createNewDirectoryEntry(MkTabTreeNode<O,D> node,
DBID routingObjectID,
D parentDistance)
createNewDirectoryEntry in class AbstractMTree<O,D extends Distance<D>,MkTabTreeNode<O,D extends Distance<D>>,MkTabEntry<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 MkTabEntry<D> createRootEntry()
createRootEntry in class IndexTree<MkTabTreeNode<O,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>
private void doReverseKNNQuery(int k,
DBID q,
MkTabEntry<D> node_entry,
MkTabTreeNode<O,D> node,
List<DistanceResultPair<D>> result)
k - the parameter k of the knn-queryq - the id of the query objectnode_entry - the entry representing the nodenode - the root of the subtreeresult - the list holding the query result
private List<D> max(List<D> distances1,
List<D> distances2)
distances1 - the first arraydistances2 - the second array
private List<D> initKnnDistanceList()
protected Logging getLogger()
IndexTree
getLogger in class IndexTree<MkTabTreeNode<O,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||