44 #include "klu2_internal.h"
67 template <
typename Entry,
typename Int>
68 Int KLU_valid (Int n, Int Ap [ ], Int Ai [ ], Entry Ax [ ])
70 Int nz, j, p1, p2, i, p ;
71 PRINTF ((
"\ncolumn oriented matrix, n = %d\n", n)) ;
74 PRINTF ((
"n must be >= 0: %d\n", n)) ;
78 if (Ap [0] != 0 || nz < 0)
81 PRINTF ((
"column 0 pointer bad or nz < 0\n")) ;
84 for (j = 0 ; j < n ; j++)
88 PRINTF ((
"\nColumn: %d p1: %d p2: %d\n", j, p1, p2)) ;
92 PRINTF ((
"column %d pointer bad\n", j)) ;
95 for (p = p1 ; p < p2 ; p++)
98 PRINTF ((
"row: %d", i)) ;
102 PRINTF ((
"index out of range, col %d row %d\n", j, i)) ;
105 if (Ax != (Entry *) NULL)
107 PRINT_ENTRY (Ax [p]) ;
126 template <
typename Entry,
typename Int>
127 Int KLU_valid_LU (Int n, Int flag_test_start_ptr, Int Xip [ ],
128 Int Xlen [ ], Unit LU [ ])
132 Int j, p1, p2, i, p, len ;
134 PRINTF ((
"\ncolumn oriented matrix, n = %d\n", n)) ;
137 PRINTF ((
"n must be >= 0: %d\n", n)) ;
140 if (flag_test_start_ptr && Xip [0] != 0)
143 PRINTF ((
"column 0 pointer bad\n")) ;
147 for (j = 0 ; j < n ; j++)
151 PRINTF ((
"\nColumn: %d p1: %d p2: %d\n", j, p1, p2)) ;
155 PRINTF ((
"column %d pointer bad\n", j)) ;
158 GET_POINTER (LU, Xip, Xlen, Xi, Xx, j, len) ;
159 for (p = 0 ; p < len ; p++)
162 PRINTF ((
"row: %d", i)) ;
166 PRINTF ((
"index out of range, col %d row %d\n", j, i)) ;
169 if (Xx != (Entry *) NULL)
171 PRINT_ENTRY (Xx [p]) ;