~logan/ubuntu/trusty/suitesparse/4.2.1-3ubuntu1

« back to all changes in this revision

Viewing changes to CHOLMOD/MATLAB/cholmod_demo.m

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere, Rafael Laboissiere, Ondrej Certik
  • Date: 2008-02-21 14:46:50 UTC
  • mfrom: (1.1.2 upstream) (5.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080221144650-tgeppgj0t7s759i8
Tags: 3.1.0-3
[ Rafael Laboissiere ]
* Upload to unstable

[ Ondrej Certik ]
* XS-DM-Upload-Allowed: yes field added
* Ondrej Certik added to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
% but they are easily generated.  It also compares CHOLMOD and MATLAB on the
7
7
% sparse matrix problem used in the MATLAB BENCH command.
8
8
%
9
 
% See CHOLMOD/MATLAB/Test/test_all.m for a lengthy test using matrices from
 
9
% See CHOLMOD/MATLAB/Test/cholmod_test.m for a lengthy test using matrices from
10
10
% the UF sparse matrix collection.
11
11
%
12
12
% Example:
94
94
X = rand (n,1) ;
95
95
C = sparse (X) ;
96
96
try
 
97
    % use built-in AMD
97
98
    p = amd (S) ;
98
99
catch
99
 
    p = symamd (S) ;
 
100
    try
 
101
        % use AMD from SuiteSparse (../../AMD)
 
102
        p = amd2 (S) ;
 
103
    catch
 
104
        % use SYMAMD
 
105
        p = symamd (S) ;
 
106
    end
100
107
end
101
108
S = S (p,p) ;
102
109