File: sparse2.m

package info (click to toggle)
suitesparse 1%3A5.12.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 176,720 kB
  • sloc: ansic: 1,193,914; cpp: 31,704; makefile: 6,638; fortran: 1,927; java: 1,826; csh: 765; ruby: 725; sh: 529; python: 333; perl: 225; sed: 164; awk: 35
file content (27 lines) | stat: -rw-r--r-- 989 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function S = sparse2 (i,j,s,m,n,nzmax)					    %#ok
%SPARSE2 replacement for SPARSE
%
%   Example:
%   S = sparse2 (i,j,s,m,n,nzmax)
%   
%   Identical to the MATLAB sparse function (just faster).
%   An additional feature is added that is not part of the MATLAB sparse
%   function, the Z matrix.  With an extra output,
%
%   [S Z] = sparse2 (i,j,s,m,n,nzmax)
%
%   the matrix Z is a binary real matrix whose nonzero pattern contains the
%   explicit zero entries that were dropped from S.  Z only contains entries
%   for the sparse2(i,j,s,...) usage.  [S Z]=sparse2(X) where X is full always
%   returns Z with nnz(Z) = 0, as does [S Z]=sparse2(m,n).  More precisely,
%   Z is the following matrix (where ... means the optional m, n, and nzmax
%   parameters).
%
%       S = sparse (i,j,s, ...)
%       Z = spones (sparse (i,j,1, ...)) - spones (S)
%
%   See also sparse.

%   Copyright 2006-2007, Timothy A. Davis, http://www.suitesparse.com

error ('sparse2 mexFunction not found') ;