|
|
|||||||||||||||||||||
| 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.metrical.MetricalIndex<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,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 extends DatabaseObject,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 |
|---|
| Fields inherited from class de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.AbstractMkTree |
|---|
k_max, K_MAX_ID, K_MAX_PARAM |
| Fields inherited from class de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.AbstractMTree |
|---|
DISTANCE_FUNCTION_ID, DISTANCE_FUNCTION_PARAM, extraIntegrityChecks |
| 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 | |
|---|---|
MkTabTree()
Creates a new MkNNTabTree. |
|
| Method Summary | |
|---|---|
protected MkTabEntry<D> |
createNewDirectoryEntry(MkTabTreeNode<O,D> node,
Integer routingObjectID,
D parentDistance)
Creates a new directory entry representing the specified node. |
protected MkTabTreeNode<O,D> |
createNewDirectoryNode(int capacity)
Creates a new directory node with the specified capacity. |
protected MkTabEntry<D> |
createNewLeafEntry(O object,
D parentDistance)
Creates a new leaf entry representing the specified data object in the specified subtree. |
protected MkTabTreeNode<O,D> |
createNewLeafNode(int capacity)
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,
Integer 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 void |
initializeCapacities(O object,
boolean verbose)
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(O object)
Inserts the specified object into this index. |
protected void |
kNNdistanceAdjustment(MkTabEntry<D> entry,
Map<Integer,KNNList<D>> knnLists)
Performs a distance adjustment in the subtree of the specified root entry. |
private List<D> |
knnDistances(Integer objectID)
Returns the knn distance of the object with the specified id. |
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(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.metrical.mtreevariants.mktrees.AbstractMkTree |
|---|
createHeader, insert, setParameters |
| Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.AbstractMTree |
|---|
batchNN, createEmptyRoot, delete, distance, doKNNQuery, getDistanceFunction, getSortedEntries, getSortedEntries, insert, kNNQuery, postDelete, rangeQuery, setDatabase, toString |
| Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.TreeIndex |
|---|
close, getLogicalPageAccess, getNode, getNode, getPhysicalReadAccess, getPhysicalWriteAccess, getRoot, getRootEntry, getRootPath, initialize, initializeFromFile, 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 |
| Constructor Detail |
|---|
public MkTabTree()
| Method Detail |
|---|
protected void preInsert(MkTabEntry<D> entry)
TreeIndex
preInsert in class TreeIndex<O extends DatabaseObject,MkTabTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>entry - the entry to be inserted
UnsupportedOperationException - since insertion of single objects is
not supportedpublic void insert(O object)
Index
object - the vector to be inserted
UnsupportedOperationException - since insertion of single objects is
not supported
public List<DistanceResultPair<D>> reverseKNNQuery(O object,
int k)
MetricalIndex
reverseKNNQuery in class MetricalIndex<O extends DatabaseObject,D extends Distance<D>,MkTabTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>object - the query objectk - the number of nearest neighbors to be returned
protected void initializeCapacities(O object,
boolean verbose)
TreeIndex
initializeCapacities in class TreeIndex<O extends DatabaseObject,MkTabTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>object - an object that will be stored in the indexverbose - flag to allow verbose messages
protected void kNNdistanceAdjustment(MkTabEntry<D> entry,
Map<Integer,KNNList<D>> knnLists)
AbstractMkTree
kNNdistanceAdjustment in class AbstractMkTree<O extends DatabaseObject,D extends Distance<D>,MkTabTreeNode<O extends DatabaseObject,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(int capacity)
TreeIndex
createNewLeafNode in class TreeIndex<O extends DatabaseObject,MkTabTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>capacity - the capacity of the new node
protected MkTabTreeNode<O,D> createNewDirectoryNode(int capacity)
createNewDirectoryNode in class TreeIndex<O extends DatabaseObject,MkTabTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>capacity - the capacity of the new node
protected MkTabEntry<D> createNewLeafEntry(O object,
D parentDistance)
createNewLeafEntry in class AbstractMTree<O extends DatabaseObject,D extends Distance<D>,MkTabTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>object - the data object to be represented by the new entryparentDistance - the distance from the object to the routing object of
the parent node
protected MkTabEntry<D> createNewDirectoryEntry(MkTabTreeNode<O,D> node,
Integer routingObjectID,
D parentDistance)
createNewDirectoryEntry in class AbstractMTree<O extends DatabaseObject,D extends Distance<D>,MkTabTreeNode<O extends DatabaseObject,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 TreeIndex<O extends DatabaseObject,MkTabTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkTabEntry<D extends Distance<D>>>
private void doReverseKNNQuery(int k,
Integer 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 resultprivate List<D> knnDistances(Integer objectID)
objectID - the id of the query object
private List<D> max(List<D> distances1,
List<D> distances2)
distances1 - the first arraydistances2 - the second array
private List<D> initKnnDistanceList()
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||