20 #include "klu2_internal.h"
43 template <
typename Entry,
typename Int>
44 Int KLU_valid (Int n, Int
Ap [ ], Int
Ai [ ], Entry Ax [ ])
46 Int nz, j, p1, p2, i, p ;
47 PRINTF ((
"\ncolumn oriented matrix, n = %d\n", n)) ;
50 PRINTF ((
"n must be >= 0: %d\n", n)) ;
54 if (Ap [0] != 0 || nz < 0)
57 PRINTF ((
"column 0 pointer bad or nz < 0\n")) ;
60 for (j = 0 ; j < n ; j++)
64 PRINTF ((
"\nColumn: %d p1: %d p2: %d\n", j, p1, p2)) ;
68 PRINTF ((
"column %d pointer bad\n", j)) ;
71 for (p = p1 ; p < p2 ; p++)
74 PRINTF ((
"row: %d", i)) ;
78 PRINTF ((
"index out of range, col %d row %d\n", j, i)) ;
81 if (Ax != (Entry *) NULL)
83 PRINT_ENTRY (Ax [p]) ;
102 template <
typename Entry,
typename Int>
103 Int KLU_valid_LU (Int n, Int flag_test_start_ptr, Int Xip [ ],
104 Int Xlen [ ], Unit LU [ ])
108 Int j, p1, p2, i, p, len ;
110 PRINTF ((
"\ncolumn oriented matrix, n = %d\n", n)) ;
113 PRINTF ((
"n must be >= 0: %d\n", n)) ;
116 if (flag_test_start_ptr && Xip [0] != 0)
119 PRINTF ((
"column 0 pointer bad\n")) ;
123 for (j = 0 ; j < n ; j++)
127 PRINTF ((
"\nColumn: %d p1: %d p2: %d\n", j, p1, p2)) ;
131 PRINTF ((
"column %d pointer bad\n", j)) ;
134 GET_POINTER (LU, Xip, Xlen, Xi, Xx, j, len) ;
135 for (p = 0 ; p < len ; p++)
138 PRINTF ((
"row: %d", i)) ;
142 PRINTF ((
"index out of range, col %d row %d\n", j, i)) ;
145 if (Xx != (Entry *) NULL)
147 PRINT_ENTRY (Xx [p]) ;
int Ap[]
Column offsets.
Definition: klu2_simple.cpp:52
int Ai[]
Row values.
Definition: klu2_simple.cpp:54