de.aitools.dm.clustering.dendrogram
Class DendrogramMergeIterator<M extends Merge>

java.lang.Object
  extended by de.aitools.dm.clustering.dendrogram.DendrogramMergeIterator<M>
All Implemented Interfaces:
DendrogramIterator<M>, java.util.Iterator<DendrogramIterator<M>>

public final class DendrogramMergeIterator<M extends Merge>
extends java.lang.Object
implements DendrogramIterator<M>

A DendrogramIterator for Merge ClusterSteps.

Version:
$Id: DendrogramMergeIterator.java,v 1.1 2011/06/22 14:22:51 dogu3912 Exp $
Author:
johannes.kiesel(/\t)uni-weimar.de

Constructor Summary
DendrogramMergeIterator(int numPoints, java.util.List<M> mergeList)
          Create the iterator.
 
Method Summary
 int[] getCurrentAssignments()
          Get the cluster assignment of all points of the input data (data) at the current step
 M getLastChange()
           
 M getNextChange()
           
 int getNumClusters()
           
 boolean hasNext()
           
 DendrogramMergeIterator<M> next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DendrogramMergeIterator

public DendrogramMergeIterator(int numPoints,
                               java.util.List<M> mergeList)
Create the iterator.

Parameters:
numPoints - Number of points that were clustered.
mergeList - The list of merges. The indices of the merged clusters must indices of a point of the cluster in the clustered array.
Method Detail

getCurrentAssignments

public int[] getCurrentAssignments()
Description copied from interface: DendrogramIterator
Get the cluster assignment of all points of the input data (data) at the current step

Specified by:
getCurrentAssignments in interface DendrogramIterator<M extends Merge>
Returns:
Cluster assignment c such that
c[i] = cluster-id of the cluster to which data[i] was assigned.

getLastChange

public M getLastChange()
Specified by:
getLastChange in interface DendrogramIterator<M extends Merge>
Returns:
The last ClusterStep before the current state of cluster assignment.

getNextChange

public M getNextChange()
Specified by:
getNextChange in interface DendrogramIterator<M extends Merge>
Returns:
The ClusterStep that will lead to the next state of cluster assignment.

getNumClusters

public int getNumClusters()
Specified by:
getNumClusters in interface DendrogramIterator<M extends Merge>
Returns:
Current number of clusters.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<DendrogramIterator<M extends Merge>>

next

public DendrogramMergeIterator<M> next()
Specified by:
next in interface java.util.Iterator<DendrogramIterator<M extends Merge>>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<DendrogramIterator<M extends Merge>>