SuperLU 6.0.1
slu_cdefs.h
Go to the documentation of this file.
1
73#ifndef __SUPERLU_cSP_DEFS /* allow multiple inclusions */
74#define __SUPERLU_cSP_DEFS
75
76/*
77 * File name: csp_defs.h
78 * Purpose: Sparse matrix types and function prototypes
79 * History:
80 */
81
82#ifdef _CRAY
83#include <fortran.h>
84#endif
85
86#include <math.h>
87#include <limits.h>
88#include <stdio.h>
89#include <stdlib.h>
90#include <stdint.h>
91#include <string.h>
92#include "slu_Cnames.h"
93#include "superlu_config.h"
94#include "supermatrix.h"
95#include "slu_util.h"
96#include "slu_scomplex.h"
97
98
99/* -------- Prototypes -------- */
100
101#ifdef __cplusplus
102extern "C" {
103#endif
104
106extern void
107cgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *,
109extern void
110cgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *,
111 char *, float *, float *, SuperMatrix *, SuperMatrix *,
112 void *, int_t lwork, SuperMatrix *, SuperMatrix *,
113 float *, float *, float *, float *,
115 /* ILU */
116extern void
118 SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *);
119extern void
120cgsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r,
121 int *etree, char *equed, float *R, float *C,
122 SuperMatrix *L, SuperMatrix *U, void *work, int_t lwork,
123 SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, float *rcond,
124 GlobalLU_t *Glu, mem_usage_t *mem_usage, SuperLUStat_t *stat, int_t *info);
125
126
128extern void
131extern void
134extern void cCompRow_to_CompCol(int, int, int_t, complex*, int_t*, int_t*,
135 complex **, int_t **, int_t **);
136extern void
138extern void
139cCreate_Dense_Matrix(SuperMatrix *, int, int, complex *, int,
141extern void
143 int_t *, int_t *, int_t *, int *, int *,
145extern void
146cCopy_Dense_Matrix(int, int, complex *, int, complex *, int);
147
148extern void callocateA (int, int_t, complex **, int_t **, int_t **);
149extern void cgstrf (superlu_options_t*, SuperMatrix*,
150 int, int, int*, void *, int_t, int *, int *,
152 SuperLUStat_t*, int_t *info);
153extern int_t csnode_dfs (const int, const int, const int_t *, const int_t *,
154 const int_t *, int_t *, int *, GlobalLU_t *);
155extern int csnode_bmod (const int, const int, const int, complex *,
157extern void cpanel_dfs (const int, const int, const int, SuperMatrix *,
158 int *, int *, complex *, int *, int *, int *,
159 int_t *, int *, int *, int_t *, GlobalLU_t *);
160extern void cpanel_bmod (const int, const int, const int, const int,
161 complex *, complex *, int *, int *,
163extern int ccolumn_dfs (const int, const int, int *, int *, int *, int *,
164 int *, int_t *, int *, int *, int_t *, GlobalLU_t *);
165extern int ccolumn_bmod (const int, const int, complex *,
166 complex *, int *, int *, int,
168extern int ccopy_to_ucol (int, int, int *, int *, int *,
169 complex *, GlobalLU_t *);
170extern int cpivotL (const int, const double, int *, int *,
171 int *, int *, int *, GlobalLU_t *, SuperLUStat_t*);
172extern void cpruneL (const int, const int *, const int, const int,
173 const int *, const int *, int_t *, GlobalLU_t *);
174extern void creadmt (int *, int *, int_t *, complex **, int_t **, int_t **);
175extern void cGenXtrue (int, int, complex *, int);
176extern void cFillRHS (trans_t, int, complex *, int, SuperMatrix *,
177 SuperMatrix *);
178extern void cgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *,
179 SuperMatrix *, SuperLUStat_t*, int *);
180/* ILU */
181extern void cgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*,
182 void *, int_t, int *, int *, SuperMatrix *, SuperMatrix *,
183 GlobalLU_t *, SuperLUStat_t*, int_t *info);
184extern int cldperm(int, int, int_t, int_t [], int_t [], complex [],
185 int [], float [], float []);
186extern int ilu_csnode_dfs (const int, const int, const int_t *, const int_t *,
187 const int_t *, int *, GlobalLU_t *);
188extern void ilu_cpanel_dfs (const int, const int, const int, SuperMatrix *,
189 int *, int *, complex *, float *, int *, int *,
190 int *, int *, int *, int_t *, GlobalLU_t *);
191extern int ilu_ccolumn_dfs (const int, const int, int *, int *, int *,
192 int *, int *, int *, int *, int_t *, GlobalLU_t *);
193extern int ilu_ccopy_to_ucol (int, int, int *, int *, int *,
194 complex *, int, milu_t, double, int,
195 complex *, int *, GlobalLU_t *, float *);
196extern int ilu_cpivotL (const int, const double, int *, int *, int, int *,
197 int *, int *, int *, double, milu_t,
199extern int ilu_cdrop_row (superlu_options_t *, int, int, double,
200 int, int *, double *, GlobalLU_t *,
201 float *, float *, int);
202
203
206extern void cgsequ (SuperMatrix *, float *, float *, float *,
207 float *, float *, int *);
208extern void claqgs (SuperMatrix *, float *, float *, float,
209 float, float, char *);
210extern void cgscon (char *, SuperMatrix *, SuperMatrix *,
211 float, float *, SuperLUStat_t*, int *);
212extern float cPivotGrowth(int, SuperMatrix *, int *,
214extern void cgsrfs (trans_t, SuperMatrix *, SuperMatrix *,
215 SuperMatrix *, int *, int *, char *, float *,
216 float *, SuperMatrix *, SuperMatrix *,
217 float *, float *, SuperLUStat_t*, int *);
218
219extern int sp_ctrsv (char *, char *, char *, SuperMatrix *,
220 SuperMatrix *, complex *, SuperLUStat_t*, int *);
221extern int sp_cgemv (char *, complex, SuperMatrix *, complex *,
222 int, complex, complex *, int);
223
224extern int sp_cgemm (char *, char *, int, int, int, complex,
225 SuperMatrix *, complex *, int, complex,
226 complex *, int);
227extern float smach(char *); /* from C99 standard, in float.h */
228
230extern int_t cLUMemInit (fact_t, void *, int_t, int, int, int_t, int,
231 float, SuperMatrix *, SuperMatrix *,
232 GlobalLU_t *, int **, complex **);
233extern void cSetRWork (int, int, complex *, complex **, complex **);
234extern void cLUWorkFree (int *, complex *, GlobalLU_t *);
235extern int_t cLUMemXpand (int, int_t, MemType, int_t *, GlobalLU_t *);
236
237extern complex *complexMalloc(size_t);
238extern complex *complexCalloc(size_t);
239extern float *floatMalloc(size_t);
240extern float *floatCalloc(size_t);
241extern int_t cmemory_usage(const int_t, const int_t, const int_t, const int);
244
246extern void creadhb(FILE *, int *, int *, int_t *, complex **, int_t **, int_t **);
247extern void creadrb(int *, int *, int_t *, complex **, int_t **, int_t **);
248extern void creadtriple(int *, int *, int_t *, complex **, int_t **, int_t **);
249extern void creadMM(FILE *, int *, int *, int_t *, complex **, int_t **, int_t **);
250extern void cfill (complex *, int, complex);
251extern void cinf_norm_error (int, SuperMatrix *, complex *);
252extern float sqselect(int, float *, int);
253
254
256extern void cPrint_CompCol_Matrix(char *, SuperMatrix *);
257extern void cPrint_SuperNode_Matrix(char *, SuperMatrix *);
258extern void cPrint_Dense_Matrix(char *, SuperMatrix *);
259extern void cprint_lu_col(char *, int, int, int_t *, GlobalLU_t *);
260extern int print_double_vec(char *, int, double *);
261extern void ccheck_tempv(int, complex *);
262
265extern int cgemm_(const char*, const char*, const int*, const int*, const int*,
266 const complex*, const complex*, const int*, const complex*,
267 const int*, const complex*, complex*, const int*);
268extern int ctrsv_(char*, char*, char*, int*, complex*, int*,
269 complex*, int*);
270extern int ctrsm_(char*, char*, char*, char*, int*, int*,
271 complex*, complex*, int*, complex*, int*);
272extern int cgemv_(char *, int *, int *, complex *, complex *a, int *,
273 complex *, int *, complex *, complex *, int *);
274
275extern void cusolve(int, int, complex*, complex*);
276extern void clsolve(int, int, complex*, complex*);
277extern void cmatvec(int, int, int, complex*, complex*, complex*);
278
279#ifdef __cplusplus
280 }
281#endif
282
283#endif /* __SUPERLU_cSP_DEFS */
284
#define X(I)
#define A(I, J)
#define U(I)
Macros defining how C routines will be called.
void cprint_lu_col(char *, int, int, int_t *, GlobalLU_t *)
Diagnostic print of column "jcol" in the U/L factor.
Definition: cutil.c:299
int sp_cgemm(char *, char *, int, int, int, complex, SuperMatrix *, complex *, int, complex, complex *, int)
Definition: csp_blas3.c:126
float * floatMalloc(size_t)
Definition: smemory.c:680
void cmatvec(int, int, int, complex *, complex *, complex *)
Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
Definition: cmyblas2.c:143
void creadtriple(int *, int *, int_t *, complex **, int_t **, int_t **)
Definition: creadtriple.c:25
int ccolumn_bmod(const int, const int, complex *, complex *, int *, int *, int, GlobalLU_t *, SuperLUStat_t *)
Definition: ccolumn_bmod.c:52
float smach(char *)
Definition: smach.c:18
void cPrint_Dense_Matrix(char *, SuperMatrix *)
Definition: cutil.c:277
void cgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int_t *info)
Driver routines.
Definition: cgssv.c:143
int ilu_ccolumn_dfs(const int, const int, int *, int *, int *, int *, int *, int *, int *, int_t *, GlobalLU_t *)
Definition: ilu_ccolumn_dfs.c:61
int ccopy_to_ucol(int, int, int *, int *, int *, complex *, GlobalLU_t *)
Definition: ccopy_to_ucol.c:36
float * floatCalloc(size_t)
Definition: smemory.c:690
void cinf_norm_error(int, SuperMatrix *, complex *)
Check the inf-norm of the error vector.
Definition: cutil.c:405
void cCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *)
Copy matrix A into matrix B.
Definition: cutil.c:82
void cgscon(char *, SuperMatrix *, SuperMatrix *, float, float *, SuperLUStat_t *, int *)
Definition: cgscon.c:84
void cusolve(int, int, complex *, complex *)
Solves a dense upper triangular system.
Definition: cmyblas2.c:116
void clsolve(int, int, complex *, complex *)
Solves a dense UNIT lower triangular system.
Definition: cmyblas2.c:39
void creadmt(int *, int *, int_t *, complex **, int_t **, int_t **)
void cgsitrf(superlu_options_t *, SuperMatrix *, int, int, int *, void *, int_t, int *, int *, SuperMatrix *, SuperMatrix *, GlobalLU_t *, SuperLUStat_t *, int_t *info)
Definition: cgsitrf.c:187
void cCreate_CompCol_Matrix(SuperMatrix *, int, int, int_t, complex *, int_t *, int_t *, Stype_t, Dtype_t, Mtype_t)
Supernodal LU factor related.
Definition: cutil.c:39
int cpivotL(const int, const double, int *, int *, int *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
Definition: cpivotL.c:66
complex * complexMalloc(size_t)
Definition: cmemory.c:676
int cldperm(int, int, int_t, int_t[], int_t[], complex[], int[], float[], float[])
int cgemv_(char *, int *, int *, complex *, complex *a, int *, complex *, int *, complex *, complex *, int *)
int sp_cgemv(char *, complex, SuperMatrix *, complex *, int, complex, complex *, int)
Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
Definition: csp_blas2.c:462
void cfill(complex *, int, complex)
Fills a complex precision array with a given value.
Definition: cutil.c:395
void cgsrfs(trans_t, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, float *, float *, SuperLUStat_t *, int *)
Definition: cgsrfs.c:141
void cgsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, char *equed, float *R, float *C, SuperMatrix *L, SuperMatrix *U, void *work, int_t lwork, SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, float *rcond, GlobalLU_t *Glu, mem_usage_t *mem_usage, SuperLUStat_t *stat, int_t *info)
Definition: cgsisx.c:405
int ctrsv_(char *, char *, char *, int *, complex *, int *, complex *, int *)
void ilu_cpanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, complex *, float *, int *, int *, int *, int *, int *, int_t *, GlobalLU_t *)
Definition: ilu_cpanel_dfs.c:56
void cCopy_Dense_Matrix(int, int, complex *, int, complex *, int)
Definition: cutil.c:121
void cpruneL(const int, const int *, const int, const int, const int *, const int *, int_t *, GlobalLU_t *)
Definition: cpruneL.c:48
int cQuerySpace(SuperMatrix *, SuperMatrix *, mem_usage_t *)
Definition: cmemory.c:110
void cGenXtrue(int, int, complex *, int)
Definition: cutil.c:355
int sp_ctrsv(char *, char *, char *, SuperMatrix *, SuperMatrix *, complex *, SuperLUStat_t *, int *)
Solves one of the systems of equations A*x = b, or A'*x = b.
Definition: csp_blas2.c:86
void cPrint_SuperNode_Matrix(char *, SuperMatrix *)
Definition: cutil.c:226
int cgemm_(const char *, const char *, const int *, const int *, const int *, const complex *, const complex *, const int *, const complex *, const int *, const complex *, complex *, const int *)
BLAS.
int ccolumn_dfs(const int, const int, int *, int *, int *, int *, int *, int_t *, int *, int *, int_t *, GlobalLU_t *)
Definition: ccolumn_dfs.c:76
void cgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
int ilu_csnode_dfs(const int, const int, const int_t *, const int_t *, const int_t *, int *, GlobalLU_t *)
Definition: ilu_csnode_dfs.c:42
int ctrsm_(char *, char *, char *, char *, int *, int *, complex *, complex *, int *, complex *, int *)
int ilu_cQuerySpace(SuperMatrix *, SuperMatrix *, mem_usage_t *)
Definition: cmemory.c:147
void cCompRow_to_CompCol(int, int, int_t, complex *, int_t *, int_t *, complex **, int_t **, int_t **)
Convert a row compressed storage into a column compressed storage.
Definition: cutil.c:164
float sqselect(int, float *, int)
void cCreate_SuperNode_Matrix(SuperMatrix *, int, int, int_t, complex *, int_t *, int_t *, int_t *, int *, int *, Stype_t, Dtype_t, Mtype_t)
Definition: cutil.c:134
float cPivotGrowth(int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
Definition: cpivotgrowth.c:59
void cCreate_Dense_Matrix(SuperMatrix *, int, int, complex *, int, Stype_t, Dtype_t, Mtype_t)
Definition: cutil.c:103
void cgstrs(trans_t, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, SuperLUStat_t *, int *)
Definition: cgstrs.c:93
void cLUWorkFree(int *, complex *, GlobalLU_t *)
Free the working storage used by factor routines.
Definition: cmemory.c:403
void ccheck_tempv(int, complex *)
Check whether tempv[] == 0. This should be true before and after calling any numeric routines,...
Definition: cutil.c:340
int ilu_ccopy_to_ucol(int, int, int *, int *, int *, complex *, int, milu_t, double, int, complex *, int *, GlobalLU_t *, float *)
Definition: ilu_ccopy_to_ucol.c:44
int csnode_bmod(const int, const int, const int, complex *, complex *, GlobalLU_t *, SuperLUStat_t *)
Performs numeric block updates within the relaxed snode.
Definition: csnode_bmod.c:41
int print_double_vec(char *, int, double *)
Definition: dutil.c:473
void cgstrf(superlu_options_t *, SuperMatrix *, int, int, int *, void *, int_t, int *, int *, SuperMatrix *, SuperMatrix *, GlobalLU_t *, SuperLUStat_t *, int_t *info)
Definition: cgstrf.c:200
void cFillRHS(trans_t, int, complex *, int, SuperMatrix *, SuperMatrix *)
Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's.
Definition: cutil.c:368
void cgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, void *, int_t lwork, SuperMatrix *, SuperMatrix *, float *, float *, float *, float *, GlobalLU_t *, mem_usage_t *, SuperLUStat_t *, int_t *info)
Definition: cgssvx.c:359
int_t cmemory_usage(const int_t, const int_t, const int_t, const int)
Definition: cmemory.c:700
complex * complexCalloc(size_t)
Definition: cmemory.c:686
void creadMM(FILE *, int *, int *, int_t *, complex **, int_t **, int_t **)
Definition: creadMM.c:35
void cpanel_bmod(const int, const int, const int, const int, complex *, complex *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
Definition: cpanel_bmod.c:61
int ilu_cpivotL(const int, const double, int *, int *, int, int *, int *, int *, int *, double, milu_t, complex, GlobalLU_t *, SuperLUStat_t *)
Definition: ilu_cpivotL.c:56
void cpanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, complex *, int *, int *, int *, int_t *, int *, int *, int_t *, GlobalLU_t *)
Definition: cpanel_dfs.c:69
int ilu_cdrop_row(superlu_options_t *, int, int, double, int, int *, double *, GlobalLU_t *, float *, float *, int)
void cgsequ(SuperMatrix *, float *, float *, float *, float *, float *, int *)
Driver related.
Definition: cgsequ.c:94
void creadhb(FILE *, int *, int *, int_t *, complex **, int_t **, int_t **)
Auxiliary routines.
Definition: creadhb.c:293
void claqgs(SuperMatrix *, float *, float *, float, float, float, char *)
Definition: claqgs.c:92
void callocateA(int, int_t, complex **, int_t **, int_t **)
Allocate storage for original matrix A.
Definition: cmemory.c:668
int_t cLUMemInit(fact_t, void *, int_t, int, int, int_t, int, float, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, complex **)
Memory-related.
Definition: cmemory.c:188
int_t cLUMemXpand(int, int_t, MemType, int_t *, GlobalLU_t *)
Expand the data structures for L and U during the factorization.
Definition: cmemory.c:426
int_t csnode_dfs(const int, const int, const int_t *, const int_t *, const int_t *, int_t *, int *, GlobalLU_t *)
Definition: csnode_dfs.c:55
void cPrint_CompCol_Matrix(char *, SuperMatrix *)
Routines for debugging.
Definition: cutil.c:202
void cSetRWork(int, int, complex *, complex **, complex **)
Set up pointers for real working arrays.
Definition: cmemory.c:388
void creadrb(int *, int *, int_t *, complex **, int_t **, int_t **)
Definition: creadrb.c:290
void cCreate_CompRow_Matrix(SuperMatrix *, int, int, int_t, complex *, int_t *, int_t *, Stype_t, Dtype_t, Mtype_t)
Definition: cutil.c:60
Header file for complex operations.
Utility header file.
Definition: slu_util.h:336
Definition: slu_util.h:321
Definition: supermatrix.h:54
Definition: slu_scomplex.h:31
Definition: slu_util.h:330
Definition: slu_util.h:277
int64_t int_t
Definition: superlu_config.h:18
trans_t
Definition: superlu_enum_consts.h:34
milu_t
Definition: superlu_enum_consts.h:46
MemType
Definition: superlu_enum_consts.h:38
fact_t
Definition: superlu_enum_consts.h:30
Matrix type definitions.
Mtype_t
Definition: supermatrix.h:42
Dtype_t
Definition: supermatrix.h:35
Stype_t
Definition: supermatrix.h:22