Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mkmax
Class MkMaxTreeNode<O extends DatabaseObject,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.persistent.AbstractPage<N>
      extended by de.lmu.ifi.dbs.elki.index.tree.AbstractNode<N,E>
          extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.AbstractMTreeNode<O,D,MkMaxTreeNode<O,D>,MkMaxEntry<D>>
              extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.mktrees.mkmax.MkMaxTreeNode<O,D>
Type Parameters:
O - the type of DatabaseObject to be stored in the MkMaxTree
D - the type of Distance used in the MkMaxTree
All Implemented Interfaces:
MetricalNode<MkMaxTreeNode<O,D>,MkMaxEntry<D>>, Node<MkMaxTreeNode<O,D>,MkMaxEntry<D>>, Page<MkMaxTreeNode<O,D>>, Externalizable, Serializable

 class MkMaxTreeNode<O extends DatabaseObject,D extends Distance<D>>
extends AbstractMTreeNode<O,D,MkMaxTreeNode<O,D>,MkMaxEntry<D>>

Represents a node in an MkMaxTree.

Author:
Elke Achtert

Field Summary
private static long serialVersionUID
           
 
Fields inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractNode
eclass, entries, isLeaf, numEntries
 
Constructor Summary
MkMaxTreeNode()
          Empty constructor for Externalizable interface.
MkMaxTreeNode(PageFile<MkMaxTreeNode<O,D>> file, int capacity, boolean isLeaf)
          Creates a new MkMaxTreeNode object.
 
Method Summary
 void adjustEntry(MkMaxEntry<D> entry, Integer routingObjectID, D parentDistance, AbstractMTree<O,D,MkMaxTreeNode<O,D>,MkMaxEntry<D>> mTree)
          Calls the super method and adjust additionally the k-nearest neighbor distance of this node as the maximum of the k-nearest neighbor distances of all its entries.
protected  MkMaxTreeNode<O,D> createNewDirectoryNode(int capacity)
          Creates a new directory node with the specified capacity.
protected  MkMaxTreeNode<O,D> createNewLeafNode(int capacity)
          Creates a new leaf node with the specified capacity.
protected  void integrityCheckParameters(MkMaxEntry<D> parentEntry, MkMaxTreeNode<O,D> parent, int index, AbstractMTree<O,D,MkMaxTreeNode<O,D>,MkMaxEntry<D>> mTree)
          Calls the super method and tests if the k-nearest neighbor distance of this node is correctly set.
protected  D kNNDistance(DistanceFunction<O,D> distanceFunction)
          Determines and returns the k-nearest neighbor distance of this node as the maximum of the k-nearest neighbor distances of all entries.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.AbstractMTreeNode
coveringRadius, integrityCheck, splitEntries
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.AbstractNode
addDirectoryEntry, addLeafEntry, children, deleteAllEntries, deleteEntry, equals, getCapacity, getEntries, getEntry, getNumEntries, increaseEntries, isLeaf, readExternal, toString, writeExternal
 
Methods inherited from class de.lmu.ifi.dbs.elki.persistent.AbstractPage
getFile, getID, hashCode, isDirty, setDirty, setFile, setID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.Node
addDirectoryEntry, addLeafEntry, children, getEntry, getNumEntries, isLeaf
 
Methods inherited from interface de.lmu.ifi.dbs.elki.persistent.Page
getID, isDirty, setDirty, setFile, setID
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

MkMaxTreeNode

public MkMaxTreeNode()
Empty constructor for Externalizable interface.


MkMaxTreeNode

public MkMaxTreeNode(PageFile<MkMaxTreeNode<O,D>> file,
                     int capacity,
                     boolean isLeaf)
Creates a new MkMaxTreeNode object.

Parameters:
file - the file storing the MkMaxTree
capacity - the capacity (maximum number of entries plus 1 for overflow) of this node
isLeaf - indicates whether this node is a leaf node
Method Detail

createNewLeafNode

protected MkMaxTreeNode<O,D> createNewLeafNode(int capacity)
Description copied from class: AbstractNode
Creates a new leaf node with the specified capacity.

Specified by:
createNewLeafNode in class AbstractNode<MkMaxTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
Parameters:
capacity - the capacity of the new node
Returns:
a new MkMaxTreeNode which is a leaf node

createNewDirectoryNode

protected MkMaxTreeNode<O,D> createNewDirectoryNode(int capacity)
Description copied from class: AbstractNode
Creates a new directory node with the specified capacity.

Specified by:
createNewDirectoryNode in class AbstractNode<MkMaxTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
Parameters:
capacity - the capacity of the new node
Returns:
a new MkMaxTreeNode which is a directory node

kNNDistance

protected D kNNDistance(DistanceFunction<O,D> distanceFunction)
Determines and returns the k-nearest neighbor distance of this node as the maximum of the k-nearest neighbor distances of all entries.

Parameters:
distanceFunction - the distance function
Returns:
the knn distance of this node

adjustEntry

public void adjustEntry(MkMaxEntry<D> entry,
                        Integer routingObjectID,
                        D parentDistance,
                        AbstractMTree<O,D,MkMaxTreeNode<O,D>,MkMaxEntry<D>> mTree)
Calls the super method and adjust additionally the k-nearest neighbor distance of this node as the maximum of the k-nearest neighbor distances of all its entries.

Overrides:
adjustEntry in class AbstractMTreeNode<O extends DatabaseObject,D extends Distance<D>,MkMaxTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
Parameters:
entry - the entry representing this node
routingObjectID - the id of the (new) routing object of this node
parentDistance - the distance from the routing object of this node to the routing object of the parent node
mTree - the M-Tree object holding this node

integrityCheckParameters

protected void integrityCheckParameters(MkMaxEntry<D> parentEntry,
                                        MkMaxTreeNode<O,D> parent,
                                        int index,
                                        AbstractMTree<O,D,MkMaxTreeNode<O,D>,MkMaxEntry<D>> mTree)
Calls the super method and tests if the k-nearest neighbor distance of this node is correctly set.

Overrides:
integrityCheckParameters in class AbstractMTreeNode<O extends DatabaseObject,D extends Distance<D>,MkMaxTreeNode<O extends DatabaseObject,D extends Distance<D>>,MkMaxEntry<D extends Distance<D>>>
Parameters:
parentEntry - the entry representing the parent
parent - the parent holding the entry representing this node
index - the index of the entry in the parents child arry
mTree - the M-Tree holding this node

Release 0.2.1 (2009-07-13_1605)