sparse - Create codistributed sparse matrix

Syntax

D = sparse(m, n, dist)

Description

D = sparse(m, n, dist) creates an m-by-n sparse 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 last nonsingleton dimension, or its second dimension if m and n are both 1 (D is scalar). If PAR is unspecified, then D uses defaultPartition over the size in dimension dim 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 sparse.

Examples

With four labs,

D = sparse(1000, 1000, codistributor())

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

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

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

See Also

sparse MATLAB function reference page

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

  


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