1function test24 2%TEST24 test cs_fielder 3% 4% Example: 5% test24 6% See also: testall 7 8% Copyright 2006-2012, Timothy A. Davis, http://www.suitesparse.com 9 10clear functions 11 12index = ssget ; 13[ignore f] = sort (max (index.nrows, index.ncols)) ; 14f = f (1:200) ; 15 16clf 17% f = f(1) 18 19for k = 1:length (f) 20 21 i = f (k) ; 22 Prob = ssget (i) ; 23 disp (Prob) ; 24 A = real (Prob.A) ; 25 [m n] = size (A) ; 26 if (m ~= n) 27 continue 28 end 29 30 S = A ; 31 32 if (~ispc) 33 if (mod (k,2) == 0) 34 S = S + 1i * sprand (A) ; 35 end 36 end 37 38 tic 39 p1 = symrcm (A) ; 40 t1 = toc ; 41 42 tic 43 p2 = cs_fiedler (S) ; 44 t2 = toc ; 45 46 rel = t2 / max (t1,1e-6) ; 47 48 fprintf ('time: symrcm %8.3f fiedler %8.3f rel %8.2f\n', t1, t2, rel) ; 49 50 A = A|A' ; 51 52 subplot (1,3,1) ; spy (A) ; 53 subplot (1,3,2) ; spy (A (p1,p1)) ; 54 subplot (1,3,3) ; spy (A (p2,p2)) ; 55 56 % evaluate the profile ... 57 58 59 drawnow 60 % pause 61end 62