~ubuntu-branches/ubuntu/natty/suitesparse/natty

« back to all changes in this revision

Viewing changes to CHOLMOD/MATLAB/sparse2.m

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2006-12-22 10:16:15 UTC
  • Revision ID: james.westby@ubuntu.com-20061222101615-2ohaj8902oix2rnk
Tags: upstream-2.3.1
ImportĀ upstreamĀ versionĀ 2.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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)
 
4
%   
 
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,
 
8
%
 
9
%   [S Z] = sparse2 (i,j,s,m,n,nzmax)
 
10
%
 
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
 
16
%   parameters).
 
17
%
 
18
%       S = sparse (i,j,s, ...)
 
19
%       Z = spones (sparse (i,j,1, ...)) - spones (S)
 
20
%
 
21
%   See also sparse.
 
22
 
 
23
%   Copyright 2006, Timothy A. Davis
 
24
%   http://www.cise.ufl.edu/research/sparse
 
25
 
 
26
error ('sparse2 mexFunction not found') ;