User`s guide
sparse
11-283
sparse
Create sparse distributed or codistributed matrix
Syntax
SD = sparse(FD)
SC = sparse(m,n,codist)
SC = sparse(m,n,codist,'noCommunication')
SC = sparse(i,j,v,m,n,nzmax)
SC = sparse(i,j,v,m,n)
SC = sparse(i,j,v)
Description
SD = sparse(FD) converts a full distributed or codistributed array FD to a sparse
distributed or codistributed (respectively) array SD.
SC = sparse(m,n,codist) creates an m-by-n sparse codistributed array of underlying
class double, distributed according to the scheme defined by the codistributor codist.
For information on constructing codistributor objects, see the reference pages for
codistributor1d and codistributor2dbc. This form of the syntax is most useful
inside spmd, pmode, or a communicating job.
SC = sparse(m,n,codist,'noCommunication') creates an m-by-n sparse
codistributed array in the manner specified above, but does not perform any global
communication for error checking when constructing the array. This form of the syntax is
most useful inside spmd, pmode, or a communicating job.
SC = sparse(i,j,v,m,n,nzmax) uses vectors i and j to specify indices, and
v to specify element values, for generating an m-by-n sparse matrix such that
SC(i(k),j(k)) = v(k), with space allocated for nzmax nonzeros. If any of the input
vectors i, j, or v is codistributed, the output sparse matrix SC is codistributed. Vectors
i, j, and v must be the same length. Any elements of v that are zero are ignored, along
with the corresponding values of i and j. Any elements of v that have duplicate values of
i and j are added together.