Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants
Class MTreeSplit<O extends DatabaseObject,D extends Distance<D>,N extends AbstractMTreeNode<O,D,N,E>,E extends MTreeEntry<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.metrical.mtreevariants.MTreeSplit<O,D,N,E>
Direct Known Subclasses:
MLBDistSplit, MRadSplit

public abstract class MTreeSplit<O extends DatabaseObject,D extends Distance<D>,N extends AbstractMTreeNode<O,D,N,E>,E extends MTreeEntry<D>>
extends Object

Encapsulates the required parameters for a split of a node in a M-Tree.

Author:
Elke Achtert

Field Summary
(package private)  Assignments<D,E> assignments
          Encapsulates the two promotion objects and their assignments.
 
Constructor Summary
MTreeSplit()
          Creates a new split object.
 
Method Summary
private  D assignNN(Set<E> assigned1, Set<E> assigned2, List<DistanceEntry<D,E>> list, D currentCR, boolean isLeaf)
          Assigns the first object of the specified list to the first assignment that it is not yet assigned to the second assignment.
(package private)  Assignments<D,E> balancedPartition(N node, Integer routingObject1, Integer routingObject2, DistanceFunction<O,D> distanceFunction)
          Creates a balanced partition of the entries of the specified node.
 Assignments<D,E> getAssignments()
          Returns the assignments of this split.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

assignments

Assignments<D extends Distance<D>,E extends MTreeEntry<D>> assignments
Encapsulates the two promotion objects and their assignments.

Constructor Detail

MTreeSplit

public MTreeSplit()
Creates a new split object.

Method Detail

balancedPartition

Assignments<D,E> balancedPartition(N node,
                                   Integer routingObject1,
                                   Integer routingObject2,
                                   DistanceFunction<O,D> distanceFunction)
Creates a balanced partition of the entries of the specified node.

Parameters:
node - the node to be splitted
routingObject1 - the id of the first routing object
routingObject2 - the id of the second routing object
distanceFunction - the distance function to compute the distances
Returns:
an assignment that holds a balanced partition of the entries of the specified node

assignNN

private D assignNN(Set<E> assigned1,
                   Set<E> assigned2,
                   List<DistanceEntry<D,E>> list,
                   D currentCR,
                   boolean isLeaf)
Assigns the first object of the specified list to the first assignment that it is not yet assigned to the second assignment.

Parameters:
assigned1 - the first assignment
assigned2 - the second assignment
list - the list, the first object should be assigned
currentCR - the current covering radius
isLeaf - true, if the node of the entries to be assigned is a leaf, false othwerwise
Returns:
the new covering radius

getAssignments

public Assignments<D,E> getAssignments()
Returns the assignments of this split.

Returns:
the assignments of this split

Release 0.1 (2008-07-10_1838)