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

« back to all changes in this revision

Viewing changes to CHOLMOD/MATLAB/Test/test2.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 test2
2
 
% test2: test sparse2
 
1
function test2
 
2
%TEST2 test sparse2
 
3
% Example:
 
4
%   test2
 
5
% See also cholmod_test
 
6
 
 
7
% Copyright 2006-2007, Timothy A. Davis, University of Florida
 
8
 
3
9
fprintf ('=================================================================\n');
4
10
fprintf ('test2: test sparse2\n') ;
5
11
 
6
 
i = [ 2 3 ]
7
 
j = [ 3 4 ]
8
 
s = [11.4 9.2] + 1i * [3.4 1.2]
9
 
sparse (i,j,s)
10
 
sparse2 (i,j,s)
 
12
i = [ 2 3 ]                                                                 %#ok
 
13
j = [ 3 4 ]                                                                 %#ok
 
14
s = [11.4 9.2] + 1i * [3.4 1.2]                                             %#ok
 
15
sparse (i,j,s)                                                              %#ok
 
16
sparse2 (i,j,s)                                                             %#ok
11
17
 
12
18
n = 100 ;
13
19
nz = 4000 ;
20
26
nnz(A)
21
27
 
22
28
if (norm (A-B,1) > 1e-14)
23
 
    A_minus_B = A-B
 
29
    A_minus_B = A-B                                                         %#ok
24
30
    error ('!') ;
25
31
end
26
32
 
28
34
D = sparse2 (B) ;
29
35
 
30
36
if (norm (C-D,1) > 1e-14)
31
 
    C_minus_D = C-D
 
37
    C_minus_D = C-D                                                         %#ok
32
38
    error ('!') ;
33
39
end
34
40
% spy(C)