at.dms.kjc.sir.lowering.partition
Class PartitionGroup

java.lang.Object
  extended by at.dms.kjc.sir.lowering.partition.PartitionGroup

public class PartitionGroup
extends Object

This represents a partitioning of the children of a single SIR Container. A PartitionGroup is immutable.


Method Summary
static PartitionGroup createFromArray(int[] partitions)
          Creates a partition group where is formatted as described above.
static PartitionGroup createFromAssignments(List<SIRStream> children, HashMap<Object,Integer> map)
          Given a list of children and a mapping from each child to an Integer denoting the partition, creates a partition group where children mapped to the same integer are allocated to the same partition.
static PartitionGroup createUniformPartition(int n)
          Create a uniform partition with one child in each.
 int get(int i)
          Returns the size of the i'th partition in this.
 int getFirst(int k)
          Returns the index of the first child in the k'th partition.
 int getLast(int k)
          Returns the index of the last child in the k'th partition.
 int getNumChildren()
          Returns the number of children accounted for in this partitioning.
 int getPartForChild(int k)
          Returns which partition the k'th child belongs to.
 int size()
          Returns number of partitions in this.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createFromArray

public static PartitionGroup createFromArray(int[] partitions)
Creates a partition group where is formatted as described above. Will end up sharing in the representation of the new object.


createUniformPartition

public static PartitionGroup createUniformPartition(int n)
Create a uniform partition with one child in each. is number of children.


createFromAssignments

public static PartitionGroup createFromAssignments(List<SIRStream> children,
                                                   HashMap<Object,Integer> map)
Given a list of children and a mapping from each child to an Integer denoting the partition, creates a partition group where children mapped to the same integer are allocated to the same partition. Treats -1 as an indicator that a child should not be fused with any neighbors. Requires that all of the children are keys in .


size

public int size()
Returns number of partitions in this.


get

public int get(int i)
Returns the size of the i'th partition in this.


getFirst

public int getFirst(int k)
Returns the index of the first child in the k'th partition.


getLast

public int getLast(int k)
Returns the index of the last child in the k'th partition.


getPartForChild

public int getPartForChild(int k)
Returns which partition the k'th child belongs to. Requires k

getNumChildren

public int getNumChildren()
Returns the number of children accounted for in this partitioning.


toString

public String toString()
Overrides:
toString in class Object