lio.util
Class Partition

java.lang.Object
  extended by lio.util.Partition
Direct Known Subclasses:
HierPartition

public class Partition
extends java.lang.Object

Auxiliar class that allows managing partitions in clustering processes


Field Summary
protected  int numSubsets
          Number of subsets
protected  int[][] partition
          Matrix containing the partitions
 
Constructor Summary
Partition(int size)
          Creates a partition with so many subsets as elements
 
Method Summary
 void merge(int p1, int p2)
          Merges two subsets.
 int numSubsets()
          Return the number of subsets
 int[] partition(int i)
           
 void printPartition()
           
 int size(int i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numSubsets

protected int numSubsets
Number of subsets


partition

protected int[][] partition
Matrix containing the partitions

Constructor Detail

Partition

public Partition(int size)
Creates a partition with so many subsets as elements

Method Detail

merge

public void merge(int p1,
                  int p2)
Merges two subsets. The new subset is placed in the position p1, whereas the last subset is moved to the position p2 compact the data structure.

Parameters:
p1 - First subset to be merged.
p2 - Second subsetto be merged.

numSubsets

public int numSubsets()
Return the number of subsets


partition

public int[] partition(int i)

size

public int size(int i)

printPartition

public void printPartition()