83 #define PR(i,format,arg) \
85 if (print >= i && Common->print_function != NULL) \
87 (Common->print_function) (format, arg) ; \
91 #define P1(format,arg) PR(1,format,arg)
92 #define P2(format,arg) PR(2,format,arg)
93 #define P3(format,arg) PR(3,format,arg)
94 #define P4(format,arg) PR(4,format,arg)
98 P1 ("\nCHOLMOD ERROR: %s: ", type) ; \
103 P1 (": %s\n", msg) ; \
104 ERROR (CHOLMOD_INVALID, "invalid") ; \
109 #define PRINTVALUE(value) \
111 if (Common->precise) \
113 P4 (" %23.15e", value) ; \
117 P4 (" %.5g", value) ; \
122 #define ETC_START(count,limit) \
124 count = (init_print == 4) ? (limit) : (-1) ; \
128 #define ETC_ENABLE(condition,count,limit) \
130 if ((condition) && init_print == 4) \
138 #define ETC_DISABLE(count) \
140 if ((count >= 0) && (count-- == 0) && print == 4) \
142 P4 ("%s", " ...\n") ; \
148 #define ETC(condition,count,limit) \
150 ETC_ENABLE (condition, count, limit) ; \
151 ETC_DISABLE (count) ; \
154 #define BOOLSTR(x) ((x) ? "true " : "false")
208 Int i, nrow, nmethods, ordering, xworksize, amd_printed, init_print ;
209 char *type =
"common" ;
233 P1 (
"%s",
"status: OK\n") ;
237 P1 (
"%s",
"status: ERROR, out of memory\n") ;
241 P1 (
"%s",
"status: ERROR, invalid parameter\n") ;
245 P1 (
"%s",
"status: ERROR, problem too large\n") ;
249 P1 (
"%s",
"status: ERROR, method not installed\n") ;
253 P1 (
"%s",
"status: warning, matrix not positive definite\n") ;
257 P1 (
"%s",
"status: warning, diagonal entry has tiny abs. value\n") ;
261 ERR (
"unknown status") ;
265 P3 (
" sizeof(int): %d\n", (
int)
sizeof (
int)) ;
266 P3 (
" sizeof(UF_long): %d\n", (
int)
sizeof (
UF_long)) ;
267 P3 (
" sizeof(void *): %d\n", (
int)
sizeof (
void *)) ;
268 P3 (
" sizeof(double): %d\n", (
int)
sizeof (
double)) ;
269 P3 (
" sizeof(Int): %d (CHOLMOD's basic integer)\n", (
int)
sizeof (
Int)) ;
270 P3 (
" sizeof(BLAS_INT): %d (integer used in the BLAS)\n",
275 P2 (
"%s",
" Results from most recent analysis:\n") ;
276 P2 (
" Cholesky flop count: %.5g\n", Common->
fl) ;
277 P2 (
" Nonzeros in L: %.5g\n", Common->
lnz) ;
281 P2 (
" Update/downdate flop count: %.5g\n", Common->
modfl) ;
284 P2 (
" memory blocks in use: %8.0f\n", (
double) (Common->
malloc_count)) ;
285 P2 (
" memory in use (MB): %8.1f\n",
287 P2 (
" peak memory usage (MB): %8.1f\n",
294 P3 (
" maxrank: update/downdate rank: "ID"\n",
300 P3 (
"%s",
"(always do simplicial)\n") ;
308 P3 (
"%s",
"(always do supernodal)\n") ;
312 nmethods =
MAX (0, nmethods) ;
316 P3 (
"%s",
" nmethods: number of ordering methods to try: ") ;
317 P3 (
""ID"\n", nmethods) ;
321 P3 (
"%s",
" nmethods=0: default strategy: Try user permutation if "
322 "given. Try AMD.\n") ;
326 P3 (
"%s",
" Try NESDIS if AMD reports flops/nnz(L) >= 500 and "
327 "nnz(L)/nnz(A) >= 5.\n") ;
331 P3 (
"%s",
" Try METIS if AMD reports flops/nnz(L) >= 500 and "
332 "nnz(L)/nnz(A) >= 5.\n") ;
335 P3 (
"%s",
" Select best ordering tried.\n") ;
346 amd_printed =
FALSE ;
347 for (i = 0 ; i < nmethods ; i++)
349 P3 (
" method "ID": ", i) ;
357 P3 (
"%s",
"natural\n") ;
361 P3 (
"%s",
"user permutation (if given)\n") ;
365 P3 (
"%s",
"AMD (or COLAMD if factorizing AA')\n") ;
370 P3 (
"%s",
"AMD if factorizing A, COLAMD if factorizing AA')\n");
375 P3 (
"%s",
"METIS_NodeND nested dissection\n") ;
379 P3 (
"%s",
"CHOLMOD nested dissection\n") ;
381 P3 (
" nd_small: # nodes in uncut subgraph: "ID"\n",
383 P3 (
" nd_compress: compress the graph: %s\n",
385 P3 (
" nd_camd: use constrained min degree: %s\n",
391 ERR (
"unknown ordering method") ;
400 P3 (
" prune_dense: for pruning dense nodes: %s\n",
405 P3 (
" prune_dense: for pruning dense nodes: "
408 P3 (
" a dense node has degree "
409 ">= max(16,(%.5g)*sqrt(n))\n",
418 P3 (
" prune_dense2: for pruning dense rows for AA':"
419 " %s\n",
" none pruned") ;
423 P3 (
" prune_dense2: for pruning dense rows for AA':"
425 P3 (
" a dense row has degree "
426 ">= max(16,(%.5g)*sqrt(ncol))\n",
431 if (fl !=
EMPTY)
P3 (
" flop count: %.5g\n", fl) ;
432 if (lnz !=
EMPTY)
P3 (
" nnz(L): %.5g\n", lnz) ;
438 P3 (
"%s",
" backup method: ") ;
439 P3 (
"%s",
"AMD (or COLAMD if factorizing AA')\n") ;
442 if (fl !=
EMPTY)
P3 (
" AMD flop count: %.5g\n", fl) ;
443 if (lnz !=
EMPTY)
P3 (
" AMD nnz(L): %.5g\n", lnz) ;
452 P4 (
"%s",
" final_asis: TRUE, leave as is\n") ;
456 P4 (
"%s",
" final_asis: FALSE, convert when done\n") ;
459 P4 (
"%s",
" final_super: TRUE, leave in supernodal form\n") ;
463 P4 (
"%s",
" final_super: FALSE, convert to simplicial form\n") ;
467 P4 (
"%s",
" final_ll: TRUE, convert to LL' form\n") ;
471 P4 (
"%s",
" final_ll: FALSE, convert to LDL' form\n") ;
475 P4 (
"%s",
" final_pack: TRUE, pack when done\n") ;
479 P4 (
"%s",
" final_pack: FALSE, do not pack when done\n") ;
483 P4 (
"%s",
" final_monotonic: TRUE, ensure L is monotonic\n") ;
488 " final_monotonic: FALSE, do not ensure L is monotonic\n") ;
490 P4 (
" final_resymbol: remove zeros from amalgamation: %s\n",
494 P4 (
" dbound: LDL' diagonal threshold: % .5g\n Entries with abs. value"
495 " less than dbound are replaced with +/- dbound.\n",
498 P4 (
" grow0: memory reallocation: % .5g\n", Common->
grow0) ;
499 P4 (
" grow1: memory reallocation: % .5g\n", Common->
grow1) ;
500 P4 (
" grow2: memory reallocation: %g\n", (
double) (Common->
grow2)) ;
502 P4 (
"%s",
" nrelax, zrelax: supernodal amalgamation rule:\n") ;
503 P4 (
"%s",
" s = # columns in two adjacent supernodes\n") ;
504 P4 (
"%s",
" z = % of zeros in new supernode if they are merged.\n") ;
505 P4 (
"%s",
" Two supernodes are merged if") ;
506 P4 (
" (s <= %g) or (no new zero entries) or\n",
507 (
double) (Common->
nrelax [0])) ;
508 P4 (
" (s <= %g and ", (
double) (Common->
nrelax [1])) ;
509 P4 (
"z < %.5g%%) or", Common->
zrelax [0] * 100) ;
510 P4 (
" (s <= %g and ", (
double) (Common->
nrelax [2])) ;
511 P4 (
"z < %.5g%%) or", Common->
zrelax [1] * 100) ;
512 P4 (
" (z < %.5g%%)\n", Common->
zrelax [2] * 100) ;
518 mark = Common->
mark ;
519 nrow = Common->
nrow ;
520 Flag = Common->
Flag ;
521 Head = Common->
Head ;
524 if (mark < 0 || Flag ==
NULL || Head ==
NULL)
526 ERR (
"workspace corrupted (Flag and/or Head missing)") ;
528 for (i = 0 ; i < nrow ; i++)
530 if (Flag [i] >= mark)
532 PRINT0 ((
"Flag ["ID"]="ID", mark = %ld\n", i, Flag [i], mark)) ;
533 ERR (
"workspace corrupted (Flag)") ;
536 for (i = 0 ; i <= nrow ; i++)
538 if (Head [i] !=
EMPTY)
540 PRINT0 ((
"Head ["ID"] = "ID",\n", i, Head [i])) ;
541 ERR (
"workspace corrupted (Head)") ;
546 Xwork = Common->
Xwork ;
551 ERR (
"workspace corrupted (Xwork missing)") ;
553 for (i = 0 ; i < xworksize ; i++)
557 PRINT0 ((
"Xwork ["ID"] = %g\n", i, Xwork [i])) ;
558 ERR (
"workspace corrupted (Xwork)") ;
614 Int nrow, ncol, nzmax, sorted, packed, j, p, pend, i, nz, ilast,
615 space, init_print, dnz, count, xtype ;
616 char *type =
"sparse" ;
623 P3 (
"%s",
"CHOLMOD sparse: ") ;
648 P3 (
"-by-"ID", ", ncol) ;
649 P3 (
"nz "ID",", nz) ;
652 P3 (
"%s",
" upper.") ;
654 else if (A->
stype < 0)
656 P3 (
"%s",
" lower.") ;
660 P3 (
"%s",
" up/lo.") ;
663 P4 (
"\n nzmax "ID", ", nzmax) ;
666 ERR (
"nzmax too small") ;
672 P4 (
"%s",
"sorted, ") ;
677 P4 (
"%s",
"packed, ") ;
681 case CHOLMOD_INT:
P4 (
"%s",
"\n scalar types: int, ") ; break ;
683 case CHOLMOD_LONG:
P4 (
"%s",
"\n scalar types: UF_long, ") ; break ;
684 default:
ERR (
"unknown itype") ;
693 default:
ERR (
"unknown xtype") ;
700 default:
ERR (
"unknown dtype") ;
705 ERR (
"integer and real type must match routine") ;
708 if (A->
stype && nrow != ncol)
710 ERR (
"symmetric but not square") ;
716 ERR (
"p array not present") ;
720 ERR (
"i array not present") ;
722 if (!packed && Anz ==
NULL)
724 ERR (
"nz array not present") ;
728 ERR (
"x array not present") ;
732 ERR (
"z array not present") ;
736 if (packed && Ap [0] != 0)
738 ERR (
"p [0] must be zero") ;
740 if (packed && (Ap [ncol] < Ap [0] || Ap [ncol] > nzmax))
742 ERR (
"p [ncol] invalid") ;
760 for (i = 0 ; i < nrow ; i++)
774 for (j = 0 ; j < ncol ; j++)
776 ETC (j == ncol-1, count, 4) ;
786 nz =
MAX (0, Anz [j]) ;
790 space = Ap [j+1] - p ;
791 P4 (
" col "ID":", j) ;
792 P4 (
" nz "ID"", nz) ;
793 P4 (
" start "ID"", p) ;
794 P4 (
" end "ID"", pend) ;
797 P4 (
" space "ID"", space) ;
800 if (p < 0 || pend > nzmax)
802 ERR (
"pointer invalid") ;
804 if (nz < 0 || nz > nrow)
810 for ( ; p < pend ; p++)
812 ETC (j == ncol-1 && p >= pend-4, count, -1) ;
822 if (i < 0 || i >= nrow)
824 ERR (
"row index out of range") ;
826 if (sorted && i <= ilast)
828 ERR (
"row indices out of order") ;
830 if (!sorted && Wi [i] == j)
832 ERR (
"duplicate row index") ;
844 P4 (
" nnz on diagonal: "ID"\n", dnz) ;
898 Int i, j, d, nrow, ncol, nzmax, nz, init_print, count, xtype ;
899 char *type =
"dense" ;
906 P3 (
"%s",
"CHOLMOD dense: ") ;
926 P3 (
"-by-"ID", ", ncol) ;
927 P4 (
"\n leading dimension "ID", ", d) ;
928 P4 (
"nzmax "ID", ", nzmax) ;
929 if (d * ncol > nzmax)
931 ERR (
"nzmax too small") ;
935 ERR (
"leading dimension must be >= # of rows") ;
948 default:
ERR (
"unknown xtype") ;
955 default:
ERR (
"unknown dtype") ;
967 for (j = 0 ; j < ncol ; j++)
969 ETC (j == ncol-1, count, 5) ;
970 P4 (
" col "ID":\n", j) ;
971 for (i = 0 ; i < nrow ; i++)
973 ETC (j == ncol-1 && i >= nrow-4, count, -1) ;
1045 Int i, k, init_print, count ;
1046 char *type =
"subset" ;
1048 init_print = print ;
1053 len = (len < 0) ? (-1) : 0 ;
1057 P3 (
"%s",
"CHOLMOD subset: ") ;
1063 P3 (
" len: %ld ", len) ;
1066 P3 (
"%s",
"(denotes 0:n-1) ") ;
1071 if (len <= 0 || S ==
NULL)
1073 P3 (
"%s",
" OK\n") ;
1081 for (k = 0 ; k < ((
Int) len) ; k++)
1083 ETC (k == ((
Int) len) - 4, count, -1) ;
1087 if (i < 0 || i >= ((
Int) n))
1089 ERR (
"entry out range") ;
1095 for (k = 0 ; k < ((
Int) len) ; k++)
1098 if (i < 0 || i >= ((
Int) n))
1100 ERR (
"entry out range") ;
1104 P3 (
"%s",
" OK\n") ;
1173 Int i, k, mark, init_print, count ;
1174 char *type =
"perm" ;
1180 if (Perm ==
NULL || n == 0)
1190 init_print = print ;
1193 if (Wi ==
NULL && n <= Common->nrow)
1197 Flag = Common->
Flag ;
1201 for (k = 0 ; k < ((
Int) len) ; k++)
1203 ETC (k >= ((
Int) len) - 4, count, -1) ;
1207 if (i < 0 || i >= ((
Int) n) || Flag [i] == mark)
1210 ERR (
"invalid permutation") ;
1217 for (k = 0 ; k < ((
Int) len) ; k++)
1220 if (i < 0 || i >= ((
Int) n) || Flag [i] == mark)
1223 ERR (
"invalid permutation") ;
1237 Wi = Common->
Iwork ;
1243 for (i = 0 ; i < ((
Int) n) ; i++)
1249 for (k = 0 ; k < ((
Int) len) ; k++)
1251 ETC (k >= ((
Int) len) - 4, count, -1) ;
1255 if (i < 0 || i >= ((
Int) n) || Wi [i])
1257 ERR (
"invalid permutation") ;
1264 for (k = 0 ; k < ((
Int) len) ; k++)
1267 if (i < 0 || i >= ((
Int) n) || Wi [i])
1269 ERR (
"invalid permutation") ;
1311 print = Common->
print ;
1313 P3 (
"%s",
"CHOLMOD perm: ") ;
1318 P3 (
" len: "ID"", (
Int) len) ;
1324 P3 (
"%s",
" OK\n") ;
1353 Int j, p, init_print, count ;
1354 char *type =
"parent" ;
1356 init_print = print ;
1359 P3 (
"%s",
"CHOLMOD parent: ") ;
1378 for (j = 0 ; j < ((
Int) n) ; j++)
1380 ETC (j == ((
Int) n) - 4, count, -1) ;
1384 if (!(p ==
EMPTY || p > j))
1389 P3 (
"%s",
" OK\n") ;
1440 Int *Lp, *Li, *Lnz, *Lnext, *Lprev, *Perm, *ColCount, *Lpi, *Lpx, *Super,
1442 Int n, nzmax, j, p, pend, i, nz, ordering, space, is_monotonic, minor,
1443 count, precise, init_print, ilast, lnz, head, tail, jprev, plast,
1444 jnext, examine_super, nsuper, s, k1, k2, psi, psend, psx, nsrow, nscol,
1445 ps2, psxend, ssize, xsize, maxcsize, maxesize, nsrow2, jj, ii, xtype ;
1446 char *type =
"factor" ;
1453 P3 (
"%s",
"CHOLMOD factor: ") ;
1476 P3 (
"-by-"ID"", n) ;
1480 P3 (
" not positive definite (column "ID")", minor) ;
1485 case CHOLMOD_INT:
P4 (
"%s",
"\n scalar types: int, ") ; break ;
1487 case CHOLMOD_LONG:
P4 (
"%s",
"\n scalar types: UF_long, ") ; break ;
1488 default:
ERR (
"unknown itype") ;
1497 default:
ERR (
"unknown xtype") ;
1504 default:
ERR (
"unknown dtype") ;
1509 ERR (
"integer and real type must match routine") ;
1514 P3 (
"%s",
" supernodal") ;
1518 P3 (
"%s",
" simplicial") ;
1523 P3 (
"%s",
", LL'.") ;
1527 P3 (
"%s",
", LDL'.") ;
1530 P4 (
"%s",
"\n ordering method used: ") ;
1542 default:
ERR (
"unknown ordering") ;
1547 init_print = print ;
1551 ERR (
"Supernodal zomplex L not supported") ;
1558 if (!
check_perm (Wi, print, name, Perm, n, n, Common))
1567 if (ColCount ==
NULL)
1569 ERR (
"ColCount vector invalid") ;
1573 for (j = 0 ; j < n ; j++)
1575 ETC (j >= n-4, count, -1) ;
1576 P4 (
" col: "ID" ", j) ;
1578 P4 (
"colcount: "ID"\n", nz) ;
1579 if (nz < 0 || nz > n-j)
1581 ERR (
"ColCount out of range") ;
1608 P3 (
" nzmax "ID".", nzmax) ;
1621 ERR (
"p array not present") ;
1625 ERR (
"i array not present") ;
1629 ERR (
"nz array not present") ;
1633 ERR (
"x array not present") ;
1637 ERR (
"z array not present") ;
1641 ERR (
"next array not present") ;
1645 ERR (
"prev array not present") ;
1652 is_monotonic =
TRUE ;
1653 for (j = 0 ; j < n ; j++)
1655 ETC (j >= n-3, count, -1) ;
1661 P4 (
" col "ID":", j) ;
1662 P4 (
" nz "ID"", nz) ;
1663 P4 (
" start "ID"", p) ;
1664 P4 (
" end "ID"", pend) ;
1666 if (Lnext [j] < 0 || Lnext [j] > n)
1668 ERR (
"invalid link list") ;
1670 space = Lp [Lnext [j]] - p ;
1672 P4 (
" space "ID"", space) ;
1673 P4 (
" free "ID":\n", space - nz) ;
1675 if (p < 0 || pend > nzmax || space < 1)
1677 ERR (
"pointer invalid") ;
1679 if (nz < 1 || nz > (n-j) || nz > space)
1681 ERR (
"nz invalid") ;
1687 is_monotonic =
FALSE ;
1695 ERR (
"diagonal missing") ;
1702 for (p++ ; p < pend ; p++)
1707 if (i < j || i >= n)
1709 ERR (
"row index out of range") ;
1713 ERR (
"row indices out of order") ;
1725 ERR (
"columns not monotonic") ;
1736 if (j < 0 || j > n+1 || count > n+2)
1738 ERR (
"invalid link list") ;
1741 if (j >= 0 && j < n)
1743 if (jprev != Lprev [j])
1745 ERR (
"invalid link list") ;
1756 if (Lnext [tail] !=
EMPTY || count != n+2)
1758 ERR (
"invalid link list") ;
1781 P4 (
" ssize "ID" ", ssize) ;
1782 P4 (
"xsize "ID" ", xsize) ;
1783 P4 (
"maxcsize "ID" ", maxcsize) ;
1784 P4 (
"maxesize "ID"\n", maxesize) ;
1788 ERR (
"invalid: L->s missing") ;
1792 ERR (
"invalid: L->pi missing") ;
1796 ERR (
"invalid: L->px missing") ;
1800 ERR (
"invalid: L->super missing") ;
1808 ERR (
"invalid: L->x missing") ;
1810 if (Ls [0] ==
EMPTY)
1812 ERR (
"invalid: L->s not defined") ;
1814 examine_super =
TRUE ;
1819 examine_super = (Ls [0] !=
EMPTY) ;
1824 if (Lpi [0] != 0 ||
MAX (1, Lpi [nsuper]) != ssize)
1827 Lpi [0], nsuper, Lpi [nsuper])) ;
1828 ERR (
"invalid: L->pi invalid") ;
1830 if (Lpx [0] != 0 ||
MAX (1, Lpx [nsuper]) != xsize)
1832 ERR (
"invalid: L->px invalid") ;
1836 for (s = 0 ; s < nsuper ; s++)
1843 nsrow = psend - psi ;
1845 nsrow2 = nsrow - nscol ;
1847 psxend = Lpx [s+1] ;
1849 ETC (s == nsuper-1, count, 4) ;
1851 P4 (
" supernode "ID", ", s) ;
1852 P4 (
"col "ID" ", k1) ;
1853 P4 (
"to "ID". ", k2-1) ;
1854 P4 (
"nz in first col: "ID".\n", nsrow) ;
1855 P4 (
" values start "ID", ", psx) ;
1856 P4 (
"end "ID"\n", psxend) ;
1858 if (k1 > k2 || k1 < 0 || k2 > n || nsrow < nscol || nsrow2 < 0
1859 || psxend - psx != nsrow * nscol)
1861 ERR (
"invalid supernode") ;
1864 lnz += nscol * nsrow - (nscol*nscol - nscol)/2 ;
1869 for (jj = 0 ; jj < nscol ; jj++)
1871 ETC_ENABLE (s == nsuper-1 && jj >= nscol-3, count, -1) ;
1873 P4 (
" col "ID"\n", j) ;
1879 ERR (
"row index invalid") ;
1884 psx + jj + jj*nsrow, Common) ;
1887 for (ii = jj + 1 ; ii < nsrow ; ii++)
1892 if (i <= ilast || i > n)
1894 ERR (
"row index out of range") ;
1899 psx + ii + jj*nsrow, Common) ;
1909 P4 (
" col "ID"\n", k1) ;
1910 for (jj = 0 ; jj < nscol ; jj++)
1912 ETC (s == nsuper-1 && jj >= nscol-3, count, -1) ;
1918 ERR (
"row index invalid") ;
1923 for (ii = nscol ; ii < nsrow ; ii++)
1928 if (i <= ilast || i > n)
1930 ERR (
"row index out of range") ;
1941 P3 (
" nz "ID"", lnz) ;
1942 P3 (
"%s",
" OK\n") ;
1993 Int i, j, p, nrow, ncol, nzmax, nz, xtype, init_print, count ;
1994 char *type =
"triplet" ;
2001 P3 (
"%s",
"CHOLMOD triplet: ") ;
2023 P3 (
" "ID"", nrow) ;
2024 P3 (
"-by-"ID", ", ncol) ;
2025 P3 (
"nz "ID",", nz) ;
2028 P3 (
"%s",
" upper.") ;
2030 else if (T->
stype < 0)
2032 P3 (
"%s",
" lower.") ;
2036 P3 (
"%s",
" up/lo.") ;
2039 P4 (
"\n nzmax "ID", ", nzmax) ;
2042 ERR (
"nzmax too small") ;
2047 case CHOLMOD_INT:
P4 (
"%s",
"\n scalar types: int, ") ; break ;
2049 case CHOLMOD_LONG:
P4 (
"%s",
"\n scalar types: UF_long, ") ; break ;
2050 default:
ERR (
"unknown itype") ;
2059 default:
ERR (
"unknown xtype") ;
2066 default:
ERR (
"unknown dtype") ;
2071 ERR (
"integer and real type must match routine") ;
2074 if (T->
stype && nrow != ncol)
2076 ERR (
"symmetric but not square") ;
2082 ERR (
"j array not present") ;
2086 ERR (
"i array not present") ;
2091 ERR (
"x array not present") ;
2095 ERR (
"z array not present") ;
2102 init_print = print ;
2105 for (p = 0 ; p < nz ; p++)
2107 ETC (p >= nz-4, count, -1) ;
2111 if (i < 0 || i >= nrow)
2113 ERR (
"row index out of range") ;
2117 if (j < 0 || j >= ncol)
2119 ERR (
"column index out of range") ;
2128 P3 (
"%s",
" OK\n") ;
2173 int CHOLMOD(dump_malloc) = -1 ;
2184 f = fopen (
"debug",
"r") ;
2191 fscanf (f,
"%d", &
CHOLMOD(dump)) ;
2194 PRINT1 ((
"%s: cholmod_dump_init, D = %d\n", s,
CHOLMOD(dump))) ;
2221 Wi = malloc (
MAX (1, A->nrow) * sizeof (
Int)) ;
2223 if (Wi !=
NULL) free (Wi) ;
2224 return (ok ? nnzdiag :
EMPTY) ;
2249 Wi = malloc (
MAX (1, L->
n) * sizeof (
Int)) ;
2251 if (Wi !=
NULL) free (Wi) ;
2278 Wi = malloc (
MAX (1, n) *
sizeof (
Int)) ;
2280 if (Wi !=
NULL) free (Wi) ;
2390 PRINT1 ((
"%s: dump_real, nrow: %ld ncol: %ld lower: %d\n",
2391 name, nrow, ncol, lower)) ;
2392 for (j = 0 ; j < ncol ; j++)
2394 PRINT2 ((
" col %ld\n", j)) ;
2395 for (i = 0 ; i < nrow ; i++)
2400 PRINT2 ((
" %5ld: -", i)) ;
2405 PRINT2 ((
" %5ld: %e", i, x)) ;
2431 Int k1, k2, do_values, psi, psx, nsrow, nscol, psend, ilast, p, i ;
2440 do_values = (Lpx !=
NULL) && (Lx !=
NULL) ;
2443 nsrow = psend - psi ;
2444 PRINT1 ((
"\nSuper %ld, columns "ID" to "ID", "ID" rows "ID" cols\n",
2445 s, k1, k2-1, nsrow, nscol)) ;
2447 for (p = psi ; p < psend ; p++)
2450 PRINT2 ((
" "ID
" : p-psi "ID
"\n", i, p-psi)) ;
2452 if (p-psi == nscol-1)
PRINT2 ((
"------\n")) ;
2474 PRINT0 ((
"mem: %-15s peak %10g inuse %10g should %10g\n",
2477 PRINT0 ((
"mem: %s diff %ld !\n", where, diff)) ;
2479 return (diff == 0) ;
2503 Int chek [3], which, ok, i, j, p ;
2504 PRINT1 ((
"bisect sepsize %ld\n", sepsize)) ;
2509 for (j = 0 ; j < n ; j++)
2511 PRINT2 ((
"--------j "ID" in part "ID" nw "ID"\n", j, Part [j], Cnw[j]));
2513 for (p = Cp [j] ; p < Cp [j+1] ; p++)
2516 PRINT3 ((
"i "ID
", part "ID
"\n", i, Part [i])) ;
2521 PRINT0 ((
"Error! "ID
" "ID
"\n", i, j)) ;
2525 else if (which == 1)
2529 PRINT0 ((
"Error! "ID
" "ID
"\n", i, j)) ;
2534 if (which < 0 || which > 2)
2536 PRINT0 ((
"Part out of range\n")) ;
2539 chek [which] += Cnw [j] ;
2542 sepsize, chek[0], chek[1],chek[2]));
2543 if (sepsize != chek[2])
2545 PRINT0 ((
"mismatch!\n")) ;
2570 nrow = Common->
nrow ;
2571 Flag = Common->
Flag ;
2572 Head = Common->
Head ;
2574 mark = Common->
mark ;
2589 for (k = 0 ; k < nrow ; k++)
2591 if (Flag [k] >= mark)
2593 PRINT0 ((
"Flag invalid, Flag ["ID"] = "ID", mark = "ID"\n",
2594 k, Flag [k], mark)) ;
2603 for (k = 0 ; k < nrow ; k++)
2605 if (Head [k] !=
EMPTY)
2607 PRINT0 ((
"Head invalid, Head ["ID"] = "ID"\n", k, Head [k])) ;
2614 for (k = 0 ; k < wsize ; k++)
2618 PRINT0 ((
"W invalid, W ["ID"] = %g\n", k, W [k])) ;
#define CHOLMOD_TOO_LARGE
#define CHOLMOD_SUBSUB_VERSION
void CHOLMOD() dump_init(char *s, cholmod_common *Common)
int CHOLMOD() print_parent(Int *Parent, size_t n, char *name, cholmod_common *Common)
#define CHOLMOD_ARCHITECTURE
#define CHOLMOD_NOT_INSTALLED
UF_long CHOLMOD() nnz(cholmod_sparse *A, cholmod_common *Common)
#define ETC(condition, count, limit)
int CHOLMOD() print_triplet(cholmod_triplet *T, char *name, cholmod_common *Common)
int CHOLMOD() dump_triplet(cholmod_triplet *T, char *name, cholmod_common *Common)
static int check_triplet(Int print, char *name, cholmod_triplet *T, cholmod_common *Common)
int CHOLMOD() dump_subset(Int *S, size_t len, size_t n, char *name, cholmod_common *Common)
static int check_common(Int print, char *name, cholmod_common *Common)
#define RETURN_IF_NULL_COMMON(result)
static int check_factor(Int *Wi, Int print, char *name, cholmod_factor *L, cholmod_common *Common)
static UF_long check_sparse(Int *Wi, Int print, char *name, cholmod_sparse *A, UF_long *nnzdiag, cholmod_common *Common)
#define CHOLMOD_SUB_VERSION
struct cholmod_common_struct::cholmod_method_struct method[CHOLMOD_MAXMETHODS+1]
int CHOLMOD() print_dense(cholmod_dense *X, char *name, cholmod_common *Common)
int CHOLMOD() dump_work(int flag, int head, UF_long wsize, cholmod_common *Common)
static void amesos_print_value(Int print, Int xtype, double *Xx, double *Xz, Int p, cholmod_common *Common)
int CHOLMOD() print_sparse(cholmod_sparse *A, char *name, cholmod_common *Common)
int CHOLMOD() dump_partition(UF_long n, Int *Cp, Int *Ci, Int *Cnw, Int *Part, UF_long sepsize, cholmod_common *Common)
int CHOLMOD() dump_dense(cholmod_dense *X, char *name, cholmod_common *Common)
#define ASSERT(expression)
#define PRINTVALUE(value)
#define ETC_START(count, limit)
int CHOLMOD() dump_perm(Int *Perm, size_t len, size_t n, char *name, cholmod_common *Common)
#define CHOLMOD_POSTORDERED
#define ETC_DISABLE(count)
void CHOLMOD() dump_super(UF_long s, Int *Super, Int *Lpi, Int *Ls, Int *Lpx, double *Lx, int xentry, cholmod_common *Common)
static int check_parent(Int *Parent, size_t n, Int print, char *name, cholmod_common *Common)
#define CHOLMOD_NOT_POSDEF
void CHOLMOD() dump_real(char *name, Real *X, UF_long nrow, UF_long ncol, int lower, int xentry, cholmod_common *Common)
int CHOLMOD() print_perm(Int *Perm, size_t len, size_t n, char *name, cholmod_common *Common)
#define CHOLMOD_OUT_OF_MEMORY
static int check_subset(Int *S, UF_long len, size_t n, Int print, char *name, cholmod_common *Common)
int CHOLMOD() dump_mem(char *where, UF_long should, cholmod_common *Common)
int CHOLMOD() allocate_work(size_t nrow, size_t iworksize, size_t xworksize, cholmod_common *Common)
#define CHOLMOD_MAXMETHODS
static int check_dense(Int print, char *name, cholmod_dense *X, cholmod_common *Common)
#define RETURN_IF_NULL(A, result)
int CHOLMOD() dump_parent(Int *Parent, size_t n, char *name, cholmod_common *Common)
int CHOLMOD() dump_factor(cholmod_factor *L, char *name, cholmod_common *Common)
#define CHOLMOD_SIMPLICIAL
static int check_perm(Int *Wi, Int print, char *name, Int *Perm, size_t len, size_t n, cholmod_common *Common)
UF_long CHOLMOD() clear_flag(cholmod_common *Common)
int CHOLMOD() print_common(char *name, cholmod_common *Common)
int CHOLMOD() print_subset(Int *Set, UF_long len, size_t n, char *name, cholmod_common *Common)
#define ETC_ENABLE(condition, count, limit)
#define CHOLMOD_MAIN_VERSION
int CHOLMOD() print_factor(cholmod_factor *L, char *name, cholmod_common *Common)