appl.parallel.util
Class PartitionUtil
java.lang.Object
appl.parallel.util.PartitionUtil
public class PartitionUtil
- extends Object
See method description for details.
- Author:
- Dominik Appl
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PartitionUtil
public PartitionUtil()
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 partitionedpartitionBounds
- the rectangle describing the partitionrootID
- 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 insertedgridPartition
- the grid to be insertedpartitionBounds
- the excact location in coordinates of the baseGrid