slu_sdefs.h
Go to the documentation of this file.
1 
63 #ifndef __SUPERLU_sSP_DEFS /* allow multiple inclusions */
64 #define __SUPERLU_sSP_DEFS
65 
66 /*
67  * File name: ssp_defs.h
68  * Purpose: Sparse matrix types and function prototypes
69  * History:
70  */
71 
72 #ifdef _CRAY
73 #include <fortran.h>
74 #include <string.h>
75 #endif
76 
77 /* Define my integer type int_t */
78 typedef int int_t; /* default */
79 
80 #include <math.h>
81 #include <limits.h>
82 #include "slu_Cnames.h"
83 #include "supermatrix.h"
84 #include "slu_util.h"
85 
86 
87 
88 typedef struct {
89  int *xsup; /* supernode and column mapping */
90  int *supno;
91  int *lsub; /* compressed L subscripts */
92  int *xlsub;
93  float *lusup; /* L supernodes */
94  int *xlusup;
95  float *ucol; /* U columns */
96  int *usub;
97  int *xusub;
98  int nzlmax; /* current max size of lsub */
99  int nzumax; /* " " " ucol */
100  int nzlumax; /* " " " lusup */
101  int n; /* number of columns in the matrix */
102  LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */
103  int num_expansions;
104  ExpHeader *expanders; /* Array of pointers to 4 types of memory */
105  LU_stack_t stack; /* use user supplied memory */
106 } GlobalLU_t;
107 
108 
109 /* -------- Prototypes -------- */
110 
111 #ifdef __cplusplus
112 extern "C" {
113 #endif
114 
116 extern void
118  SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *);
119 extern void
120 sgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *,
121  char *, float *, float *, SuperMatrix *, SuperMatrix *,
122  void *, int, SuperMatrix *, SuperMatrix *,
123  float *, float *, float *, float *,
124  mem_usage_t *, SuperLUStat_t *, int *);
125  /* ILU */
126 extern void
128  SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *);
129 extern void
130 sgsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *,
131  char *, float *, float *, SuperMatrix *, SuperMatrix *,
132  void *, int, SuperMatrix *, SuperMatrix *, float *, float *,
133  mem_usage_t *, SuperLUStat_t *, int *);
134 
135 
137 extern void
138 sCreate_CompCol_Matrix(SuperMatrix *, int, int, int, float *,
139  int *, int *, Stype_t, Dtype_t, Mtype_t);
140 extern void
141 sCreate_CompRow_Matrix(SuperMatrix *, int, int, int, float *,
142  int *, int *, Stype_t, Dtype_t, Mtype_t);
143 extern void
145 extern void
146 sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int,
148 extern void
149 sCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, float *,
150  int *, int *, int *, int *, int *,
152 extern void
153 sCopy_Dense_Matrix(int, int, float *, int, float *, int);
154 
155 extern void countnz (const int, int *, int *, int *, GlobalLU_t *);
156 extern void ilu_countnz (const int, int *, int *, GlobalLU_t *);
157 extern void fixupL (const int, const int *, GlobalLU_t *);
158 
159 extern void sallocateA (int, int, float **, int **, int **);
161  int, int, int*, void *, int, int *, int *,
162  SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *);
163 extern int ssnode_dfs (const int, const int, const int *, const int *,
164  const int *, int *, int *, GlobalLU_t *);
165 extern int ssnode_bmod (const int, const int, const int, float *,
166  float *, GlobalLU_t *, SuperLUStat_t*);
167 extern void spanel_dfs (const int, const int, const int, SuperMatrix *,
168  int *, int *, float *, int *, int *, int *,
169  int *, int *, int *, int *, GlobalLU_t *);
170 extern void spanel_bmod (const int, const int, const int, const int,
171  float *, float *, int *, int *,
173 extern int scolumn_dfs (const int, const int, int *, int *, int *, int *,
174  int *, int *, int *, int *, int *, GlobalLU_t *);
175 extern int scolumn_bmod (const int, const int, float *,
176  float *, int *, int *, int,
178 extern int scopy_to_ucol (int, int, int *, int *, int *,
179  float *, GlobalLU_t *);
180 extern int spivotL (const int, const double, int *, int *,
181  int *, int *, int *, GlobalLU_t *, SuperLUStat_t*);
182 extern void spruneL (const int, const int *, const int, const int,
183  const int *, const int *, int *, GlobalLU_t *);
184 extern void sreadmt (int *, int *, int *, float **, int **, int **);
185 extern void sGenXtrue (int, int, float *, int);
186 extern void sFillRHS (trans_t, int, float *, int, SuperMatrix *,
187  SuperMatrix *);
188 extern void sgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *,
189  SuperMatrix *, SuperLUStat_t*, int *);
190 /* ILU */
191 extern void sgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*,
192  void *, int, int *, int *, SuperMatrix *, SuperMatrix *,
193  SuperLUStat_t*, int *);
194 extern int sldperm(int, int, int, int [], int [], float [],
195  int [], float [], float []);
196 extern int ilu_ssnode_dfs (const int, const int, const int *, const int *,
197  const int *, int *, GlobalLU_t *);
198 extern void ilu_spanel_dfs (const int, const int, const int, SuperMatrix *,
199  int *, int *, float *, float *, int *, int *,
200  int *, int *, int *, int *, GlobalLU_t *);
201 extern int ilu_scolumn_dfs (const int, const int, int *, int *, int *,
202  int *, int *, int *, int *, int *,
203  GlobalLU_t *);
204 extern int ilu_scopy_to_ucol (int, int, int *, int *, int *,
205  float *, int, milu_t, double, int,
206  float *, int *, GlobalLU_t *, float *);
207 extern int ilu_spivotL (const int, const double, int *, int *, int, int *,
208  int *, int *, int *, double, milu_t,
209  float, GlobalLU_t *, SuperLUStat_t*);
210 extern int ilu_sdrop_row (superlu_options_t *, int, int, double,
211  int, int *, double *, GlobalLU_t *,
212  float *, float *, int);
213 
214 
217 extern void sgsequ (SuperMatrix *, float *, float *, float *,
218  float *, float *, int *);
219 extern void slaqgs (SuperMatrix *, float *, float *, float,
220  float, float, char *);
221 extern void sgscon (char *, SuperMatrix *, SuperMatrix *,
222  float, float *, SuperLUStat_t*, int *);
223 extern float sPivotGrowth(int, SuperMatrix *, int *,
224  SuperMatrix *, SuperMatrix *);
226  SuperMatrix *, int *, int *, char *, float *,
227  float *, SuperMatrix *, SuperMatrix *,
228  float *, float *, SuperLUStat_t*, int *);
229 
230 extern int sp_strsv (char *, char *, char *, SuperMatrix *,
231  SuperMatrix *, float *, SuperLUStat_t*, int *);
232 extern int sp_sgemv (char *, float, SuperMatrix *, float *,
233  int, float, float *, int);
234 
235 extern int sp_sgemm (char *, char *, int, int, int, float,
236  SuperMatrix *, float *, int, float,
237  float *, int);
238 extern float slamch_(char *);
239 
240 
242 extern int sLUMemInit (fact_t, void *, int, int, int, int, int,
243  float, SuperMatrix *, SuperMatrix *,
244  GlobalLU_t *, int **, float **);
245 extern void sSetRWork (int, int, float *, float **, float **);
246 extern void sLUWorkFree (int *, float *, GlobalLU_t *);
247 extern int sLUMemXpand (int, int, MemType, int *, GlobalLU_t *);
248 
249 extern float *floatMalloc(int);
250 extern float *floatCalloc(int);
251 extern int smemory_usage(const int, const int, const int, const int);
254 
256 extern void sreadhb(int *, int *, int *, float **, int **, int **);
257 extern void sreadrb(int *, int *, int *, float **, int **, int **);
258 extern void sreadtriple(int *, int *, int *, float **, int **, int **);
259 extern void sCompRow_to_CompCol(int, int, int, float*, int*, int*,
260  float **, int **, int **);
261 extern void sfill (float *, int, float);
262 extern void sinf_norm_error (int, SuperMatrix *, float *);
264  float, float, float *, float *, char *);
265 extern float sqselect(int, float *, int);
266 
267 
269 extern void sPrint_CompCol_Matrix(char *, SuperMatrix *);
270 extern void sPrint_SuperNode_Matrix(char *, SuperMatrix *);
271 extern void sPrint_Dense_Matrix(char *, SuperMatrix *);
272 extern void sprint_lu_col(char *, int, int, int *, GlobalLU_t *);
273 extern int print_double_vec(char *, int, double *);
274 extern void check_tempv(int, float *);
275 
276 #ifdef __cplusplus
277  }
278 #endif
279 
280 #endif /* __SUPERLU_sSP_DEFS */
281 
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
trans_t
Definition: oomph_superlu_4.3/superlu_enum_consts.h:21
milu_t
Definition: oomph_superlu_4.3/superlu_enum_consts.h:28
LU_space_t
Definition: oomph_superlu_4.3/superlu_enum_consts.h:26
MemType
Definition: oomph_superlu_4.3/superlu_enum_consts.h:24
fact_t
Definition: oomph_superlu_4.3/superlu_enum_consts.h:17
Mtype_t
Definition: oomph_superlu_4.3/supermatrix.h:31
Dtype_t
Definition: oomph_superlu_4.3/supermatrix.h:24
Stype_t
Definition: oomph_superlu_4.3/supermatrix.h:11
Matrix type definitions.
Macros defining how C routines will be called.
int sQuerySpace(SuperMatrix *, SuperMatrix *, mem_usage_t *)
void sgscon(char *, SuperMatrix *, SuperMatrix *, float, float *, SuperLUStat_t *, int *)
int scolumn_dfs(const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
void sgsitrf(superlu_options_t *, SuperMatrix *, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
int scopy_to_ucol(int, int, int *, int *, int *, float *, GlobalLU_t *)
void sPrint_Dense_Matrix(char *, SuperMatrix *)
void sprint_lu_col(char *, int, int, int *, GlobalLU_t *)
void sfill(float *, int, float)
int ilu_scopy_to_ucol(int, int, int *, int *, int *, float *, int, milu_t, double, int, float *, int *, GlobalLU_t *, float *)
int sp_sgemm(char *, char *, int, int, int, float, SuperMatrix *, float *, int, float, float *, int)
void sgsequ(SuperMatrix *, float *, float *, float *, float *, float *, int *)
Driver related.
float * floatCalloc(int)
float * floatMalloc(int)
void sgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
Driver routines.
void check_tempv(int, float *)
float slamch_(char *)
void sgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, float *, float *, float *, float *, mem_usage_t *, SuperLUStat_t *, int *)
void spanel_bmod(const int, const int, const int, const int, float *, float *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
void sPrint_CompCol_Matrix(char *, SuperMatrix *)
Routines for debugging.
void sCopy_Dense_Matrix(int, int, float *, int, float *, int)
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 *)
int sldperm(int, int, int, int[], int[], float[], int[], float[], float[])
void fixupL(const int, const int *, GlobalLU_t *)
int ilu_ssnode_dfs(const int, const int, const int *, const int *, const int *, int *, GlobalLU_t *)
void sreadhb(int *, int *, int *, float **, int **, int **)
Auxiliary routines.
void sCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *)
void sCreate_CompRow_Matrix(SuperMatrix *, int, int, int, float *, int *, int *, Stype_t, Dtype_t, Mtype_t)
void spanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, float *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
void countnz(const int, int *, int *, int *, GlobalLU_t *)
void sLUWorkFree(int *, float *, GlobalLU_t *)
float sqselect(int, float *, int)
int sLUMemXpand(int, int, MemType, int *, GlobalLU_t *)
int sp_sgemv(char *, float, SuperMatrix *, float *, int, float, float *, int)
int sp_strsv(char *, char *, char *, SuperMatrix *, SuperMatrix *, float *, SuperLUStat_t *, int *)
void ilu_spanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, float *, float *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
int ilu_scolumn_dfs(const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
int print_double_vec(char *, int, double *)
void ilu_countnz(const int, int *, int *, GlobalLU_t *)
void sallocateA(int, int, float **, int **, int **)
void sreadmt(int *, int *, int *, float **, int **, int **)
int smemory_usage(const int, const int, const int, const int)
void sgsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, float *, float *, mem_usage_t *, SuperLUStat_t *, int *)
void sSetRWork(int, int, float *, float **, float **)
int int_t
Definition: slu_sdefs.h:78
void sGenXtrue(int, int, float *, int)
int ilu_spivotL(const int, const double, int *, int *, int, int *, int *, int *, int *, double, milu_t, float, GlobalLU_t *, SuperLUStat_t *)
void sinf_norm_error(int, SuperMatrix *, float *)
void sCreate_CompCol_Matrix(SuperMatrix *, int, int, int, float *, int *, int *, Stype_t, Dtype_t, Mtype_t)
Supernodal LU factor related.
void sFillRHS(trans_t, int, float *, int, SuperMatrix *, SuperMatrix *)
void sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int, Stype_t, Dtype_t, Mtype_t)
float sPivotGrowth(int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
void spruneL(const int, const int *, const int, const int, const int *, const int *, int *, GlobalLU_t *)
int spivotL(const int, const double, int *, int *, int *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
void sreadrb(int *, int *, int *, float **, int **, int **)
int ssnode_dfs(const int, const int, const int *, const int *, const int *, int *, int *, GlobalLU_t *)
int ilu_sQuerySpace(SuperMatrix *, SuperMatrix *, mem_usage_t *)
void PrintPerf(SuperMatrix *, SuperMatrix *, mem_usage_t *, float, float, float *, float *, char *)
int scolumn_bmod(const int, const int, float *, float *, int *, int *, int, GlobalLU_t *, SuperLUStat_t *)
void sgsrfs(trans_t, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, float *, float *, SuperLUStat_t *, int *)
void sreadtriple(int *, int *, int *, float **, int **, int **)
void sgstrs(trans_t, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, SuperLUStat_t *, int *)
void sPrint_SuperNode_Matrix(char *, SuperMatrix *)
void sCompRow_to_CompCol(int, int, int, float *, int *, int *, float **, int **, int **)
void sgstrf(superlu_options_t *, SuperMatrix *, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
void sCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, float *, int *, int *, int *, int *, int *, Stype_t, Dtype_t, Mtype_t)
int sLUMemInit(fact_t, void *, int, int, int, int, int, float, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, float **)
Memory-related.
void slaqgs(SuperMatrix *, float *, float *, float, float, float, char *)
void sgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
Utility header file.
Definition: slu_cdefs.h:89
float * ucol
Definition: slu_sdefs.h:95
float * lusup
Definition: slu_sdefs.h:93
Definition: slu_util.h:282
Definition: slu_util.h:290
Definition: oomph_superlu_4.3/supermatrix.h:43
Headers for 4 types of dynamatically managed memory.
Definition: slu_util.h:277
Definition: slu_util.h:299
Definition: slu_util.h:246