1function test11
2%TEST11 test cs_rowcnt
3%
4% Example:
5%   test11
6% See also: testall
7
8% Copyright 2006-2012, Timothy A. Davis, http://www.suitesparse.com
9
10index = ssget ;
11[ignore f] = sort (max (index.nrows, index.ncols)) ;
12f = f (1:200) ;
13
14for i = f
15    Prob = ssget (i, index) ;
16    disp (Prob) ;
17    A = Prob.A ;
18    [m n] = size (A) ;
19    if (m ~= n)
20        continue
21    end
22
23    A = spones (A) ;
24    A = A+A' + speye(n) ;
25
26    if (~ispc)
27        if (rand ( ) > .5)
28            A = A + 1i * sprand (A) ;
29        end
30    end
31
32    [cc h pa po R] = symbfact (A) ;
33    rc1 = full (sum (R)) ;
34    rc2 = cs_rowcnt (A, pa, po) ;
35    if (any (rc1 ~= rc2))
36        error ('!') ;
37    end
38
39    try
40        p = amd (A) ;
41    catch
42        p = symamd (A) ;
43    end
44    A = A (p,p) ;
45
46    [cc h pa po R] = symbfact (A) ;
47    rc1 = full (sum (R)) ;
48    rc2 = cs_rowcnt (A, pa, po) ;
49    if (any (rc1 ~= rc2))
50        error ('!') ;
51    end
52
53end
54
55