appl.parallel.util
Class PartitionUtil

java.lang.Object
  extended by appl.parallel.util.PartitionUtil

public class PartitionUtil
extends Object

See method description for details.

Author:
Dominik Appl

Constructor Summary
PartitionUtil()
           
 
Method Summary
static WritableGridPartition getPartitialGrid2D(WritableGrid sourceGrid, Rectangle partitionBounds, int rootID)
          Returns partition of a WritableGrid as a WritableGridArray.
static void setPartition(WritableGrid baseGrid, WritableGrid gridPartition, Rectangle partitionBounds)
          Overwrites the data at the location specified by the Rectangle with the given partition-data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartitionUtil

public PartitionUtil()
Method Detail

getPartitialGrid2D

public static WritableGridPartition getPartitialGrid2D(WritableGrid sourceGrid,
                                                       Rectangle partitionBounds,
                                                       int rootID)
Returns partition of a WritableGrid as a WritableGridArray. Notice, that the minX and minY values are ignored and will be set to 0 (see WritableGrid for more information about minX and minY). If the given WritableGrid is not an instance of WritableGridPartition it is assumed that the topLeft corner of the source grid is (0,0) (like in standard image processing).
If the partition is a WritableGridPartition it is assumed that the the bounds of the two Partition refer to the same coordinate system. Real coordinates are supposed to reference the South(!)-West Corner.

Parameters:
sourceGrid - the grid to be partitioned
partitionBounds - the rectangle describing the partition
rootID - the id to identify the root partition
Returns:
the new partition including the given corners
See Also:
SplittableResource.getRootID()

setPartition

public static void setPartition(WritableGrid baseGrid,
                                WritableGrid gridPartition,
                                Rectangle partitionBounds)
Overwrites the data at the location specified by the Rectangle with the given partition-data. If the given baseGrid is NOT an instance of WritableGridPartition it is assumed that its the topLeft corner (0,0). If it IS a WritableGridPartition it is assumed that the the bounds of the two Partition refer to the same coordinate system and the partition is inserted at the correct absolut position.

Parameters:
baseGrid - the grid in which the data is inserted
gridPartition - the grid to be inserted
partitionBounds - the excact location in coordinates of the baseGrid