globalIndices - Global indices for local part of replicated array

Syntax


K = globalIndices(R)
[E,F] = globalIndices(R)
K = globalIndices(R, lab)
[E,F] = globalIndices(R, lab)
K = globalIndices(R, lab, dim)
[E,F] = globalIndices(R, lab, dim)

Description

The global indices for the local part of a replicated array is the index range in a given dimension (by default the distributed dimension is used) for the associated replicated array on a particular lab.

With one input argument and one output argument, K = globalIndices(R) returns a vector K so that localPart(R) = R(...,K,...) on the current lab.

With one input argument and two output arguments, [E,F] = globalIndices(R) returns two integers E and F so that localPart(R) = R(...,E:F,...) on the current lab.

With two input arguments and one output argument K = globalIndices(R, lab) returns a vector K so that localPart(R) = R(...,K,...) on the specified lab.

With two input arguments and two output arguments [E,F] = globalIndices(R, lab) returns two integers E and F so that localPart(R) = R(...,E:F,...) on the specified lab.

With three input arguments and one output argument K = globalIndices(R, lab, dim) returns a vector K so that localPart(R) = R(...,K,...) on the specified lab in the specified dimension dim.

With three input arguments and two output arguments [E,F] = globalIndices(R, lab, dim) returns two integers E and F so that localPart(R) = R(...,E:F,...) on the specified lab in the specified dimension dim.

In all of the above syntax, if the partition is unspecified, K, E, and F are -1.

Examples

Distribute a 2-by-22 array among four labs:

D = distributed(zeros(2, 22), distributor('1d', 2, [6 6 5 5]), 'convert')

On lab 1,

K = globalIndices(D)

returns K = 1:6.

On lab 2,

[E,F] = globalIndices(D)

returns E = 7, F = 12.

K = globalIndices(D, 3)

returns K = 13:17.

[E,F] = globalIndices(D, 4)

returns E = 18, F = 22.

See Also

localPart

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS