00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __SUPERLU_cSP_DEFS
00017 #define __SUPERLU_cSP_DEFS
00018
00019
00020
00021
00022
00023
00024 #ifdef _CRAY
00025 #include <fortran.h>
00026 #include <string.h>
00027 #endif
00028 #include "Cnames.h"
00029 #include "supermatrix.h"
00030 #include "scomplex.h"
00031
00032
00033
00034
00035 #define NO_MARKER 3
00036 #define NUM_TEMPV(m,w,t,b) ( MAX(m, (t + b)*w) )
00037
00038 typedef enum {LUSUP, UCOL, LSUB, USUB} MemType;
00039 typedef enum {HEAD, TAIL} stack_end_t;
00040 typedef enum {SYSTEM, USER} LU_space_t;
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
00094 typedef struct {
00095 int *xsup;
00096 int *supno;
00097 int *lsub;
00098 int *xlsub;
00099 complex *lusup;
00100 int *xlusup;
00101 complex *ucol;
00102 int *usub;
00103 int *xusub;
00104 int nzlmax;
00105 int nzumax;
00106 int nzlumax;
00107 int n;
00108 LU_space_t MemModel;
00109 } GlobalLU_t;
00110
00111 typedef struct {
00112 int panel_size;
00113 int relax;
00114 float diag_pivot_thresh;
00115 float drop_tol;
00116 } factor_param_t;
00117
00118 typedef struct {
00119 float for_lu;
00120 float total_needed;
00121 int expansions;
00122 } mem_usage_t;
00123
00124 #ifdef __cplusplus
00125 extern "C" {
00126 #endif
00127
00128
00129 extern void
00130 cgssv(SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *,
00131 SuperMatrix *, int *);
00132 extern void
00133 cgssvx(char *, char *, char *, SuperMatrix *, factor_param_t *,
00134 int *, int *, int *, char *, float *, float *,
00135 SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *,
00136 SuperMatrix *, float *, float *, float *,
00137 float *, mem_usage_t *, int *);
00138
00139
00140 extern void
00141 cCreate_CompCol_Matrix(SuperMatrix *, int, int, int, complex *,
00142 int *, int *, Stype_t, Dtype_t, Mtype_t);
00143 extern void
00144 cCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *);
00145 extern void
00146 cCreate_Dense_Matrix(SuperMatrix *, int, int, complex *, int,
00147 Stype_t, Dtype_t, Mtype_t);
00148 extern void
00149 cCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, complex *,
00150 int *, int *, int *, int *, int *,
00151 Stype_t, Dtype_t, Mtype_t);
00152 extern void
00153 cCopy_Dense_Matrix(int, int, complex *, int, complex *, int);
00154
00155 extern void Destroy_SuperMatrix_Store(SuperMatrix *);
00156 extern void Destroy_CompCol_Matrix(SuperMatrix *);
00157 extern void Destroy_SuperNode_Matrix(SuperMatrix *);
00158 extern void Destroy_CompCol_Permuted(SuperMatrix *);
00159 extern void Destroy_Dense_Matrix(SuperMatrix *);
00160
00161 extern void callocateA (int, int, complex **, int **, int **);
00162 extern void StatInit (int, int);
00163 extern void StatFree ();
00164 extern void get_perm_c(int, SuperMatrix *, int *);
00165 extern void sp_preorder (char*, SuperMatrix*, int*, int*, SuperMatrix*);
00166 extern int sp_coletree (int *, int *, int *, int, int, int *);
00167 extern void cgstrf (char*, SuperMatrix*, float, float, int, int, int*,
00168 void *, int, int *, int *,
00169 SuperMatrix *, SuperMatrix *, int *);
00170 extern void relax_snode (int, int *, int, int *, int *);
00171 extern int csnode_dfs (const int, const int, const int *, const int *,
00172 const int *, int *, int *, GlobalLU_t *);
00173 extern int csnode_bmod (const int, const int, const int, complex *,
00174 complex *, GlobalLU_t *);
00175 extern void cpanel_dfs (const int, const int, const int, SuperMatrix *,
00176 int *, int *, complex *, int *, int *, int *,
00177 int *, int *, int *, int *, GlobalLU_t *);
00178 extern void cpanel_bmod (const int, const int, const int, const int,
00179 complex *, complex *, int *, int *,
00180 GlobalLU_t *);
00181 extern int ccolumn_dfs (const int, const int, int *, int *, int *, int *,
00182 int *, int *, int *, int *, int *, GlobalLU_t *);
00183 extern int ccolumn_bmod (const int, const int, complex *,
00184 complex *, int *, int *, int, GlobalLU_t *);
00185 extern int ccopy_to_ucol (int, int, int *, int *, int *,
00186 complex *, GlobalLU_t *);
00187 extern int cpivotL (const int, const float, int *, int *,
00188 int *, int *, int *, GlobalLU_t *);
00189 extern void cpruneL (const int, const int *, const int, const int,
00190 const int *, const int *, int *, GlobalLU_t *);
00191 extern void resetrep_col (const int, const int *, int *);
00192 extern void countnz (const int, int *, int *, int *, GlobalLU_t *);
00193 extern void fixupL (const int, const int *, GlobalLU_t *);
00194 extern int spcoletree (int *, int *, int *, int, int, int *);
00195 extern int *TreePostorder (int, int *);
00196 extern void creadmt (int *, int *, int *, complex **, int **, int **);
00197 extern void cGenXtrue (int, int, complex *, int);
00198 extern void cFillRHS (char *, int, complex *, int, SuperMatrix *,
00199 SuperMatrix *);
00200 extern void cgstrs (char *, SuperMatrix *, SuperMatrix *, int *, int *,
00201 SuperMatrix *, int *);
00202
00203
00204
00205
00206 extern void cgsequ (SuperMatrix *, float *, float *, float *,
00207 float *, float *, int *);
00208 extern void claqgs (SuperMatrix *, float *, float *, float,
00209 float, float, char *);
00210 extern void cgscon (char *, SuperMatrix *, SuperMatrix *,
00211 float, float *, int *);
00212 extern float cPivotGrowth(int, SuperMatrix *, int *,
00213 SuperMatrix *, SuperMatrix *);
00214 extern void cgsrfs (char *, SuperMatrix *, SuperMatrix *,
00215 SuperMatrix *, int *, int *, char *, float *,
00216 float *, SuperMatrix *, SuperMatrix *, float *,
00217 float *, int *);
00218
00219 extern int sp_ctrsv (char *, char *, char *, SuperMatrix *,
00220 SuperMatrix *, complex *, int *);
00221 extern int sp_cgemv (char *, complex, SuperMatrix *, complex *,
00222 int, complex, complex *, int);
00223
00224 extern int sp_cgemm (char *, char *, int, int, int, complex,
00225 SuperMatrix *, complex *, int, complex,
00226 complex *, int);
00227
00228
00229 extern void superlu_abort_and_exit(char*);
00230 extern void *superlu_malloc (int);
00231 extern void superlu_free (void*);
00232 extern int cLUMemInit (char *, void *, int, int, int, int, int,
00233 SuperMatrix *, SuperMatrix *,
00234 GlobalLU_t *, int **, complex **);
00235 extern void SetIWork (int, int, int, int *, int **, int **, int **,
00236 int **, int **, int **, int **);
00237 extern void cSetRWork (int, int, complex *, complex **, complex **);
00238 extern void cLUWorkFree (int *, complex *, GlobalLU_t *);
00239 extern int cLUMemXpand (int, int, MemType, int *, GlobalLU_t *);
00240
00241 extern int *intMalloc (int);
00242 extern int *intCalloc (int);
00243 extern complex *complexMalloc(int);
00244 extern complex *complexCalloc(int);
00245 extern float *floatMalloc(int);
00246 extern float *floatCalloc(int);
00247 extern void *superlu_malloc(int);
00248 extern int memory_usage();
00249 extern int cQuerySpace (SuperMatrix *, SuperMatrix *, int,
00250 mem_usage_t *);
00251
00252
00253 extern void cCompRow_to_CompCol(int, int, int, complex*, int*, int*,
00254 complex **, int **, int **);
00255 extern double SuperLU_timer_ ();
00256 extern int sp_ienv (int);
00257 extern int lsame_ (char *, char *);
00258 extern int xerbla_ (char *, int *);
00259 extern void ifill (int *, int, int);
00260 extern void cfill (complex *, int, complex);
00261 extern void inf_norm_error (int, SuperMatrix *, complex *);
00262 extern void snode_profile (int, int *);
00263 extern void super_stats (int, int *);
00264 extern void PrintSumm (char *, int, int, int);
00265 extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *,
00266 complex, complex, complex *, complex *, char *);
00267
00268
00269 extern void cPrint_CompCol_Matrix(char *, SuperMatrix *);
00270 extern void cPrint_SuperNode_Matrix(char *, SuperMatrix *);
00271 extern void cPrint_Dense_Matrix(char *, SuperMatrix *);
00272 extern void print_lu_col(char *, int, int, int *, GlobalLU_t *);
00273 extern void print_panel_seg(int, int, int, int, int *, int *);
00274 extern void check_tempv(int, complex *);
00275 extern void check_repfnz(int, int, int, int *);
00276
00277 #ifdef __cplusplus
00278 }
00279 #endif
00280
00281 #endif
00282