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

« back to all changes in this revision

Viewing changes to CSparse/MATLAB/Demo/cs_demo2.m

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2007-05-29 09:36:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529093629-zowquo0b7slkk6nc
Tags: 3.0.0-2
* suitesparse builds properly twice in a row
* Bug fix: "suitesparse - FTBFS: Broken build depens: libgfortran1-dev",
  thanks to Bastian Blank (Closes: #426349).
* Bug fix: "suitesparse_3.0.0-1: FTBFS: build-depends on
  libgfortran1-dev", thanks to Steve Langasek (Closes: #426354).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function cs_demo2 (do_pause)
2
 
% CS_DEMO2: MATLAB version of the CSparse/Demo/cs_demo2.c program.
 
1
function cs_demo2 (do_pause, matrixpath)
 
2
%CS_DEMO2 MATLAB version of the CSparse/Demo/cs_demo2.c program.
3
3
%   Solves a linear system using Cholesky, LU, and QR, with various orderings.
4
4
%
5
5
% Example:
6
6
%   cs_demo2
7
7
% See also: cs_demo
8
8
 
9
 
%   Copyright 2006, Timothy A. Davis.
 
9
%   Copyright 2006-2007, Timothy A. Davis.
10
10
%   http://www.cise.ufl.edu/research/sparse
11
11
 
 
12
if (nargin < 2)
 
13
    matrixpath = [] ;
 
14
end
 
15
 
 
16
if (isempty (matrixpath))
 
17
    try
 
18
        % older versions of MATLAB do not have an input argument to mfilename
 
19
        p = mfilename ('fullpath') ;
 
20
        t = strfind (p, filesep) ;
 
21
        matrixpath = [ p(1:t(end)) '../../Matrix' ] ;
 
22
    catch
 
23
        % assume we are in the C*Sparse/MATLAB/CSparse/Demo directory
 
24
        matrixpath = '../../Matrix' ;
 
25
    end
 
26
end
 
27
 
12
28
matrices = { 't1', 'HB/fs_183_1', 'HB/west0067', 'LPnetlib/lp_afiro', ...
13
29
'HB/ash219', 'HB/mbeacxc', 'HB/bcsstk01', 'HB/bcsstk16' } ;
14
30
 
18
34
 
19
35
for i = 1:length(matrices)
20
36
    name = matrices {i} ;
21
 
    [C sym] = get_problem (name, 1e-14) ;
 
37
    [C sym] = get_problem (matrixpath, name, 1e-14) ;
22
38
    demo2 (C, sym, name) ;
23
39
    if (do_pause)
24
40
        input ('Hit enter to continue: ') ;