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_dSP_DEFS /* allow multiple inclusions */
10
#define __SUPERLU_dSP_DEFS
13
* File name: dsp_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"
32
* Global data structures used in LU factorization -
34
* nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
35
* (xsup,supno): supno[i] is the supernode no to which i belongs;
36
* xsup(s) points to the beginning of the s-th supernode.
37
* e.g. supno 0 1 2 2 3 3 3 4 4 4 4 4 (n=12)
39
* Note: dfs will be performed on supernode rep. relative to the new
40
* row pivoting ordering
42
* (xlsub,lsub): lsub[*] contains the compressed subscript of
43
* rectangular supernodes; xlsub[j] points to the starting
44
* location of the j-th column in lsub[*]. Note that xlsub
45
* is indexed by column.
46
* Storage: original row subscripts
48
* During the course of sparse LU factorization, we also use
49
* (xlsub,lsub) for the purpose of symmetric pruning. For each
50
* supernode {s,s+1,...,t=s+r} with first column s and last
51
* column t, the subscript set
52
* lsub[j], j=xlsub[s], .., xlsub[s+1]-1
53
* is the structure of column s (i.e. structure of this supernode).
54
* It is used for the storage of numerical values.
56
* lsub[j], j=xlsub[t], .., xlsub[t+1]-1
57
* is the structure of the last column t of this supernode.
58
* It is for the purpose of symmetric pruning. Therefore, the
59
* structural subscripts can be rearranged without making physical
60
* interchanges among the numerical values.
62
* However, if the supernode has only one column, then we
63
* only keep one set of subscripts. For any subscript interchange
64
* performed, similar interchange must be done on the numerical
67
* The last column structures (for pruning) will be removed
68
* after the numercial LU factorization phase.
70
* (xlusup,lusup): lusup[*] contains the numerical values of the
71
* rectangular supernodes; xlusup[j] points to the starting
72
* location of the j-th column in storage vector lusup[*]
73
* Note: xlusup is indexed by column.
74
* Each rectangular supernode is stored by column-major
75
* scheme, consistent with Fortran 2-dim array storage.
77
* (xusub,ucol,usub): ucol[*] stores the numerical values of
78
* U-columns outside the rectangular supernodes. The row
79
* subscript of nonzero ucol[k] is stored in usub[k].
80
* xusub[i] points to the starting location of column i in ucol.
81
* Storage: new row subscripts; that is subscripts of PA.
84
int *xsup; /* supernode and column mapping */
86
int *lsub; /* compressed L subscripts */
88
double *lusup; /* L supernodes */
90
double *ucol; /* U columns */
93
int nzlmax; /* current max size of lsub */
94
int nzumax; /* " " " ucol */
95
int nzlumax; /* " " " lusup */
96
int n; /* number of columns in the matrix */
97
LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */
110
/* Driver routines */
112
dgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *,
113
SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *);
115
dgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *,
116
char *, double *, double *, SuperMatrix *, SuperMatrix *,
117
void *, int, SuperMatrix *, SuperMatrix *,
118
double *, double *, double *, double *,
119
mem_usage_t *, SuperLUStat_t *, int *);
121
/* Supernodal LU factor related */
123
dCreate_CompCol_Matrix(SuperMatrix *, int, int, int, double *,
124
int *, int *, Stype_t, Dtype_t, Mtype_t);
126
dCreate_CompRow_Matrix(SuperMatrix *, int, int, int, double *,
127
int *, int *, Stype_t, Dtype_t, Mtype_t);
129
dCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *);
131
dCreate_Dense_Matrix(SuperMatrix *, int, int, double *, int,
132
Stype_t, Dtype_t, Mtype_t);
134
dCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, double *,
135
int *, int *, int *, int *, int *,
136
Stype_t, Dtype_t, Mtype_t);
138
dCopy_Dense_Matrix(int, int, double *, int, double *, int);
140
extern void countnz (const int, int *, int *, int *, GlobalLU_t *);
141
extern void fixupL (const int, const int *, GlobalLU_t *);
143
extern void dallocateA (int, int, double **, int **, int **);
144
extern void dgstrf (superlu_options_t*, SuperMatrix*, double,
145
int, int, int*, void *, int, int *, int *,
146
SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *);
147
extern int dsnode_dfs (const int, const int, const int *, const int *,
148
const int *, int *, int *, GlobalLU_t *);
149
extern int dsnode_bmod (const int, const int, const int, double *,
150
double *, GlobalLU_t *, SuperLUStat_t*);
151
extern void dpanel_dfs (const int, const int, const int, SuperMatrix *,
152
int *, int *, double *, int *, int *, int *,
153
int *, int *, int *, int *, GlobalLU_t *);
154
extern void dpanel_bmod (const int, const int, const int, const int,
155
double *, double *, int *, int *,
156
GlobalLU_t *, SuperLUStat_t*);
157
extern int dcolumn_dfs (const int, const int, int *, int *, int *, int *,
158
int *, int *, int *, int *, int *, GlobalLU_t *);
159
extern int dcolumn_bmod (const int, const int, double *,
160
double *, int *, int *, int,
161
GlobalLU_t *, SuperLUStat_t*);
162
extern int dcopy_to_ucol (int, int, int *, int *, int *,
163
double *, GlobalLU_t *);
164
extern int dpivotL (const int, const double, int *, int *,
165
int *, int *, int *, GlobalLU_t *, SuperLUStat_t*);
166
extern void dpruneL (const int, const int *, const int, const int,
167
const int *, const int *, int *, GlobalLU_t *);
168
extern void dreadmt (int *, int *, int *, double **, int **, int **);
169
extern void dGenXtrue (int, int, double *, int);
170
extern void dFillRHS (trans_t, int, double *, int, SuperMatrix *,
172
extern void dgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *,
173
SuperMatrix *, SuperLUStat_t*, int *);
178
extern void dgsequ (SuperMatrix *, double *, double *, double *,
179
double *, double *, int *);
180
extern void dlaqgs (SuperMatrix *, double *, double *, double,
181
double, double, char *);
182
extern void dgscon (char *, SuperMatrix *, SuperMatrix *,
183
double, double *, SuperLUStat_t*, int *);
184
extern double dPivotGrowth(int, SuperMatrix *, int *,
185
SuperMatrix *, SuperMatrix *);
186
extern void dgsrfs (trans_t, SuperMatrix *, SuperMatrix *,
187
SuperMatrix *, int *, int *, char *, double *,
188
double *, SuperMatrix *, SuperMatrix *,
189
double *, double *, SuperLUStat_t*, int *);
191
extern int sp_dtrsv (char *, char *, char *, SuperMatrix *,
192
SuperMatrix *, double *, SuperLUStat_t*, int *);
193
extern int sp_dgemv (char *, double, SuperMatrix *, double *,
194
int, double, double *, int);
196
extern int sp_dgemm (char *, char *, int, int, int, double,
197
SuperMatrix *, double *, int, double,
201
extern int dLUMemInit (fact_t, void *, int, int, int, int, int,
202
SuperMatrix *, SuperMatrix *,
203
GlobalLU_t *, int **, double **);
204
extern void dSetRWork (int, int, double *, double **, double **);
205
extern void dLUWorkFree (int *, double *, GlobalLU_t *);
206
extern int dLUMemXpand (int, int, MemType, int *, GlobalLU_t *);
208
extern double *doubleMalloc(int);
209
extern double *doubleCalloc(int);
210
extern int dmemory_usage(const int, const int, const int, const int);
211
extern int dQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *);
213
/* Auxiliary routines */
214
extern void dreadhb(int *, int *, int *, double **, int **, int **);
215
extern void dCompRow_to_CompCol(int, int, int, double*, int*, int*,
216
double **, int **, int **);
217
extern void dfill (double *, int, double);
218
extern void dinf_norm_error (int, SuperMatrix *, double *);
219
extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *,
220
double, double, double *, double *, char *);
222
/* Routines for debugging */
223
extern void dPrint_CompCol_Matrix(char *, SuperMatrix *);
224
extern void dPrint_SuperNode_Matrix(char *, SuperMatrix *);
225
extern void dPrint_Dense_Matrix(char *, SuperMatrix *);
226
extern void print_lu_col(char *, int, int, int *, GlobalLU_t *);
227
extern void check_tempv(int, double *);
233
#endif /* __SUPERLU_dSP_DEFS */