43 #ifndef IFPACK_IKLU_UTILS_H
44 #define IFPACK_IKLU_UTILS_H
68 csr *csr_add (
const csr *A,
const csr *B,
double alpha,
double beta) ;
69 csr *csr_multiply (
const csr *A,
const csr *B) ;
70 double csr_norm (
const csr *A) ;
71 int csr_print (
const csr *A,
int brief) ;
72 csr *csr_transpose (
const csr *A,
int values) ;
75 void *csr_realloc (
void *p,
int n,
size_t size,
int *ok) ;
78 csr *csr_spalloc (
int m,
int n,
int nzmax,
int values,
int triplet) ;
80 int csr_sprealloc (
csr *A,
int nzmax) ;
117 int *csr_amd (
int order,
const csr *A) ;
119 int csr_droptol (
csr *A,
double tol);
120 int csr_dropzeros (
csr *A);
121 int csr_lsolve (
const csr *L,
double *x);
122 csrn *csr_lu (
const csr *A,
const css *S,
double tol);
123 csr *csr_permute (
const csr *A,
const int *pinv,
const int *q,
int values);
124 css *csr_sqr (
int order,
const csr *A);
125 int csr_usolve (
const csr *U,
double *x);
135 double csr_cumsum (
int *p,
int *c,
int n) ;
136 int csr_dfs (
int j,
csr *G,
int top,
int *xi,
int *pstack,
const int *pinv);
137 int csr_reach (
csr *G,
const csr *B,
int k,
int *xi,
const int *pinv);
138 int csr_scatter (
const csr *A,
int j,
double beta,
int *w,
double *x,
int mark,
141 int csr_spsolve (
csr *G,
const csr *B,
int k,
int *xi,
142 double *x,
const int *pinv,
int up);
143 int csr_tdfs (
int j,
int k,
int *head,
const int *next,
int *post,
146 csrd *csr_dalloc (
int m,
int n);
148 csrd *csr_ddone (
csrd *D,
csr *C,
void *w,
int ok) ;
149 csr *csr_done (
csr *C,
void *w,
void *x,
int ok) ;
150 int *csr_idone (
int *p,
csr *C,
void *w,
int ok) ;
151 csrn *csr_ndone (
csrn *N,
csr *C,
void *w,
void *x,
int ok) ;
153 int csr_fkeep (
csr *A,
int (*fkeep) (
int,
int,
double,
void *),
void *other);
155 #define CS_MAX(a,b) (((a) > (b)) ? (a) : (b))
156 #define CS_MIN(a,b) (((a) < (b)) ? (a) : (b))
157 #define CS_FLIP(i) (-(i)-2)
158 #define CS_UNFLIP(i) (((i) < 0) ? CS_FLIP(i) : (i))
159 #define CS_MARKED(w,j) (w [j] < 0)
160 #define CS_MARK(w,j) { w [j] = CS_FLIP (w [j]) ; }
161 #define CS_CSC(A) (A && (A->nz == -1))
162 #define CS_TRIPLET(A) (A && (A->nz >= 0))
164 #endif // IFPACK_IKLU_UTILS_H