00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __SUPERLU_zSP_DEFS
00016 #define __SUPERLU_zSP_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 #include "dcomplex.h"
00030
00031
00032
00033
00034 #define NO_MARKER 3
00035 #define NUM_TEMPV(m,w,t,b) ( MAX(m, (t + b)*w) )
00036
00037 typedef enum {LUSUP, UCOL, LSUB, USUB} MemType;
00038 typedef enum {HEAD, TAIL} stack_end_t;
00039 typedef enum {SYSTEM, USER} LU_space_t;
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
00093 typedef struct {
00094 int *xsup;
00095 int *supno;
00096 int *lsub;
00097 int *xlsub;
00098 doublecomplex *lusup;
00099 int *xlusup;
00100 doublecomplex *ucol;
00101 int *usub;
00102 int *xusub;
00103 int nzlmax;
00104 int nzumax;
00105 int nzlumax;
00106 int n;
00107 LU_space_t MemModel;
00108 } GlobalLU_t;
00109
00110 typedef struct {
00111 int panel_size;
00112 int relax;
00113 double diag_pivot_thresh;
00114 double drop_tol;
00115 } factor_param_t;
00116
00117 typedef struct {
00118 float for_lu;
00119 float total_needed;
00120 int expansions;
00121 } mem_usage_t;
00122
00123 #ifdef __cplusplus
00124 extern "C" {
00125 #endif
00126
00127
00128 extern void
00129 zgssv(SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *,
00130 SuperMatrix *, int *);
00131 extern void
00132 zgssvx(char *, char *, char *, SuperMatrix *, factor_param_t *,
00133 int *, int *, int *, char *, double *, double *,
00134 SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *,
00135 SuperMatrix *, double *, double *, double *,
00136 double *, mem_usage_t *, int *);
00137
00138
00139 extern void
00140 zCreate_CompCol_Matrix(SuperMatrix *, int, int, int, doublecomplex *,
00141 int *, int *, Stype_t, Dtype_t, Mtype_t);
00142 extern void
00143 zCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *);
00144 extern void
00145 zCreate_Dense_Matrix(SuperMatrix *, int, int, doublecomplex *, int,
00146 Stype_t, Dtype_t, Mtype_t);
00147 extern void
00148 zCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, doublecomplex *,
00149 int *, int *, int *, int *, int *,
00150 Stype_t, Dtype_t, Mtype_t);
00151 extern void
00152 zCopy_Dense_Matrix(int, int, doublecomplex *, int, doublecomplex *, int);
00153
00154 extern void Destroy_SuperMatrix_Store(SuperMatrix *);
00155 extern void Destroy_CompCol_Matrix(SuperMatrix *);
00156 extern void Destroy_SuperNode_Matrix(SuperMatrix *);
00157 extern void Destroy_CompCol_Permuted(SuperMatrix *);
00158 extern void Destroy_Dense_Matrix(SuperMatrix *);
00159
00160 extern void zallocateA (int, int, doublecomplex **, int **, int **);
00161 extern void StatInit (int, int);
00162 extern void StatFree ();
00163 extern void get_perm_c(int, SuperMatrix *, int *);
00164 extern void sp_preorder (char*, SuperMatrix*, int*, int*, SuperMatrix*);
00165 extern int sp_coletree (int *, int *, int *, int, int, int *);
00166 extern void zgstrf (char*, SuperMatrix*, double, double, int, int, int*,
00167 void *, int, int *, int *,
00168 SuperMatrix *, SuperMatrix *, int *);
00169 extern void relax_snode (int, int *, int, int *, int *);
00170 extern int zsnode_dfs (const int, const int, const int *, const int *,
00171 const int *, int *, int *, GlobalLU_t *);
00172 extern int zsnode_bmod (const int, const int, const int, doublecomplex *,
00173 doublecomplex *, GlobalLU_t *);
00174 extern void zpanel_dfs (const int, const int, const int, SuperMatrix *,
00175 int *, int *, doublecomplex *, int *, int *, int *,
00176 int *, int *, int *, int *, GlobalLU_t *);
00177 extern void zpanel_bmod (const int, const int, const int, const int,
00178 doublecomplex *, doublecomplex *, int *, int *,
00179 GlobalLU_t *);
00180 extern int zcolumn_dfs (const int, const int, int *, int *, int *, int *,
00181 int *, int *, int *, int *, int *, GlobalLU_t *);
00182 extern int zcolumn_bmod (const int, const int, doublecomplex *,
00183 doublecomplex *, int *, int *, int, GlobalLU_t *);
00184 extern int zcopy_to_ucol (int, int, int *, int *, int *,
00185 doublecomplex *, GlobalLU_t *);
00186 extern int zpivotL (const int, const double, int *, int *,
00187 int *, int *, int *, GlobalLU_t *);
00188 extern void zpruneL (const int, const int *, const int, const int,
00189 const int *, const int *, int *, GlobalLU_t *);
00190 extern void resetrep_col (const int, const int *, int *);
00191 extern void countnz (const int, int *, int *, int *, GlobalLU_t *);
00192 extern void fixupL (const int, const int *, GlobalLU_t *);
00193 extern int spcoletree (int *, int *, int *, int, int, int *);
00194 extern int *TreePostorder (int, int *);
00195 extern void zreadmt (int *, int *, int *, doublecomplex **, int **, int **);
00196 extern void zGenXtrue (int, int, doublecomplex *, int);
00197 extern void zFillRHS (char *, int, doublecomplex *, int, SuperMatrix *,
00198 SuperMatrix *);
00199 extern void zgstrs (char *, SuperMatrix *, SuperMatrix *, int *, int *,
00200 SuperMatrix *, int *);
00201
00202
00203
00204
00205 extern void zgsequ (SuperMatrix *, double *, double *, double *,
00206 double *, double *, int *);
00207 extern void zlaqgs (SuperMatrix *, double *, double *, double,
00208 double, double, char *);
00209 extern void zgscon (char *, SuperMatrix *, SuperMatrix *,
00210 double, double *, int *);
00211 extern double zPivotGrowth(int, SuperMatrix *, int *,
00212 SuperMatrix *, SuperMatrix *);
00213 extern void zgsrfs (char *, SuperMatrix *, SuperMatrix *,
00214 SuperMatrix *, int *, int *, char *, double *,
00215 double *, SuperMatrix *, SuperMatrix *,
00216 double *, double *, int *);
00217
00218 extern int sp_ztrsv (char *, char *, char *, SuperMatrix *,
00219 SuperMatrix *, doublecomplex *, int *);
00220 extern int sp_zgemv (char *, doublecomplex, SuperMatrix *, doublecomplex *,
00221 int, doublecomplex, doublecomplex *, int);
00222
00223 extern int sp_zgemm (char *, char *, int, int, int, doublecomplex,
00224 SuperMatrix *, doublecomplex *, int, doublecomplex,
00225 doublecomplex *, int);
00226
00227
00228 extern void superlu_abort_and_exit(char*);
00229 extern void *superlu_malloc (int);
00230 extern void superlu_free (void*);
00231 extern int zLUMemInit (char *, void *, int, int, int, int, int,
00232 SuperMatrix *, SuperMatrix *,
00233 GlobalLU_t *, int **, doublecomplex **);
00234 extern void SetIWork (int, int, int, int *, int **, int **, int **,
00235 int **, int **, int **, int **);
00236 extern void zSetRWork (int, int, doublecomplex *, doublecomplex **, doublecomplex **);
00237 extern void zLUWorkFree (int *, doublecomplex *, GlobalLU_t *);
00238 extern int zLUMemXpand (int, int, MemType, int *, GlobalLU_t *);
00239
00240 extern int *intMalloc (int);
00241 extern int *intCalloc (int);
00242 extern doublecomplex *doublecomplexMalloc(int);
00243 extern doublecomplex *doublecomplexCalloc(int);
00244 extern double *doubleMalloc(int);
00245 extern double *doubleCalloc(int);
00246 extern void *superlu_malloc(int);
00247 extern int memory_usage();
00248 extern int zQuerySpace (SuperMatrix *, SuperMatrix *, int,
00249 mem_usage_t *);
00250
00251
00252 extern void zCompRow_to_CompCol(int, int, int, doublecomplex*, int*, int*,
00253 doublecomplex **, int **, int **);
00254 extern double SuperLU_timer_ ();
00255 extern int sp_ienv (int);
00256 extern int lsame_ (char *, char *);
00257 extern int xerbla_ (char *, int *);
00258 extern void ifill (int *, int, int);
00259 extern void zfill (doublecomplex *, int, doublecomplex);
00260 extern void inf_norm_error (int, SuperMatrix *, doublecomplex *);
00261 extern void snode_profile (int, int *);
00262 extern void super_stats (int, int *);
00263 extern void PrintSumm (char *, int, int, int);
00264 extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *,
00265 doublecomplex, doublecomplex, doublecomplex *, doublecomplex *, char *);
00266
00267
00268 extern void zPrint_CompCol_Matrix(char *, SuperMatrix *);
00269 extern void zPrint_SuperNode_Matrix(char *, SuperMatrix *);
00270 extern void zPrint_Dense_Matrix(char *, SuperMatrix *);
00271 extern void print_lu_col(char *, int, int, int *, GlobalLU_t *);
00272 extern void print_panel_seg(int, int, int, int, int *, int *);
00273 extern void check_tempv(int, doublecomplex *);
00274 extern void check_repfnz(int, int, int, int *);
00275
00276 #ifdef __cplusplus
00277 }
00278 #endif
00279
00280 #endif
00281