SuperLU 7.0.0
slu_cdefs.h
Go to the documentation of this file.
1
74#ifndef __SUPERLU_cSP_DEFS /* allow multiple inclusions */
75#define __SUPERLU_cSP_DEFS
76
77/*
78 * File name: csp_defs.h
79 * Purpose: Sparse matrix types and function prototypes
80 * History:
81 */
82
83#ifdef _CRAY
84#include <fortran.h>
85#endif
86
87#include <math.h>
88#include <limits.h>
89#include <stdio.h>
90#include <stdlib.h>
91#include <stdint.h>
92#include <string.h>
93#include "slu_Cnames.h"
94#include "superlu_config.h"
95#include "supermatrix.h"
96#include "slu_util.h"
97#include "slu_scomplex.h"
98
99
100/* -------- Prototypes -------- */
101
102#ifdef __cplusplus
103extern "C" {
104#endif
105
107extern void
108cgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *,
110extern void
111cgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *,
112 char *, float *, float *, SuperMatrix *, SuperMatrix *,
113 void *, int_t lwork, SuperMatrix *, SuperMatrix *,
114 float *, float *, float *, float *,
116 /* ILU */
117extern void
119 SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *);
120extern void
121cgsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r,
122 int *etree, char *equed, float *R, float *C,
123 SuperMatrix *L, SuperMatrix *U, void *work, int_t lwork,
124 SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, float *rcond,
125 GlobalLU_t *Glu, mem_usage_t *mem_usage, SuperLUStat_t *stat, int_t *info);
126
127
129extern void
132extern void
135extern void cCompRow_to_CompCol(int, int, int_t, singlecomplex*, int_t*, int_t*,
136 singlecomplex **, int_t **, int_t **);
137extern void
139extern void
142extern void
144 int_t *, int_t *, int_t *, int *, int *,
146extern void
147cCopy_Dense_Matrix(int, int, singlecomplex *, int, singlecomplex *, int);
148
149extern void callocateA (int, int_t, singlecomplex **, int_t **, int_t **);
150extern void cgstrf (superlu_options_t*, SuperMatrix*,
151 int, int, int*, void *, int_t, int *, int *,
153 SuperLUStat_t*, int_t *info);
154extern int_t csnode_dfs (const int, const int, const int_t *, const int_t *,
155 const int_t *, int_t *, int *, GlobalLU_t *);
156extern int csnode_bmod (const int, const int, const int, singlecomplex *,
158extern void cpanel_dfs (const int, const int, const int, SuperMatrix *,
159 int *, int *, singlecomplex *, int *, int *, int *,
160 int_t *, int *, int *, int_t *, GlobalLU_t *);
161extern void cpanel_bmod (const int, const int, const int, const int,
162 singlecomplex *, singlecomplex *, int *, int *,
164extern int ccolumn_dfs (const int, const int, int *, int *, int *, int *,
165 int *, int_t *, int *, int *, int_t *, GlobalLU_t *);
166extern int ccolumn_bmod (const int, const int, singlecomplex *,
167 singlecomplex *, int *, int *, int,
169extern int ccopy_to_ucol (int, int, int *, int *, int *,
171extern int cpivotL (const int, const double, int *, int *,
172 int *, int *, int *, GlobalLU_t *, SuperLUStat_t*);
173extern void cpruneL (const int, const int *, const int, const int,
174 const int *, const int *, int_t *, GlobalLU_t *);
175extern void creadmt (int *, int *, int_t *, singlecomplex **, int_t **, int_t **);
176extern void cGenXtrue (int, int, singlecomplex *, int);
177extern void cFillRHS (trans_t, int, singlecomplex *, int, SuperMatrix *,
178 SuperMatrix *);
179extern void cgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *,
180 SuperMatrix *, SuperLUStat_t*, int *);
181/* ILU */
182extern void cgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*,
183 void *, int_t, int *, int *, SuperMatrix *, SuperMatrix *,
184 GlobalLU_t *, SuperLUStat_t*, int_t *info);
185extern int cldperm(int, int, int_t, int_t [], int_t [], singlecomplex [],
186 int [], float [], float []);
187extern int ilu_csnode_dfs (const int, const int, const int_t *, const int_t *,
188 const int_t *, int *, GlobalLU_t *);
189extern void ilu_cpanel_dfs (const int, const int, const int, SuperMatrix *,
190 int *, int *, singlecomplex *, float *, int *, int *,
191 int *, int *, int *, int_t *, GlobalLU_t *);
192extern int ilu_ccolumn_dfs (const int, const int, int *, int *, int *,
193 int *, int *, int *, int *, int_t *, GlobalLU_t *);
194extern int ilu_ccopy_to_ucol (int, int, int *, int *, int *,
195 singlecomplex *, int, milu_t, double, int,
196 singlecomplex *, int *, GlobalLU_t *, float *);
197extern int ilu_cpivotL (const int, const double, int *, int *, int, int *,
198 int *, int *, int *, double, milu_t,
200extern int ilu_cdrop_row (superlu_options_t *, int, int, double,
201 int, int *, double *, GlobalLU_t *,
202 float *, float *, int);
203
204
207extern void cgsequ (SuperMatrix *, float *, float *, float *,
208 float *, float *, int *);
209extern void claqgs (SuperMatrix *, float *, float *, float,
210 float, float, char *);
211extern void cgscon (char *, SuperMatrix *, SuperMatrix *,
212 float, float *, SuperLUStat_t*, int *);
213extern float cPivotGrowth(int, SuperMatrix *, int *,
215extern void cgsrfs (trans_t, SuperMatrix *, SuperMatrix *,
216 SuperMatrix *, int *, int *, char *, float *,
217 float *, SuperMatrix *, SuperMatrix *,
218 float *, float *, SuperLUStat_t*, int *);
219
220extern int sp_ctrsv (char *, char *, char *, SuperMatrix *,
222extern int sp_cgemv (char *, singlecomplex, SuperMatrix *, singlecomplex *,
223 int, singlecomplex, singlecomplex *, int);
224
225extern int sp_cgemm (char *, char *, int, int, int, singlecomplex,
227 singlecomplex *, int);
228extern float smach(char *); /* from C99 standard, in float.h */
229
231extern int_t cLUMemInit (fact_t, void *, int_t, int, int, int_t, int,
232 float, SuperMatrix *, SuperMatrix *,
233 GlobalLU_t *, int **, singlecomplex **);
234extern void cSetRWork (int, int, singlecomplex *, singlecomplex **, singlecomplex **);
235extern void cLUWorkFree (int *, singlecomplex *, GlobalLU_t *);
236extern int_t cLUMemXpand (int, int_t, MemType, int_t *, GlobalLU_t *);
237
238extern singlecomplex *singlecomplexMalloc(size_t);
239extern singlecomplex *singlecomplexCalloc(size_t);
240extern float *floatMalloc(size_t);
241extern float *floatCalloc(size_t);
242extern int_t cmemory_usage(const int_t, const int_t, const int_t, const int);
245
247extern void creadhb(FILE *, int *, int *, int_t *, singlecomplex **, int_t **, int_t **);
248extern void creadrb(int *, int *, int_t *, singlecomplex **, int_t **, int_t **);
249extern void creadtriple(int *, int *, int_t *, singlecomplex **, int_t **, int_t **);
250extern void creadtriple_noheader(int *, int *, int_t *, singlecomplex **, int_t **, int_t **);
251extern void creadMM(FILE *, int *, int *, int_t *, singlecomplex **, int_t **, int_t **);
252extern void cfill (singlecomplex *, int, singlecomplex);
253extern void cinf_norm_error (int, SuperMatrix *, singlecomplex *);
254extern float sqselect(int, float *, int);
255
256
258extern void cPrint_CompCol_Matrix(char *, SuperMatrix *);
259extern void cPrint_SuperNode_Matrix(char *, SuperMatrix *);
260extern void cPrint_Dense_Matrix(char *, SuperMatrix *);
261extern void cprint_lu_col(char *, int, int, int_t *, GlobalLU_t *);
262extern int print_double_vec(char *, int, double *);
263extern void ccheck_tempv(int, singlecomplex *);
264
267extern int cgemm_(const char*, const char*, const int*, const int*, const int*,
268 const singlecomplex*, const singlecomplex*, const int*, const singlecomplex*,
269 const int*, const singlecomplex*, singlecomplex*, const int*);
270extern int ctrsv_(char*, char*, char*, int*, singlecomplex*, int*,
271 singlecomplex*, int*);
272extern int ctrsm_(char*, char*, char*, char*, int*, int*,
273 singlecomplex*, singlecomplex*, int*, singlecomplex*, int*);
274extern int cgemv_(char *, int *, int *, singlecomplex *, singlecomplex *a, int *,
275 singlecomplex *, int *, singlecomplex *, singlecomplex *, int *);
276
277extern void cusolve(int, int, singlecomplex*, singlecomplex*);
278extern void clsolve(int, int, singlecomplex*, singlecomplex*);
279extern void cmatvec(int, int, int, singlecomplex*, singlecomplex*, singlecomplex*);
280
281#ifdef __cplusplus
282 }
283#endif
284
285#endif /* __SUPERLU_cSP_DEFS */
286
#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
float * floatMalloc(size_t)
Definition: smemory.c:689
void cinf_norm_error(int, SuperMatrix *, singlecomplex *)
Check the inf-norm of the error vector.
Definition: cutil.c:405
void creadMM(FILE *, int *, int *, int_t *, singlecomplex **, int_t **, int_t **)
Definition: creadMM.c:35
void creadtriple_noheader(int *, int *, int_t *, singlecomplex **, int_t **, int_t **)
void cCompRow_to_CompCol(int, int, int_t, singlecomplex *, int_t *, int_t *, singlecomplex **, int_t **, int_t **)
Convert a row compressed storage into a column compressed storage.
Definition: cutil.c:164
void ilu_cpanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, singlecomplex *, float *, int *, int *, int *, int *, int *, int_t *, GlobalLU_t *)
Definition: ilu_cpanel_dfs.c:56
void creadtriple(int *, int *, int_t *, singlecomplex **, int_t **, int_t **)
Definition: creadtriple.c:25
void cCreate_CompCol_Matrix(SuperMatrix *, int, int, int_t, singlecomplex *, int_t *, int_t *, Stype_t, Dtype_t, Mtype_t)
Supernodal LU factor related.
Definition: cutil.c:39
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:144
int csnode_bmod(const int, const int, const int, singlecomplex *, singlecomplex *, GlobalLU_t *, SuperLUStat_t *)
Performs numeric block updates within the relaxed snode.
Definition: csnode_bmod.c:41
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 ccolumn_bmod(const int, const int, singlecomplex *, singlecomplex *, int *, int *, int, GlobalLU_t *, SuperLUStat_t *)
Definition: ccolumn_bmod.c:52
float * floatCalloc(size_t)
Definition: smemory.c:699
singlecomplex * singlecomplexMalloc(size_t)
Definition: cmemory.c:689
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:85
int ctrsm_(char *, char *, char *, char *, int *, int *, singlecomplex *, singlecomplex *, int *, singlecomplex *, int *)
int cgemm_(const char *, const char *, const int *, const int *, const int *, const singlecomplex *, const singlecomplex *, const int *, const singlecomplex *, const int *, const singlecomplex *, singlecomplex *, const int *)
BLAS.
void cCopy_Dense_Matrix(int, int, singlecomplex *, int, singlecomplex *, int)
Definition: cutil.c:121
void creadmt(int *, int *, int_t *, singlecomplex **, 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:188
int cpivotL(const int, const double, int *, int *, int *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
Definition: cpivotL.c:67
void cmatvec(int, int, int, singlecomplex *, singlecomplex *, singlecomplex *)
Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
Definition: cmyblas2.c:143
void cpanel_bmod(const int, const int, const int, const int, singlecomplex *, singlecomplex *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
Definition: cpanel_bmod.c:61
singlecomplex * singlecomplexCalloc(size_t)
Definition: cmemory.c:699
void cgsrfs(trans_t, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, float *, float *, SuperLUStat_t *, int *)
Definition: cgsrfs.c:141
void cLUWorkFree(int *, singlecomplex *, GlobalLU_t *)
Free the working storage used by factor routines.
Definition: cmemory.c:407
int ilu_ccopy_to_ucol(int, int, int *, int *, int *, singlecomplex *, int, milu_t, double, int, singlecomplex *, int *, GlobalLU_t *, float *)
Definition: ilu_ccopy_to_ucol.c:44
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:404
void creadrb(int *, int *, int_t *, singlecomplex **, int_t **, int_t **)
Definition: creadrb.c:290
int ilu_cpivotL(const int, const double, int *, int *, int, int *, int *, int *, int *, double, milu_t, singlecomplex, GlobalLU_t *, SuperLUStat_t *)
Definition: ilu_cpivotL.c:57
void cpruneL(const int, const int *, const int, const int, const int *, const int *, int_t *, GlobalLU_t *)
Definition: cpruneL.c:48
int ccopy_to_ucol(int, int, int *, int *, int *, singlecomplex *, GlobalLU_t *)
Definition: ccopy_to_ucol.c:36
int cQuerySpace(SuperMatrix *, SuperMatrix *, mem_usage_t *)
Definition: cmemory.c:111
void cPrint_SuperNode_Matrix(char *, SuperMatrix *)
Definition: cutil.c:226
int_t cLUMemInit(fact_t, void *, int_t, int, int, int_t, int, float, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, singlecomplex **)
Memory-related.
Definition: cmemory.c:190
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 ilu_cQuerySpace(SuperMatrix *, SuperMatrix *, mem_usage_t *)
Definition: cmemory.c:149
float sqselect(int, float *, int)
float cPivotGrowth(int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
Definition: cpivotgrowth.c:59
void cGenXtrue(int, int, singlecomplex *, int)
Definition: cutil.c:355
int cldperm(int, int, int_t, int_t[], int_t[], singlecomplex[], int[], float[], float[])
void cgstrs(trans_t, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, SuperLUStat_t *, int *)
Definition: cgstrs.c:93
void cCreate_SuperNode_Matrix(SuperMatrix *, int, int, int_t, singlecomplex *, int_t *, int_t *, int_t *, int *, int *, Stype_t, Dtype_t, Mtype_t)
Definition: cutil.c:134
int print_double_vec(char *, int, double *)
Definition: dutil.c:473
void ccheck_tempv(int, singlecomplex *)
Check whether tempv[] == 0. This should be true before and after calling any numeric routines,...
Definition: cutil.c:340
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:201
void cFillRHS(trans_t, int, singlecomplex *, 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 cusolve(int, int, singlecomplex *, singlecomplex *)
Solves a dense upper triangular system.
Definition: cmyblas2.c:116
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:358
int_t cmemory_usage(const int_t, const int_t, const int_t, const int)
Definition: cmemory.c:713
int sp_cgemv(char *, singlecomplex, SuperMatrix *, singlecomplex *, int, singlecomplex, singlecomplex *, 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 clsolve(int, int, singlecomplex *, singlecomplex *)
Solves a dense UNIT lower triangular system.
Definition: cmyblas2.c:39
void cpanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, singlecomplex *, int *, int *, int *, int_t *, int *, int *, int_t *, GlobalLU_t *)
Definition: cpanel_dfs.c:69
int ctrsv_(char *, char *, char *, int *, singlecomplex *, int *, singlecomplex *, int *)
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 claqgs(SuperMatrix *, float *, float *, float, float, float, char *)
Definition: claqgs.c:92
void cSetRWork(int, int, singlecomplex *, singlecomplex **, singlecomplex **)
Set up pointers for real working arrays.
Definition: cmemory.c:392
void creadhb(FILE *, int *, int *, int_t *, singlecomplex **, int_t **, int_t **)
Auxiliary routines.
Definition: creadhb.c:293
void cCreate_CompRow_Matrix(SuperMatrix *, int, int, int_t, singlecomplex *, int_t *, int_t *, Stype_t, Dtype_t, Mtype_t)
Definition: cutil.c:60
int sp_ctrsv(char *, char *, char *, SuperMatrix *, SuperMatrix *, singlecomplex *, SuperLUStat_t *, int *)
Solves one of the systems of equations A*x = b, or A'*x = b.
Definition: csp_blas2.c:86
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:430
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 callocateA(int, int_t, singlecomplex **, int_t **, int_t **)
Allocate storage for original matrix A.
Definition: cmemory.c:681
int sp_cgemm(char *, char *, int, int, int, singlecomplex, SuperMatrix *, singlecomplex *, int, singlecomplex, singlecomplex *, int)
Definition: csp_blas3.c:126
void cfill(singlecomplex *, int, singlecomplex)
Fills a singlecomplex precision array with a given value.
Definition: cutil.c:395
void cPrint_CompCol_Matrix(char *, SuperMatrix *)
Routines for debugging.
Definition: cutil.c:202
int cgemv_(char *, int *, int *, singlecomplex *, singlecomplex *a, int *, singlecomplex *, int *, singlecomplex *, singlecomplex *, int *)
void cCreate_Dense_Matrix(SuperMatrix *, int, int, singlecomplex *, int, Stype_t, Dtype_t, Mtype_t)
Definition: cutil.c:103
Header file for complex operations.
Utility header file.
Definition: slu_util.h:336
Definition: slu_util.h:321
Definition: supermatrix.h:54
Definition: slu_util.h:330
Definition: slu_scomplex.h:31
Definition: slu_util.h:277
int int_t
Definition: superlu_config.h:20
trans_t
Definition: superlu_enum_consts.h:34
milu_t
Definition: superlu_enum_consts.h:46
MemType
Definition: superlu_enum_consts.h:37
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