zeros - Create codistributed array of 0s

Syntax

D = zeros(n, dist)
D = zeros(m, n, dist)
D = zeros([m, n], dist)
D = zeros(..., classname, dist)

Description

D = zeros(n, dist) creates an n-by-n codistributed array of underlying class double. D is distributed by dimension dim, where dim = distributionDimension(dist), and with partition PAR, where PAR = distributionPartition(dist). If dim is unspecified, then D is distributed by its second dimension. If PAR is unspecified, then D uses defaultPartition(n) as its partition. The easiest way to do this is to use a default codistributor where both dim and PAR are unspecified (dist = codistributor()) as input to eye.

D = zeros(m, n, dist) and D = zeros([m, n], dist) create an m-by-n codistributed array of underlying class double. The distribution dimension dim and partition PAR can be specified by dist as above, but if they are not specified, dim is taken to be the last nonsingleton dimension of D, and PAR is provided by defaultPartition over the size in that dimension.

D = zeros(..., classname, dist) optionally specifies the class of the codistributed array D. Valid choices are the same as for the regular zeros function: 'double' (the default), 'single', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', and 'uint64'.

Examples

With four labs,

D = zeros(1000, codistributor())

creates a 1000-by-1000 codistributed double array D, distributed by its second dimension (columns). Each lab contains a 1000-by-250 local piece of D.

D = zeros(10, 10, 'uint16', codistributor('1d', 2, 1:numlabs))

creates a 10-by-10 codistributed uint16 array D, distributed by its columns. Each lab contains a 10-by-labindex local piece of D.

See Also

zeros MATLAB function reference page

cell, eye, false, Inf, NaN, ones, rand, randn, sparse, speye, sprand, sprandn, true

  


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