00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __SUPERLU_dSP_DEFS
00016 #define __SUPERLU_dSP_DEFS
00017
00018
00019
00020
00021
00022
00023 #ifdef _CRAY
00024 #include <fortran.h>
00025 #include <string.h>
00026 #endif
00027 #include "Cnames.h"
00028 #include "supermatrix.h"
00029
00030
00031
00032
00033 #define NO_MARKER 3
00034 #define NUM_TEMPV(m,w,t,b) ( MAX(m, (t + b)*w) )
00035
00036 typedef enum {LUSUP, UCOL, LSUB, USUB} MemType;
00037 typedef enum {HEAD, TAIL} stack_end_t;
00038 typedef enum {SYSTEM, USER} LU_space_t;
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 typedef struct {
00093 int *xsup;
00094 int *supno;
00095 int *lsub;
00096 int *xlsub;
00097 double *lusup;
00098 int *xlusup;
00099 double *ucol;
00100 int *usub;
00101 int *xusub;
00102 int nzlmax;
00103 int nzumax;
00104 int nzlumax;
00105 int n;
00106 LU_space_t MemModel;
00107 } GlobalLU_t;
00108
00109 typedef struct {
00110 int panel_size;
00111 int relax;
00112 double diag_pivot_thresh;
00113 double drop_tol;
00114 } factor_param_t;
00115
00116 typedef struct {
00117 float for_lu;
00118 float total_needed;
00119 int expansions;
00120 } mem_usage_t;
00121
00122 #ifdef __cplusplus
00123 extern "C" {
00124 #endif
00125
00126
00127 extern void
00128 dgssv(SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *,
00129 SuperMatrix *, int *);
00130 extern void
00131 dgssvx(char *, char *, char *, SuperMatrix *, factor_param_t *,
00132 int *, int *, int *, char *, double *, double *,
00133 SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *,
00134 SuperMatrix *, double *, double *, double *,
00135 double *, mem_usage_t *, int *);
00136
00137
00138 extern void
00139 dCreate_CompCol_Matrix(SuperMatrix *, int, int, int, double *,
00140 int *, int *, Stype_t, Dtype_t, Mtype_t);
00141 extern void
00142 dCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *);
00143 extern void
00144 dCreate_Dense_Matrix(SuperMatrix *, int, int, double *, int,
00145 Stype_t, Dtype_t, Mtype_t);
00146 extern void
00147 dCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, double *,
00148 int *, int *, int *, int *, int *,
00149 Stype_t, Dtype_t, Mtype_t);
00150 extern void
00151 dCopy_Dense_Matrix(int, int, double *, int, double *, int);
00152
00153 extern void Destroy_SuperMatrix_Store(SuperMatrix *);
00154 extern void Destroy_CompCol_Matrix(SuperMatrix *);
00155 extern void Destroy_SuperNode_Matrix(SuperMatrix *);
00156 extern void Destroy_CompCol_Permuted(SuperMatrix *);
00157 extern void Destroy_Dense_Matrix(SuperMatrix *);
00158
00159 extern void dallocateA (int, int, double **, int **, int **);
00160 extern void StatInit (int, int);
00161 extern void StatFree ();
00162 extern void get_perm_c(int, SuperMatrix *, int *);
00163 extern void sp_preorder (char*, SuperMatrix*, int*, int*, SuperMatrix*);
00164 extern int sp_coletree (int *, int *, int *, int, int, int *);
00165 extern void dgstrf (char*, SuperMatrix*, double, double, int, int, int*,
00166 void *, int, int *, int *,
00167 SuperMatrix *, SuperMatrix *, int *);
00168 extern void relax_snode (int, int *, int, int *, int *);
00169 extern int dsnode_dfs (const int, const int, const int *, const int *,
00170 const int *, int *, int *, GlobalLU_t *);
00171 extern int dsnode_bmod (const int, const int, const int, double *,
00172 double *, GlobalLU_t *);
00173 extern void dpanel_dfs (const int, const int, const int, SuperMatrix *,
00174 int *, int *, double *, int *, int *, int *,
00175 int *, int *, int *, int *, GlobalLU_t *);
00176 extern void dpanel_bmod (const int, const int, const int, const int,
00177 double *, double *, int *, int *,
00178 GlobalLU_t *);
00179 extern int dcolumn_dfs (const int, const int, int *, int *, int *, int *,
00180 int *, int *, int *, int *, int *, GlobalLU_t *);
00181 extern int dcolumn_bmod (const int, const int, double *,
00182 double *, int *, int *, int, GlobalLU_t *);
00183 extern int dcopy_to_ucol (int, int, int *, int *, int *,
00184 double *, GlobalLU_t *);
00185 extern int dpivotL (const int, const double, int *, int *,
00186 int *, int *, int *, GlobalLU_t *);
00187 extern void dpruneL (const int, const int *, const int, const int,
00188 const int *, const int *, int *, GlobalLU_t *);
00189 extern void resetrep_col (const int, const int *, int *);
00190 extern void countnz (const int, int *, int *, int *, GlobalLU_t *);
00191 extern void fixupL (const int, const int *, GlobalLU_t *);
00192 extern int spcoletree (int *, int *, int *, int, int, int *);
00193 extern int *TreePostorder (int, int *);
00194 extern void dreadmt (int *, int *, int *, double **, int **, int **);
00195 extern void dGenXtrue (int, int, double *, int);
00196 extern void dFillRHS (char *, int, double *, int, SuperMatrix *,
00197 SuperMatrix *);
00198 extern void dgstrs (char *, SuperMatrix *, SuperMatrix *, int *, int *,
00199 SuperMatrix *, int *);
00200
00201
00202
00203
00204 extern void dgsequ (SuperMatrix *, double *, double *, double *,
00205 double *, double *, int *);
00206 extern void dlaqgs (SuperMatrix *, double *, double *, double,
00207 double, double, char *);
00208 extern void dgscon (char *, SuperMatrix *, SuperMatrix *,
00209 double, double *, int *);
00210 extern double dPivotGrowth(int, SuperMatrix *, int *,
00211 SuperMatrix *, SuperMatrix *);
00212 extern void dgsrfs (char *, SuperMatrix *, SuperMatrix *,
00213 SuperMatrix *, int *, int *, char *, double *,
00214 double *, SuperMatrix *, SuperMatrix *,
00215 double *, double *, int *);
00216
00217 extern int sp_dtrsv (char *, char *, char *, SuperMatrix *,
00218 SuperMatrix *, double *, int *);
00219 extern int sp_dgemv (char *, double, SuperMatrix *, double *,
00220 int, double, double *, int);
00221
00222 extern int sp_dgemm (char *, char *, int, int, int, double,
00223 SuperMatrix *, double *, int, double,
00224 double *, int);
00225
00226
00227 extern void superlu_abort_and_exit(char*);
00228 extern void *superlu_malloc (int);
00229 extern void superlu_free (void*);
00230 extern int dLUMemInit (char *, void *, int, int, int, int, int,
00231 SuperMatrix *, SuperMatrix *,
00232 GlobalLU_t *, int **, double **);
00233 extern void SetIWork (int, int, int, int *, int **, int **, int **,
00234 int **, int **, int **, int **);
00235 extern void dSetRWork (int, int, double *, double **, double **);
00236 extern void dLUWorkFree (int *, double *, GlobalLU_t *);
00237 extern int dLUMemXpand (int, int, MemType, int *, GlobalLU_t *);
00238
00239 extern int *intMalloc (int);
00240 extern int *intCalloc (int);
00241 extern double *doubleMalloc(int);
00242 extern double *doubleCalloc(int);
00243 extern void *superlu_malloc(int);
00244 extern int memory_usage();
00245 extern int dQuerySpace (SuperMatrix *, SuperMatrix *, int,
00246 mem_usage_t *);
00247
00248
00249 extern void dCompRow_to_CompCol(int, int, int, double*, int*, int*,
00250 double **, int **, int **);
00251 extern double SuperLU_timer_ ();
00252 extern int sp_ienv (int);
00253 extern int lsame_ (char *, char *);
00254 extern int xerbla_ (char *, int *);
00255 extern void ifill (int *, int, int);
00256 extern void dfill (double *, int, double);
00257 extern void inf_norm_error (int, SuperMatrix *, double *);
00258 extern void snode_profile (int, int *);
00259 extern void super_stats (int, int *);
00260 extern void PrintSumm (char *, int, int, int);
00261 extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *,
00262 double, double, double *, double *, char *);
00263
00264
00265 extern void dPrint_CompCol_Matrix(char *, SuperMatrix *);
00266 extern void dPrint_SuperNode_Matrix(char *, SuperMatrix *);
00267 extern void dPrint_Dense_Matrix(char *, SuperMatrix *);
00268 extern void print_lu_col(char *, int, int, int *, GlobalLU_t *);
00269 extern void print_panel_seg(int, int, int, int, int *, int *);
00270 extern void check_tempv(int, double *);
00271 extern void check_repfnz(int, int, int, int *);
00272
00273 #ifdef __cplusplus
00274 }
00275 #endif
00276
00277 #endif
00278