You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
Lindsey Kuper edited this page Feb 12, 2015
·
3 revisions
Description
partition does the opposite of flatten: it creates a ParallelArray of n+1 dimensions from a ParallelArray of n dimensions. However, it is more general than flatten: while flatten collapses two dimensions into one, partition splits the outermost dimension of a ParallelArray into two or more dimensions, depending on the size argument passed to it.
Synopsis
myParallelArray.partition(size)
Arguments
size: the size of each element of the new dimension to be created. The number of elements in the outermost dimension of the ParallelArray on which partition is invoked should be divisible by size.
Returns
A freshly minted ParallelArray where the outermost dimension has been partitioned into multiple ParallelArrays with size elements each.
Examples
varpa=newParallelArray([1,2,3,4]);// create a ParallelArray [[1, 2], [3, 4]], where [1, 2] and [3, 4]// are themselves each ParallelArrays of length twovarpartitionedArray=pa.partition(2);