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

« back to all changes in this revision

Viewing changes to CHOLMOD/MATLAB/Test/test3.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
1
function test3
2
 
% test3: test sparse on int8, int16, and logical
 
2
%TEST3 test sparse on int8, int16, and logical
 
3
% Example:
 
4
%   test3
 
5
% See also cholmod_test
 
6
 
 
7
% Copyright 2006-2007, Timothy A. Davis, University of Florida
 
8
 
3
9
fprintf ('=================================================================\n');
4
10
fprintf ('test3: test sparse on int8, int16, and logical\n') ;
5
11
 
6
12
clear all
7
 
c =  ['a' 'b' 0 'd']
 
13
c =  ['a' 'b' 0 'd']                                                        %#ok
8
14
sparse(c)
9
15
sparse2(c)
10
16
sparse(c')
11
17
sparse2(c')
12
18
whos
13
 
nzmax(ans)
 
19
nzmax(ans)  %#ok
14
20
 
15
21
try % this will fail
16
22
    sparse(int8(c))
21
27
 
22
28
sparse2 (int16(c))
23
29
whos
24
 
s = logical(rand(4) > .5)
 
30
s = logical(rand(4) > .5)                                                   %#ok
25
31
sparse (s)
26
32
whos
27
33
sparse2(s)
28
34
whos
29
35
 
30
 
x = rand(4)
31
 
sparse (x > .5)
 
36
x = rand(4)                                                                 %#ok
 
37
sparse (x > .5)                                                             %#ok
32
38
whos
33
 
sparse2 (x > .5)
 
39
sparse2 (x > .5)                                                            %#ok
34
40
whos
35
41
 
36
42
fprintf ('test3 passed\n') ;