SuperLU 7.0.0
slu_sdefs.h
Go to the documentation of this file.
1
74#ifndef __SUPERLU_sSP_DEFS /* allow multiple inclusions */
75#define __SUPERLU_sSP_DEFS
76
77/*
78 * File name: ssp_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
98
99/* -------- Prototypes -------- */
100
101#ifdef __cplusplus
102extern "C" {
103#endif
104
106extern void
107sgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *,
109extern void
110sgssvx(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
120sgsisx(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
129sCreate_CompCol_Matrix(SuperMatrix *, int, int, int_t, float *,
131extern void
132sCreate_CompRow_Matrix(SuperMatrix *, int, int, int_t, float *,
134extern void sCompRow_to_CompCol(int, int, int_t, float*, int_t*, int_t*,
135 float **, int_t **, int_t **);
136extern void
138extern void
139sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int,
141extern void
142sCreate_SuperNode_Matrix(SuperMatrix *, int, int, int_t, float *,
143 int_t *, int_t *, int_t *, int *, int *,
145extern void
146sCopy_Dense_Matrix(int, int, float *, int, float *, int);
147
148extern void sallocateA (int, int_t, float **, int_t **, int_t **);
149extern void sgstrf (superlu_options_t*, SuperMatrix*,
150 int, int, int*, void *, int_t, int *, int *,
152 SuperLUStat_t*, int_t *info);
153extern int_t ssnode_dfs (const int, const int, const int_t *, const int_t *,
154 const int_t *, int_t *, int *, GlobalLU_t *);
155extern int ssnode_bmod (const int, const int, const int, float *,
156 float *, GlobalLU_t *, SuperLUStat_t*);
157extern void spanel_dfs (const int, const int, const int, SuperMatrix *,
158 int *, int *, float *, int *, int *, int *,
159 int_t *, int *, int *, int_t *, GlobalLU_t *);
160extern void spanel_bmod (const int, const int, const int, const int,
161 float *, float *, int *, int *,
163extern int scolumn_dfs (const int, const int, int *, int *, int *, int *,
164 int *, int_t *, int *, int *, int_t *, GlobalLU_t *);
165extern int scolumn_bmod (const int, const int, float *,
166 float *, int *, int *, int,
168extern int scopy_to_ucol (int, int, int *, int *, int *,
169 float *, GlobalLU_t *);
170extern int spivotL (const int, const double, int *, int *,
171 int *, int *, int *, GlobalLU_t *, SuperLUStat_t*);
172extern void spruneL (const int, const int *, const int, const int,
173 const int *, const int *, int_t *, GlobalLU_t *);
174extern void sreadmt (int *, int *, int_t *, float **, int_t **, int_t **);
175extern void sGenXtrue (int, int, float *, int);
176extern void sFillRHS (trans_t, int, float *, int, SuperMatrix *,
177 SuperMatrix *);
178extern void sgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *,
179 SuperMatrix *, SuperLUStat_t*, int *);
180/* ILU */
181extern void sgsitrf (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 sldperm(int, int, int_t, int_t [], int_t [], float [],
185 int [], float [], float []);
186extern int ilu_ssnode_dfs (const int, const int, const int_t *, const int_t *,
187 const int_t *, int *, GlobalLU_t *);
188extern void ilu_spanel_dfs (const int, const int, const int, SuperMatrix *,
189 int *, int *, float *, float *, int *, int *,
190 int *, int *, int *, int_t *, GlobalLU_t *);
191extern int ilu_scolumn_dfs (const int, const int, int *, int *, int *,
192 int *, int *, int *, int *, int_t *, GlobalLU_t *);
193extern int ilu_scopy_to_ucol (int, int, int *, int *, int *,
194 float *, int, milu_t, double, int,
195 float *, int *, GlobalLU_t *, float *);
196extern int ilu_spivotL (const int, const double, int *, int *, int, int *,
197 int *, int *, int *, double, milu_t,
198 float, GlobalLU_t *, SuperLUStat_t*);
199extern int ilu_sdrop_row (superlu_options_t *, int, int, double,
200 int, int *, double *, GlobalLU_t *,
201 float *, float *, int);
202
203
206extern void sgsequ (SuperMatrix *, float *, float *, float *,
207 float *, float *, int *);
208extern void slaqgs (SuperMatrix *, float *, float *, float,
209 float, float, char *);
210extern void sgscon (char *, SuperMatrix *, SuperMatrix *,
211 float, float *, SuperLUStat_t*, int *);
212extern float sPivotGrowth(int, SuperMatrix *, int *,
214extern void sgsrfs (trans_t, SuperMatrix *, SuperMatrix *,
215 SuperMatrix *, int *, int *, char *, float *,
216 float *, SuperMatrix *, SuperMatrix *,
217 float *, float *, SuperLUStat_t*, int *);
218
219extern int sp_strsv (char *, char *, char *, SuperMatrix *,
220 SuperMatrix *, float *, SuperLUStat_t*, int *);
221extern int sp_sgemv (char *, float, SuperMatrix *, float *,
222 int, float, float *, int);
223
224extern int sp_sgemm (char *, char *, int, int, int, float,
225 SuperMatrix *, float *, int, float,
226 float *, int);
227extern float smach(char *); /* from C99 standard, in float.h */
228
230extern int_t sLUMemInit (fact_t, void *, int_t, int, int, int_t, int,
231 float, SuperMatrix *, SuperMatrix *,
232 GlobalLU_t *, int **, float **);
233extern void sSetRWork (int, int, float *, float **, float **);
234extern void sLUWorkFree (int *, float *, GlobalLU_t *);
235extern int_t sLUMemXpand (int, int_t, MemType, int_t *, GlobalLU_t *);
236
237extern float *floatMalloc(size_t);
238extern float *floatCalloc(size_t);
239extern int_t smemory_usage(const int_t, const int_t, const int_t, const int);
242
244extern void sreadhb(FILE *, int *, int *, int_t *, float **, int_t **, int_t **);
245extern void sreadrb(int *, int *, int_t *, float **, int_t **, int_t **);
246extern void sreadtriple(int *, int *, int_t *, float **, int_t **, int_t **);
247extern void sreadtriple_noheader(int *, int *, int_t *, float **, int_t **, int_t **);
248extern void sreadMM(FILE *, int *, int *, int_t *, float **, int_t **, int_t **);
249extern void sfill (float *, int, float);
250extern void sinf_norm_error (int, SuperMatrix *, float *);
251extern float sqselect(int, float *, int);
252
253
255extern void sPrint_CompCol_Matrix(char *, SuperMatrix *);
256extern void sPrint_SuperNode_Matrix(char *, SuperMatrix *);
257extern void sPrint_Dense_Matrix(char *, SuperMatrix *);
258extern void sprint_lu_col(char *, int, int, int_t *, GlobalLU_t *);
259extern int print_double_vec(char *, int, double *);
260extern void scheck_tempv(int, float *);
261
264extern int sgemm_(const char*, const char*, const int*, const int*, const int*,
265 const float*, const float*, const int*, const float*,
266 const int*, const float*, float*, const int*);
267extern int strsv_(char*, char*, char*, int*, float*, int*,
268 float*, int*);
269extern int strsm_(char*, char*, char*, char*, int*, int*,
270 float*, float*, int*, float*, int*);
271extern int sgemv_(char *, int *, int *, float *, float *a, int *,
272 float *, int *, float *, float *, int *);
273
274extern void susolve(int, int, float*, float*);
275extern void slsolve(int, int, float*, float*);
276extern void smatvec(int, int, int, float*, float*, float*);
277
278#ifdef __cplusplus
279 }
280#endif
281
282#endif /* __SUPERLU_sSP_DEFS */
283
#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:689
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:111
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:85
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:358
float * floatCalloc(size_t)
Definition: smemory.c:699
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
void sreadtriple_noheader(int *, int *, int_t *, float **, int_t **, int_t **)
int_t smemory_usage(const int_t, const int_t, const int_t, const int)
Definition: smemory.c:713
void sgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int_t *info)
Driver routines.
Definition: sgssv.c:144
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:188
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:57
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:190
void sallocateA(int, int_t, float **, int_t **, int_t **)
Allocate storage for original matrix A.
Definition: smemory.c:681
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:67
int ilu_sQuerySpace(SuperMatrix *, SuperMatrix *, mem_usage_t *)
Definition: smemory.c:149
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:201
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
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