1function test3 2%TEST3 test sparse on int8, int16, and logical 3% Example: 4% test3 5% See also cholmod_test 6 7% Copyright 2007, Timothy A. Davis, http://www.suitesparse.com 8 9fprintf ('=================================================================\n'); 10fprintf ('test3: test sparse on int8, int16, and logical\n') ; 11 12clear all 13c = ['a' 'b' 0 'd'] %#ok 14 15fprintf ('---- char:\n') ; 16sparse2(c) 17nzmax(ans) %#ok 18whos 19 20fprintf ('---- char transposed:\n') ; 21sparse2(c') 22nzmax(ans) %#ok 23whos 24 25fprintf ('---- int8:\n') ; 26sparse2(int8(c)) 27nzmax(ans) %#ok 28whos 29 30fprintf ('---- int16:\n') ; 31sparse2 (int16(c)) 32nzmax(ans) %#ok 33whos 34 35fprintf ('---- logical (using the MATLAB "sparse"):\n') ; 36s = logical(rand(4) > .5) %#ok 37sparse (s) 38nzmax(ans) %#ok 39whos 40 41fprintf ('---- logical (using sparse2):\n') ; 42sparse2(s) 43nzmax(ans) %#ok 44whos 45 46fprintf ('---- double (using the MATLAB "sparse"):\n') ; 47x = rand(4) %#ok 48sparse (x > .5) %#ok 49nzmax(ans) %#ok 50whos 51 52fprintf ('---- double (using sparse2):\n') ; 53sparse2 (x > .5) %#ok 54nzmax(ans) %#ok 55whos 56 57fprintf ('test3 passed\n') ; 58