SuperLU 6.0.1
slu_sdefs.h
Go to the documentation of this file.
1
73#ifndef __SUPERLU_sSP_DEFS /* allow multiple inclusions */
74#define __SUPERLU_sSP_DEFS
75
76/*
77 * File name: ssp_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
97
98/* -------- Prototypes -------- */
99
100#ifdef __cplusplus
101extern "C" {
102#endif
103
105extern void
106sgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *,
108extern void
109sgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *,
110 char *, float *, float *, SuperMatrix *, SuperMatrix *,
111 void *, int_t lwork, SuperMatrix *, SuperMatrix *,
112 float *, float *, float *, float *,
114 /* ILU */
115extern void
117 SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *);
118extern void
119sgsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r,
120 int *etree, char *equed, float *R, float *C,
121 SuperMatrix *L, SuperMatrix *U, void *work, int_t lwork,
122 SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, float *rcond,
123 GlobalLU_t *Glu, mem_usage_t *mem_usage, SuperLUStat_t *stat, int_t *info);
124
125
127extern void
128sCreate_CompCol_Matrix(SuperMatrix *, int, int, int_t, float *,
130extern void
131sCreate_CompRow_Matrix(SuperMatrix *, int, int, int_t, float *,
133extern void sCompRow_to_CompCol(int, int, int_t, float*, int_t*, int_t*,
134 float **, int_t **, int_t **);
135extern void
137extern void
138sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int,
140extern void
141sCreate_SuperNode_Matrix(SuperMatrix *, int, int, int_t, float *,
142 int_t *, int_t *, int_t *, int *, int *,
144extern void
145sCopy_Dense_Matrix(int, int, float *, int, float *, int);
146
147extern void sallocateA (int, int_t, float **, int_t **, int_t **);
148extern void sgstrf (superlu_options_t*, SuperMatrix*,
149 int, int, int*, void *, int_t, int *, int *,
151 SuperLUStat_t*, int_t *info);
152extern int_t ssnode_dfs (const int, const int, const int_t *, const int_t *,
153 const int_t *, int_t *, int *, GlobalLU_t *);
154extern int ssnode_bmod (const int, const int, const int, float *,
155 float *, GlobalLU_t *, SuperLUStat_t*);
156extern void spanel_dfs (const int, const int, const int, SuperMatrix *,
157 int *, int *, float *, int *, int *, int *,
158 int_t *, int *, int *, int_t *, GlobalLU_t *);
159extern void spanel_bmod (const int, const int, const int, const int,
160 float *, float *, int *, int *,
162extern int scolumn_dfs (const int, const int, int *, int *, int *, int *,
163 int *, int_t *, int *, int *, int_t *, GlobalLU_t *);
164extern int scolumn_bmod (const int, const int, float *,
165 float *, int *, int *, int,
167extern int scopy_to_ucol (int, int, int *, int *, int *,
168 float *, GlobalLU_t *);
169extern int spivotL (const int, const double, int *, int *,
170 int *, int *, int *, GlobalLU_t *, SuperLUStat_t*);
171extern void spruneL (const int, const int *, const int, const int,
172 const int *, const int *, int_t *, GlobalLU_t *);
173extern void sreadmt (int *, int *, int_t *, float **, int_t **, int_t **);
174extern void sGenXtrue (int, int, float *, int);
175extern void sFillRHS (trans_t, int, float *, int, SuperMatrix *,
176 SuperMatrix *);
177extern void sgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *,
178 SuperMatrix *, SuperLUStat_t*, int *);
179/* ILU */
180extern void sgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*,
181 void *, int_t, int *, int *, SuperMatrix *, SuperMatrix *,
182 GlobalLU_t *, SuperLUStat_t*, int_t *info);
183extern int sldperm(int, int, int_t, int_t [], int_t [], float [],
184 int [], float [], float []);
185extern int ilu_ssnode_dfs (const int, const int, const int_t *, const int_t *,
186 const int_t *, int *, GlobalLU_t *);
187extern void ilu_spanel_dfs (const int, const int, const int, SuperMatrix *,
188 int *, int *, float *, float *, int *, int *,
189 int *, int *, int *, int_t *, GlobalLU_t *);
190extern int ilu_scolumn_dfs (const int, const int, int *, int *, int *,
191 int *, int *, int *, int *, int_t *, GlobalLU_t *);
192extern int ilu_scopy_to_ucol (int, int, int *, int *, int *,
193 float *, int, milu_t, double, int,
194 float *, int *, GlobalLU_t *, float *);
195extern int ilu_spivotL (const int, const double, int *, int *, int, int *,
196 int *, int *, int *, double, milu_t,
197 float, GlobalLU_t *, SuperLUStat_t*);
198extern int ilu_sdrop_row (superlu_options_t *, int, int, double,
199 int, int *, double *, GlobalLU_t *,
200 float *, float *, int);
201
202
205extern void sgsequ (SuperMatrix *, float *, float *, float *,
206 float *, float *, int *);
207extern void slaqgs (SuperMatrix *, float *, float *, float,
208 float, float, char *);
209extern void sgscon (char *, SuperMatrix *, SuperMatrix *,
210 float, float *, SuperLUStat_t*, int *);
211extern float sPivotGrowth(int, SuperMatrix *, int *,
213extern void sgsrfs (trans_t, SuperMatrix *, SuperMatrix *,
214 SuperMatrix *, int *, int *, char *, float *,
215 float *, SuperMatrix *, SuperMatrix *,
216 float *, float *, SuperLUStat_t*, int *);
217
218extern int sp_strsv (char *, char *, char *, SuperMatrix *,
219 SuperMatrix *, float *, SuperLUStat_t*, int *);
220extern int sp_sgemv (char *, float, SuperMatrix *, float *,
221 int, float, float *, int);
222
223extern int sp_sgemm (char *, char *, int, int, int, float,
224 SuperMatrix *, float *, int, float,
225 float *, int);
226extern float smach(char *); /* from C99 standard, in float.h */
227
229extern int_t sLUMemInit (fact_t, void *, int_t, int, int, int_t, int,
230 float, SuperMatrix *, SuperMatrix *,
231 GlobalLU_t *, int **, float **);
232extern void sSetRWork (int, int, float *, float **, float **);
233extern void sLUWorkFree (int *, float *, GlobalLU_t *);
234extern int_t sLUMemXpand (int, int_t, MemType, int_t *, GlobalLU_t *);
235
236extern float *floatMalloc(size_t);
237extern float *floatCalloc(size_t);
238extern int_t smemory_usage(const int_t, const int_t, const int_t, const int);
241
243extern void sreadhb(FILE *, int *, int *, int_t *, float **, int_t **, int_t **);
244extern void sreadrb(int *, int *, int_t *, float **, int_t **, int_t **);
245extern void sreadtriple(int *, int *, int_t *, float **, int_t **, int_t **);
246extern void sreadMM(FILE *, int *, int *, int_t *, float **, int_t **, int_t **);
247extern void sfill (float *, int, float);
248extern void sinf_norm_error (int, SuperMatrix *, float *);
249extern float sqselect(int, float *, int);
250
251
253extern void sPrint_CompCol_Matrix(char *, SuperMatrix *);
254extern void sPrint_SuperNode_Matrix(char *, SuperMatrix *);
255extern void sPrint_Dense_Matrix(char *, SuperMatrix *);
256extern void sprint_lu_col(char *, int, int, int_t *, GlobalLU_t *);
257extern int print_double_vec(char *, int, double *);
258extern void scheck_tempv(int, float *);
259
262extern int sgemm_(const char*, const char*, const int*, const int*, const int*,
263 const float*, const float*, const int*, const float*,
264 const int*, const float*, float*, const int*);
265extern int strsv_(char*, char*, char*, int*, float*, int*,
266 float*, int*);
267extern int strsm_(char*, char*, char*, char*, int*, int*,
268 float*, float*, int*, float*, int*);
269extern int sgemv_(char *, int *, int *, float *, float *a, int *,
270 float *, int *, float *, float *, int *);
271
272extern void susolve(int, int, float*, float*);
273extern void slsolve(int, int, float*, float*);
274extern void smatvec(int, int, int, float*, float*, float*);
275
276#ifdef __cplusplus
277 }
278#endif
279
280#endif /* __SUPERLU_sSP_DEFS */
281
#define X(I)
#define A(I, J)
#define U(I)
Macros defining how C routines will be called.
float * floatMalloc(size_t)
Definition: smemory.c:680
void sgsisx(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: sgsisx.c:404
int ilu_ssnode_dfs(const int, const int, const int_t *, const int_t *, const int_t *, int *, GlobalLU_t *)
Definition: ilu_ssnode_dfs.c:42
int sQuerySpace(SuperMatrix *, SuperMatrix *, mem_usage_t *)
Definition: smemory.c:110
int sldperm(int, int, int_t, int_t[], int_t[], float[], int[], float[], float[])
float smach(char *)
Definition: smach.c:18
void sreadmt(int *, int *, int_t *, float **, int_t **, int_t **)
void sgscon(char *, SuperMatrix *, SuperMatrix *, float, float *, SuperLUStat_t *, int *)
Definition: sgscon.c:84
int scopy_to_ucol(int, int, int *, int *, int *, float *, GlobalLU_t *)
Definition: scopy_to_ucol.c:36
void sPrint_Dense_Matrix(char *, SuperMatrix *)
Definition: sutil.c:276
void susolve(int, int, float *, float *)
Solves a dense upper triangular system.
Definition: smyblas2.c:137
void sgssvx(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: sgssvx.c:357
float * floatCalloc(size_t)
Definition: smemory.c:690
void sfill(float *, int, float)
Fills a float precision array with a given value.
Definition: sutil.c:393
void sCompRow_to_CompCol(int, int, int_t, float *, int_t *, int_t *, float **, int_t **, int_t **)
Convert a row compressed storage into a column compressed storage.
Definition: sutil.c:164
int ilu_scopy_to_ucol(int, int, int *, int *, int *, float *, int, milu_t, double, int, float *, int *, GlobalLU_t *, float *)
Definition: ilu_scopy_to_ucol.c:44
int sp_sgemm(char *, char *, int, int, int, float, SuperMatrix *, float *, int, float, float *, int)
Definition: ssp_blas3.c:126
void sgsequ(SuperMatrix *, float *, float *, float *, float *, float *, int *)
Driver related.
Definition: sgsequ.c:94
int_t smemory_usage(const int_t, const int_t, const int_t, const int)
Definition: smemory.c:704
void sgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int_t *info)
Driver routines.
Definition: sgssv.c:143
void spanel_bmod(const int, const int, const int, const int, float *, float *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
Definition: spanel_bmod.c:61
void sgsitrf(superlu_options_t *, SuperMatrix *, int, int, int *, void *, int_t, int *, int *, SuperMatrix *, SuperMatrix *, GlobalLU_t *, SuperLUStat_t *, int_t *info)
Definition: sgsitrf.c:187
void sPrint_CompCol_Matrix(char *, SuperMatrix *)
Routines for debugging.
Definition: sutil.c:202
void sCopy_Dense_Matrix(int, int, float *, int, float *, int)
Definition: sutil.c:121
int ilu_sdrop_row(superlu_options_t *, int, int, double, int, int *, double *, GlobalLU_t *, float *, float *, int)
int ssnode_bmod(const int, const int, const int, float *, float *, GlobalLU_t *, SuperLUStat_t *)
Performs numeric block updates within the relaxed snode.
Definition: ssnode_bmod.c:41
int strsm_(char *, char *, char *, char *, int *, int *, float *, float *, int *, float *, int *)
int_t ssnode_dfs(const int, const int, const int_t *, const int_t *, const int_t *, int_t *, int *, GlobalLU_t *)
Definition: ssnode_dfs.c:55
void spruneL(const int, const int *, const int, const int, const int *, const int *, int_t *, GlobalLU_t *)
Definition: spruneL.c:48
void sCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *)
Copy matrix A into matrix B.
Definition: sutil.c:82
void sreadtriple(int *, int *, int_t *, float **, int_t **, int_t **)
Definition: sreadtriple.c:26
void spanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, float *, int *, int *, int *, int_t *, int *, int *, int_t *, GlobalLU_t *)
Definition: spanel_dfs.c:69
void sLUWorkFree(int *, float *, GlobalLU_t *)
Free the working storage used by factor routines.
Definition: smemory.c:407
float sqselect(int, float *, int)
int sp_sgemv(char *, float, SuperMatrix *, float *, int, float, float *, int)
Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,
Definition: ssp_blas2.c:374
void sCreate_CompCol_Matrix(SuperMatrix *, int, int, int_t, float *, int_t *, int_t *, Stype_t, Dtype_t, Mtype_t)
Supernodal LU factor related.
Definition: sutil.c:39
void sCreate_SuperNode_Matrix(SuperMatrix *, int, int, int_t, float *, int_t *, int_t *, int_t *, int *, int *, Stype_t, Dtype_t, Mtype_t)
Definition: sutil.c:134
void sreadMM(FILE *, int *, int *, int_t *, float **, int_t **, int_t **)
Definition: sreadMM.c:35
void sprint_lu_col(char *, int, int, int_t *, GlobalLU_t *)
Diagnostic print of column "jcol" in the U/L factor.
Definition: sutil.c:298
int sp_strsv(char *, char *, char *, SuperMatrix *, SuperMatrix *, float *, SuperLUStat_t *, int *)
Solves one of the systems of equations A*x = b, or A'*x = b.
Definition: ssp_blas2.c:86
void slsolve(int, int, float *, float *)
Solves a dense UNIT lower triangular system.
Definition: smyblas2.c:38
int strsv_(char *, char *, char *, int *, float *, int *, float *, int *)
int print_double_vec(char *, int, double *)
Definition: dutil.c:473
void smatvec(int, int, int, float *, float *, float *)
Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
Definition: smyblas2.c:162
void sSetRWork(int, int, float *, float **, float **)
Set up pointers for real working arrays.
Definition: smemory.c:392
void sGenXtrue(int, int, float *, int)
Definition: sutil.c:354
int ilu_spivotL(const int, const double, int *, int *, int, int *, int *, int *, int *, double, milu_t, float, GlobalLU_t *, SuperLUStat_t *)
Definition: ilu_spivotL.c:56
int sgemm_(const char *, const char *, const int *, const int *, const int *, const float *, const float *, const int *, const float *, const int *, const float *, float *, const int *)
BLAS.
void sinf_norm_error(int, SuperMatrix *, float *)
Check the inf-norm of the error vector.
Definition: sutil.c:403
int ilu_scolumn_dfs(const int, const int, int *, int *, int *, int *, int *, int *, int *, int_t *, GlobalLU_t *)
Definition: ilu_scolumn_dfs.c:61
void ilu_spanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, float *, float *, int *, int *, int *, int *, int *, int_t *, GlobalLU_t *)
Definition: ilu_spanel_dfs.c:56
void sFillRHS(trans_t, int, float *, int, SuperMatrix *, SuperMatrix *)
Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's.
Definition: sutil.c:366
void sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int, Stype_t, Dtype_t, Mtype_t)
Definition: sutil.c:103
void sreadhb(FILE *, int *, int *, int_t *, float **, int_t **, int_t **)
Auxiliary routines.
Definition: sreadhb.c:283
float sPivotGrowth(int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
Definition: spivotgrowth.c:59
int_t sLUMemInit(fact_t, void *, int_t, int, int, int_t, int, float, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, float **)
Memory-related.
Definition: smemory.c:188
void sallocateA(int, int_t, float **, int_t **, int_t **)
Allocate storage for original matrix A.
Definition: smemory.c:672
void sreadrb(int *, int *, int_t *, float **, int_t **, int_t **)
Definition: sreadrb.c:281
int spivotL(const int, const double, int *, int *, int *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
Definition: spivotL.c:66
int ilu_sQuerySpace(SuperMatrix *, SuperMatrix *, mem_usage_t *)
Definition: smemory.c:147
int_t sLUMemXpand(int, int_t, MemType, int_t *, GlobalLU_t *)
Expand the data structures for L and U during the factorization.
Definition: smemory.c:430
int scolumn_bmod(const int, const int, float *, float *, int *, int *, int, GlobalLU_t *, SuperLUStat_t *)
Definition: scolumn_bmod.c:52
int sgemv_(char *, int *, int *, float *, float *a, int *, float *, int *, float *, float *, int *)
void sgsrfs(trans_t, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, float *, float *, SuperLUStat_t *, int *)
Definition: sgsrfs.c:141
void sgstrs(trans_t, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, SuperLUStat_t *, int *)
Definition: sgstrs.c:93
int scolumn_dfs(const int, const int, int *, int *, int *, int *, int *, int_t *, int *, int *, int_t *, GlobalLU_t *)
Definition: scolumn_dfs.c:76
void sPrint_SuperNode_Matrix(char *, SuperMatrix *)
Definition: sutil.c:226
void sgstrf(superlu_options_t *, SuperMatrix *, int, int, int *, void *, int_t, int *, int *, SuperMatrix *, SuperMatrix *, GlobalLU_t *, SuperLUStat_t *, int_t *info)
Definition: sgstrf.c:200
void sCreate_CompRow_Matrix(SuperMatrix *, int, int, int_t, float *, int_t *, int_t *, Stype_t, Dtype_t, Mtype_t)
Definition: sutil.c:60
void scheck_tempv(int, float *)
Check whether tempv[] == 0. This should be true before and after calling any numeric routines,...
Definition: sutil.c:339
void slaqgs(SuperMatrix *, float *, float *, float, float, float, char *)
Definition: slaqgs.c:92
void sgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
Utility header file.
Definition: slu_util.h:336
Definition: slu_util.h:321
Definition: supermatrix.h:54
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