3
* -- SuperLU routine (version 3.0) --
4
* Univ. of California Berkeley, Xerox Palo Alto Research Center,
5
* and Lawrence Berkeley National Lab.
9
#ifndef __SUPERLU_cSP_DEFS /* allow multiple inclusions */
10
#define __SUPERLU_cSP_DEFS
13
* File name: csp_defs.h
14
* Purpose: Sparse matrix types and function prototypes
23
/* Define my integer type int_t */
24
typedef int int_t; /* default */
27
#include "supermatrix.h"
33
* Global data structures used in LU factorization -
35
* nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
36
* (xsup,supno): supno[i] is the supernode no to which i belongs;
37
* xsup(s) points to the beginning of the s-th supernode.
38
* e.g. supno 0 1 2 2 3 3 3 4 4 4 4 4 (n=12)
40
* Note: dfs will be performed on supernode rep. relative to the new
41
* row pivoting ordering
43
* (xlsub,lsub): lsub[*] contains the compressed subscript of
44
* rectangular supernodes; xlsub[j] points to the starting
45
* location of the j-th column in lsub[*]. Note that xlsub
46
* is indexed by column.
47
* Storage: original row subscripts
49
* During the course of sparse LU factorization, we also use
50
* (xlsub,lsub) for the purpose of symmetric pruning. For each
51
* supernode {s,s+1,...,t=s+r} with first column s and last
52
* column t, the subscript set
53
* lsub[j], j=xlsub[s], .., xlsub[s+1]-1
54
* is the structure of column s (i.e. structure of this supernode).
55
* It is used for the storage of numerical values.
57
* lsub[j], j=xlsub[t], .., xlsub[t+1]-1
58
* is the structure of the last column t of this supernode.
59
* It is for the purpose of symmetric pruning. Therefore, the
60
* structural subscripts can be rearranged without making physical
61
* interchanges among the numerical values.
63
* However, if the supernode has only one column, then we
64
* only keep one set of subscripts. For any subscript interchange
65
* performed, similar interchange must be done on the numerical
68
* The last column structures (for pruning) will be removed
69
* after the numercial LU factorization phase.
71
* (xlusup,lusup): lusup[*] contains the numerical values of the
72
* rectangular supernodes; xlusup[j] points to the starting
73
* location of the j-th column in storage vector lusup[*]
74
* Note: xlusup is indexed by column.
75
* Each rectangular supernode is stored by column-major
76
* scheme, consistent with Fortran 2-dim array storage.
78
* (xusub,ucol,usub): ucol[*] stores the numerical values of
79
* U-columns outside the rectangular supernodes. The row
80
* subscript of nonzero ucol[k] is stored in usub[k].
81
* xusub[i] points to the starting location of column i in ucol.
82
* Storage: new row subscripts; that is subscripts of PA.
85
int *xsup; /* supernode and column mapping */
87
int *lsub; /* compressed L subscripts */
89
complex *lusup; /* L supernodes */
91
complex *ucol; /* U columns */
94
int nzlmax; /* current max size of lsub */
95
int nzumax; /* " " " ucol */
96
int nzlumax; /* " " " lusup */
97
int n; /* number of columns in the matrix */
98
LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */
111
/* Driver routines */
113
cgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *,
114
SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *);
116
cgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *,
117
char *, float *, float *, SuperMatrix *, SuperMatrix *,
118
void *, int, SuperMatrix *, SuperMatrix *,
119
float *, float *, float *, float *,
120
mem_usage_t *, SuperLUStat_t *, int *);
122
/* Supernodal LU factor related */
124
cCreate_CompCol_Matrix(SuperMatrix *, int, int, int, complex *,
125
int *, int *, Stype_t, Dtype_t, Mtype_t);
127
cCreate_CompRow_Matrix(SuperMatrix *, int, int, int, complex *,
128
int *, int *, Stype_t, Dtype_t, Mtype_t);
130
cCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *);
132
cCreate_Dense_Matrix(SuperMatrix *, int, int, complex *, int,
133
Stype_t, Dtype_t, Mtype_t);
135
cCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, complex *,
136
int *, int *, int *, int *, int *,
137
Stype_t, Dtype_t, Mtype_t);
139
cCopy_Dense_Matrix(int, int, complex *, int, complex *, int);
141
extern void countnz (const int, int *, int *, int *, GlobalLU_t *);
142
extern void fixupL (const int, const int *, GlobalLU_t *);
144
extern void callocateA (int, int, complex **, int **, int **);
145
extern void cgstrf (superlu_options_t*, SuperMatrix*, float,
146
int, int, int*, void *, int, int *, int *,
147
SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *);
148
extern int csnode_dfs (const int, const int, const int *, const int *,
149
const int *, int *, int *, GlobalLU_t *);
150
extern int csnode_bmod (const int, const int, const int, complex *,
151
complex *, GlobalLU_t *, SuperLUStat_t*);
152
extern void cpanel_dfs (const int, const int, const int, SuperMatrix *,
153
int *, int *, complex *, int *, int *, int *,
154
int *, int *, int *, int *, GlobalLU_t *);
155
extern void cpanel_bmod (const int, const int, const int, const int,
156
complex *, complex *, int *, int *,
157
GlobalLU_t *, SuperLUStat_t*);
158
extern int ccolumn_dfs (const int, const int, int *, int *, int *, int *,
159
int *, int *, int *, int *, int *, GlobalLU_t *);
160
extern int ccolumn_bmod (const int, const int, complex *,
161
complex *, int *, int *, int,
162
GlobalLU_t *, SuperLUStat_t*);
163
extern int ccopy_to_ucol (int, int, int *, int *, int *,
164
complex *, GlobalLU_t *);
165
extern int cpivotL (const int, const float, int *, int *,
166
int *, int *, int *, GlobalLU_t *, SuperLUStat_t*);
167
extern void cpruneL (const int, const int *, const int, const int,
168
const int *, const int *, int *, GlobalLU_t *);
169
extern void creadmt (int *, int *, int *, complex **, int **, int **);
170
extern void cGenXtrue (int, int, complex *, int);
171
extern void cFillRHS (trans_t, int, complex *, int, SuperMatrix *,
173
extern void cgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *,
174
SuperMatrix *, SuperLUStat_t*, int *);
179
extern void cgsequ (SuperMatrix *, float *, float *, float *,
180
float *, float *, int *);
181
extern void claqgs (SuperMatrix *, float *, float *, float,
182
float, float, char *);
183
extern void cgscon (char *, SuperMatrix *, SuperMatrix *,
184
float, float *, SuperLUStat_t*, int *);
185
extern float cPivotGrowth(int, SuperMatrix *, int *,
186
SuperMatrix *, SuperMatrix *);
187
extern void cgsrfs (trans_t, SuperMatrix *, SuperMatrix *,
188
SuperMatrix *, int *, int *, char *, float *,
189
float *, SuperMatrix *, SuperMatrix *,
190
float *, float *, SuperLUStat_t*, int *);
192
extern int sp_ctrsv (char *, char *, char *, SuperMatrix *,
193
SuperMatrix *, complex *, SuperLUStat_t*, int *);
194
extern int sp_cgemv (char *, complex, SuperMatrix *, complex *,
195
int, complex, complex *, int);
197
extern int sp_cgemm (char *, char *, int, int, int, complex,
198
SuperMatrix *, complex *, int, complex,
202
extern int cLUMemInit (fact_t, void *, int, int, int, int, int,
203
SuperMatrix *, SuperMatrix *,
204
GlobalLU_t *, int **, complex **);
205
extern void cSetRWork (int, int, complex *, complex **, complex **);
206
extern void cLUWorkFree (int *, complex *, GlobalLU_t *);
207
extern int cLUMemXpand (int, int, MemType, int *, GlobalLU_t *);
209
extern complex *complexMalloc(int);
210
extern complex *complexCalloc(int);
211
extern float *floatMalloc(int);
212
extern float *floatCalloc(int);
213
extern int cmemory_usage(const int, const int, const int, const int);
214
extern int cQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *);
216
/* Auxiliary routines */
217
extern void creadhb(int *, int *, int *, complex **, int **, int **);
218
extern void cCompRow_to_CompCol(int, int, int, complex*, int*, int*,
219
complex **, int **, int **);
220
extern void cfill (complex *, int, complex);
221
extern void cinf_norm_error (int, SuperMatrix *, complex *);
222
extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *,
223
complex, complex, complex *, complex *, char *);
225
/* Routines for debugging */
226
extern void cPrint_CompCol_Matrix(char *, SuperMatrix *);
227
extern void cPrint_SuperNode_Matrix(char *, SuperMatrix *);
228
extern void cPrint_Dense_Matrix(char *, SuperMatrix *);
229
extern void print_lu_col(char *, int, int, int *, GlobalLU_t *);
230
extern void check_tempv(int, complex *);
236
#endif /* __SUPERLU_cSP_DEFS */