1
function S = sparse2 (i,j,s,m,n,nzmax) %#ok
2
%SPARSE2: replacement for SPARSE
3
% S = sparse2 (i,j,s,m,n,nzmax)
5
% Identical to the MATLAB sparse function (just faster).
6
% An additional feature is added that is not part of the MATLAB sparse
7
% function, the Z matrix. With an extra output,
9
% [S Z] = sparse2 (i,j,s,m,n,nzmax)
11
% the matrix Z is a binary real matrix whose nonzero pattern contains the
12
% explicit zero entries that were dropped from S. Z only contains entries
13
% for the sparse2(i,j,s,...) usage. [S Z]=sparse2(X) where X is full always
14
% returns Z with nnz(Z) = 0, as does [S Z]=sparse2(m,n). More precisely,
15
% Z is the following matrix (where ... means the optional m, n, and nzmax
18
% S = sparse (i,j,s, ...)
19
% Z = spones (sparse (i,j,1, ...)) - spones (S)
23
% Copyright 2006, Timothy A. Davis
24
% http://www.cise.ufl.edu/research/sparse
26
error ('sparse2 mexFunction not found') ;