|
kusano |
7d535a |
|
|
kusano |
7d535a |
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
|
|
kusano |
7d535a |
<title>SuperLU: SRC/slu_util.h Source File</title>
|
|
kusano |
7d535a |
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
kusano |
7d535a |
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Main Page
|
|
kusano |
7d535a |
Data Structures
|
|
kusano |
7d535a |
Files
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
SRC/slu_util.hGo to the documentation of this file.
|
|
kusano |
7d535a |
00011 #ifndef __SUPERLU_UTIL
|
|
kusano |
7d535a |
00012 #define __SUPERLU_UTIL
|
|
kusano |
7d535a |
00013
|
|
kusano |
7d535a |
00014 #include <stdio.h>
|
|
kusano |
7d535a |
00015 #include <stdlib.h>
|
|
kusano |
7d535a |
00016 #include <string.h>
|
|
kusano |
7d535a |
00017
|
|
kusano |
7d535a |
00018
|
|
kusano |
7d535a |
00019
|
|
kusano |
7d535a |
00020
|
|
kusano |
7d535a |
00021
|
|
kusano |
7d535a |
00022 #include <assert.h>
|
|
kusano |
7d535a |
00023 #include "superlu_enum_consts.h"
|
|
kusano |
7d535a |
00024
|
|
kusano |
7d535a |
00025
|
|
kusano |
7d535a |
00026
|
|
kusano |
7d535a |
00027
|
|
kusano |
7d535a |
00028 #define FIRSTCOL_OF_SNODE(i) (xsup[i])
|
|
kusano |
7d535a |
00029
|
|
kusano |
7d535a |
00030
|
|
kusano |
7d535a |
00031 #define NO_MARKER 3
|
|
kusano |
7d535a |
00032 #define NUM_TEMPV(m,w,t,b) ( SUPERLU_MAX(m, (t + b)*w) )
|
|
kusano |
7d535a |
00033
|
|
kusano |
7d535a |
00034 #ifndef USER_ABORT
|
|
kusano |
7d535a |
00035 #define USER_ABORT(msg) superlu_abort_and_exit(msg)
|
|
kusano |
7d535a |
00036 #endif
|
|
kusano |
7d535a |
00037
|
|
kusano |
7d535a |
00038 #define ABORT(err_msg) \
|
|
kusano |
7d535a |
00039 { char msg[256];\
|
|
kusano |
7d535a |
00040 sprintf(msg,"%s at line %d in file %s\n",err_msg,__LINE__, __FILE__);\
|
|
kusano |
7d535a |
00041 USER_ABORT(msg); }
|
|
kusano |
7d535a |
00042
|
|
kusano |
7d535a |
00043
|
|
kusano |
7d535a |
00044 #ifndef USER_MALLOC
|
|
kusano |
7d535a |
00045 #if 1
|
|
kusano |
7d535a |
00046 #define USER_MALLOC(size) superlu_malloc(size)
|
|
kusano |
7d535a |
00047 #else
|
|
kusano |
7d535a |
00048
|
|
kusano |
7d535a |
00049 #define USER_MALLOC(size) memset (superlu_malloc(size), '\x0F', size)
|
|
kusano |
7d535a |
00050 #endif
|
|
kusano |
7d535a |
00051 #endif
|
|
kusano |
7d535a |
00052
|
|
kusano |
7d535a |
00053 #define SUPERLU_MALLOC(size) USER_MALLOC(size)
|
|
kusano |
7d535a |
00054
|
|
kusano |
7d535a |
00055 #ifndef USER_FREE
|
|
kusano |
7d535a |
00056 #define USER_FREE(addr) superlu_free(addr)
|
|
kusano |
7d535a |
00057 #endif
|
|
kusano |
7d535a |
00058
|
|
kusano |
7d535a |
00059 #define SUPERLU_FREE(addr) USER_FREE(addr)
|
|
kusano |
7d535a |
00060
|
|
kusano |
7d535a |
00061 #define CHECK_MALLOC(where) { \
|
|
kusano |
7d535a |
00062 extern int superlu_malloc_total; \
|
|
kusano |
7d535a |
00063 printf("%s: malloc_total %d Bytes\n", \
|
|
kusano |
7d535a |
00064 where, superlu_malloc_total); \
|
|
kusano |
7d535a |
00065 }
|
|
kusano |
7d535a |
00066
|
|
kusano |
7d535a |
00067 #define SUPERLU_MAX(x, y) ( (x) > (y) ? (x) : (y) )
|
|
kusano |
7d535a |
00068 #define SUPERLU_MIN(x, y) ( (x) < (y) ? (x) : (y) )
|
|
kusano |
7d535a |
00069
|
|
kusano |
7d535a |
00070
|
|
kusano |
7d535a |
00071
|
|
kusano |
7d535a |
00072
|
|
kusano |
7d535a |
00073 #define L_SUB_START(col) ( Lstore->rowind_colptr[col] )
|
|
kusano |
7d535a |
00074 #define L_SUB(ptr) ( Lstore->rowind[ptr] )
|
|
kusano |
7d535a |
00075 #define L_NZ_START(col) ( Lstore->nzval_colptr[col] )
|
|
kusano |
7d535a |
00076 #define L_FST_SUPC(superno) ( Lstore->sup_to_col[superno] )
|
|
kusano |
7d535a |
00077 #define U_NZ_START(col) ( Ustore->colptr[col] )
|
|
kusano |
7d535a |
00078 #define U_SUB(ptr) ( Ustore->rowind[ptr] )
|
|
kusano |
7d535a |
00079
|
|
kusano |
7d535a |
00080
|
|
kusano |
7d535a |
00081
|
|
kusano |
7d535a |
00082
|
|
kusano |
7d535a |
00083
|
|
kusano |
7d535a |
00084 #define EMPTY (-1)
|
|
kusano |
7d535a |
00085
|
|
kusano |
7d535a |
00086 #define FALSE 0
|
|
kusano |
7d535a |
00087 #define TRUE 1
|
|
kusano |
7d535a |
00088
|
|
kusano |
7d535a |
00089 #define NO_MEMTYPE 4
|
|
kusano |
7d535a |
00090
|
|
kusano |
7d535a |
00091
|
|
kusano |
7d535a |
00092
|
|
kusano |
7d535a |
00093
|
|
kusano |
7d535a |
00094 #define GluIntArray(n) (5 * (n) + 5)
|
|
kusano |
7d535a |
00095
|
|
kusano |
7d535a |
00096
|
|
kusano |
7d535a |
00097 #define NODROP ( 0x0000 )
|
|
kusano |
7d535a |
00098 #define DROP_BASIC ( 0x0001 )
|
|
kusano |
7d535a |
00099 #define DROP_PROWS ( 0x0002 )
|
|
kusano |
7d535a |
00100 #define DROP_COLUMN ( 0x0004 )
|
|
kusano |
7d535a |
00101
|
|
kusano |
7d535a |
00102 #define DROP_AREA ( 0x0008 )
|
|
kusano |
7d535a |
00103
|
|
kusano |
7d535a |
00104
|
|
kusano |
7d535a |
00105 #define DROP_SECONDARY ( 0x000E )
|
|
kusano |
7d535a |
00106 #define DROP_DYNAMIC ( 0x0010 )
|
|
kusano |
7d535a |
00107 #define DROP_INTERP ( 0x0100 )
|
|
kusano |
7d535a |
00108
|
|
kusano |
7d535a |
00109
|
|
kusano |
7d535a |
00110 #if 1
|
|
kusano |
7d535a |
00111 #define MILU_ALPHA (1.0e-2)
|
|
kusano |
7d535a |
00112 #else
|
|
kusano |
7d535a |
00113 #define MILU_ALPHA 1.0
|
|
kusano |
7d535a |
00114 #endif
|
|
kusano |
7d535a |
00115
|
|
kusano |
7d535a |
00116
|
|
kusano |
7d535a |
00117
|
|
kusano |
7d535a |
00118
|
|
kusano |
7d535a |
00119
|
|
kusano |
7d535a |
00120 typedef float flops_t;
|
|
kusano |
7d535a |
00121 typedef unsigned char Logical;
|
|
kusano |
7d535a |
00122
|
|
kusano |
7d535a |
00123
|
|
kusano |
7d535a |
00124
|
|
kusano |
7d535a |
00125
|
|
kusano |
7d535a |
00126
|
|
kusano |
7d535a |
00127
|
|
kusano |
7d535a |
00128
|
|
kusano |
7d535a |
00129
|
|
kusano |
7d535a |
00130
|
|
kusano |
7d535a |
00131
|
|
kusano |
7d535a |
00132
|
|
kusano |
7d535a |
00133
|
|
kusano |
7d535a |
00134
|
|
kusano |
7d535a |
00135
|
|
kusano |
7d535a |
00136
|
|
kusano |
7d535a |
00137
|
|
kusano |
7d535a |
00138
|
|
kusano |
7d535a |
00139
|
|
kusano |
7d535a |
00140
|
|
kusano |
7d535a |
00141
|
|
kusano |
7d535a |
00142
|
|
kusano |
7d535a |
00143
|
|
kusano |
7d535a |
00144
|
|
kusano |
7d535a |
00145
|
|
kusano |
7d535a |
00146
|
|
kusano |
7d535a |
00147
|
|
kusano |
7d535a |
00148
|
|
kusano |
7d535a |
00149
|
|
kusano |
7d535a |
00150
|
|
kusano |
7d535a |
00151
|
|
kusano |
7d535a |
00152
|
|
kusano |
7d535a |
00153
|
|
kusano |
7d535a |
00154
|
|
kusano |
7d535a |
00155
|
|
kusano |
7d535a |
00156
|
|
kusano |
7d535a |
00157
|
|
kusano |
7d535a |
00158
|
|
kusano |
7d535a |
00159
|
|
kusano |
7d535a |
00160
|
|
kusano |
7d535a |
00161
|
|
kusano |
7d535a |
00162
|
|
kusano |
7d535a |
00163
|
|
kusano |
7d535a |
00164
|
|
kusano |
7d535a |
00165
|
|
kusano |
7d535a |
00166
|
|
kusano |
7d535a |
00167
|
|
kusano |
7d535a |
00168
|
|
kusano |
7d535a |
00169
|
|
kusano |
7d535a |
00170
|
|
kusano |
7d535a |
00171
|
|
kusano |
7d535a |
00172
|
|
kusano |
7d535a |
00173
|
|
kusano |
7d535a |
00174
|
|
kusano |
7d535a |
00175
|
|
kusano |
7d535a |
00176
|
|
kusano |
7d535a |
00177
|
|
kusano |
7d535a |
00178
|
|
kusano |
7d535a |
00179
|
|
kusano |
7d535a |
00180
|
|
kusano |
7d535a |
00181
|
|
kusano |
7d535a |
00182
|
|
kusano |
7d535a |
00183
|
|
kusano |
7d535a |
00184
|
|
kusano |
7d535a |
00185
|
|
kusano |
7d535a |
00186
|
|
kusano |
7d535a |
00187
|
|
kusano |
7d535a |
00188
|
|
kusano |
7d535a |
00189
|
|
kusano |
7d535a |
00190
|
|
kusano |
7d535a |
00191
|
|
kusano |
7d535a |
00192
|
|
kusano |
7d535a |
00193
|
|
kusano |
7d535a |
00194
|
|
kusano |
7d535a |
00195
|
|
kusano |
7d535a |
00196
|
|
kusano |
7d535a |
00197
|
|
kusano |
7d535a |
00198
|
|
kusano |
7d535a |
00199
|
|
kusano |
7d535a |
00200
|
|
kusano |
7d535a |
00201
|
|
kusano |
7d535a |
00202
|
|
kusano |
7d535a |
00203
|
|
kusano |
7d535a |
00204
|
|
kusano |
7d535a |
00205
|
|
kusano |
7d535a |
00206
|
|
kusano |
7d535a |
00207
|
|
kusano |
7d535a |
00208
|
|
kusano |
7d535a |
00209
|
|
kusano |
7d535a |
00210
|
|
kusano |
7d535a |
00211
|
|
kusano |
7d535a |
00212
|
|
kusano |
7d535a |
00213
|
|
kusano |
7d535a |
00214
|
|
kusano |
7d535a |
00215
|
|
kusano |
7d535a |
00216
|
|
kusano |
7d535a |
00217
|
|
kusano |
7d535a |
00218
|
|
kusano |
7d535a |
00219
|
|
kusano |
7d535a |
00220
|
|
kusano |
7d535a |
00221
|
|
kusano |
7d535a |
00222
|
|
kusano |
7d535a |
00223
|
|
kusano |
7d535a |
00224
|
|
kusano |
7d535a |
00225
|
|
kusano |
7d535a |
00226
|
|
kusano |
7d535a |
00227
|
|
kusano |
7d535a |
00228
|
|
kusano |
7d535a |
00229
|
|
kusano |
7d535a |
00230
|
|
kusano |
7d535a |
00231
|
|
kusano |
7d535a |
00232
|
|
kusano |
7d535a |
00233
|
|
kusano |
7d535a |
00234
|
|
kusano |
7d535a |
00235
|
|
kusano |
7d535a |
00236
|
|
kusano |
7d535a |
00237
|
|
kusano |
7d535a |
00238
|
|
kusano |
7d535a |
00239
|
|
kusano |
7d535a |
00240
|
|
kusano |
7d535a |
00241
|
|
kusano |
7d535a |
00242
|
|
kusano |
7d535a |
00243
|
|
kusano |
7d535a |
00244
|
|
kusano |
7d535a |
00245
|
|
kusano |
7d535a |
00246
|
|
kusano |
7d535a |
00247
|
|
kusano |
7d535a |
00248
|
|
kusano |
7d535a |
00249
|
|
kusano |
7d535a |
00250
|
|
kusano |
7d535a |
00251
|
|
kusano |
7d535a |
00252 typedef struct {
|
|
kusano |
7d535a |
00253 fact_t Fact;
|
|
kusano |
7d535a |
00254 yes_no_t Equil;
|
|
kusano |
7d535a |
00255 colperm_t ColPerm;
|
|
kusano |
7d535a |
00256 trans_t Trans;
|
|
kusano |
7d535a |
00257 IterRefine_t IterRefine;
|
|
kusano |
7d535a |
00258 double DiagPivotThresh;
|
|
kusano |
7d535a |
00259 yes_no_t SymmetricMode;
|
|
kusano |
7d535a |
00260 yes_no_t PivotGrowth;
|
|
kusano |
7d535a |
00261 yes_no_t ConditionNumber;
|
|
kusano |
7d535a |
00262 rowperm_t RowPerm;
|
|
kusano |
7d535a |
00263 int ILU_DropRule;
|
|
kusano |
7d535a |
00264 double ILU_DropTol;
|
|
kusano |
7d535a |
00265 double ILU_FillFactor;
|
|
kusano |
7d535a |
00266 norm_t ILU_Norm;
|
|
kusano |
7d535a |
00267 double ILU_FillTol;
|
|
kusano |
7d535a |
00268 milu_t ILU_MILU;
|
|
kusano |
7d535a |
00269 double ILU_MILU_Dim;
|
|
kusano |
7d535a |
00270 yes_no_t ParSymbFact;
|
|
kusano |
7d535a |
00271 yes_no_t ReplaceTinyPivot;
|
|
kusano |
7d535a |
00272 yes_no_t SolveInitialized;
|
|
kusano |
7d535a |
00273 yes_no_t RefineInitialized;
|
|
kusano |
7d535a |
00274 yes_no_t PrintStat;
|
|
kusano |
7d535a |
00275 } superlu_options_t;
|
|
kusano |
7d535a |
00276
|
|
kusano |
7d535a |
00278 typedef struct e_node {
|
|
kusano |
7d535a |
00279 int size;
|
|
kusano |
7d535a |
00280 void *mem;
|
|
kusano |
7d535a |
00281 } ExpHeader;
|
|
kusano |
7d535a |
00282
|
|
kusano |
7d535a |
00283 typedef struct {
|
|
kusano |
7d535a |
00284 int size;
|
|
kusano |
7d535a |
00285 int used;
|
|
kusano |
7d535a |
00286 int top1;
|
|
kusano |
7d535a |
00287 int top2;
|
|
kusano |
7d535a |
00288 void *array;
|
|
kusano |
7d535a |
00289 } LU_stack_t;
|
|
kusano |
7d535a |
00290
|
|
kusano |
7d535a |
00291 typedef struct {
|
|
kusano |
7d535a |
00292 int *panel_histo;
|
|
kusano |
7d535a |
00293 double *utime;
|
|
kusano |
7d535a |
00294 flops_t *ops;
|
|
kusano |
7d535a |
00295 int TinyPivots;
|
|
kusano |
7d535a |
00296 int RefineSteps;
|
|
kusano |
7d535a |
00297 int expansions;
|
|
kusano |
7d535a |
00298 } SuperLUStat_t;
|
|
kusano |
7d535a |
00299
|
|
kusano |
7d535a |
00300 typedef struct {
|
|
kusano |
7d535a |
00301 float for_lu;
|
|
kusano |
7d535a |
00302 float total_needed;
|
|
kusano |
7d535a |
00303 } mem_usage_t;
|
|
kusano |
7d535a |
00304
|
|
kusano |
7d535a |
00305
|
|
kusano |
7d535a |
00306
|
|
kusano |
7d535a |
00307
|
|
kusano |
7d535a |
00308
|
|
kusano |
7d535a |
00309 #ifdef __cplusplus
|
|
kusano |
7d535a |
00310 extern "C" {
|
|
kusano |
7d535a |
00311 #endif
|
|
kusano |
7d535a |
00312
|
|
kusano |
7d535a |
00313 extern void Destroy_SuperMatrix_Store(SuperMatrix *);
|
|
kusano |
7d535a |
00314 extern void Destroy_CompCol_Matrix(SuperMatrix *);
|
|
kusano |
7d535a |
00315 extern void Destroy_CompRow_Matrix(SuperMatrix *);
|
|
kusano |
7d535a |
00316 extern void Destroy_SuperNode_Matrix(SuperMatrix *);
|
|
kusano |
7d535a |
00317 extern void Destroy_CompCol_Permuted(SuperMatrix *);
|
|
kusano |
7d535a |
00318 extern void Destroy_Dense_Matrix(SuperMatrix *);
|
|
kusano |
7d535a |
00319 extern void get_perm_c(int, SuperMatrix *, int *);
|
|
kusano |
7d535a |
00320 extern void set_default_options(superlu_options_t *options);
|
|
kusano |
7d535a |
00321 extern void ilu_set_default_options(superlu_options_t *options);
|
|
kusano |
7d535a |
00322 extern void sp_preorder (superlu_options_t *, SuperMatrix*, int*, int*,
|
|
kusano |
7d535a |
00323 SuperMatrix*);
|
|
kusano |
7d535a |
00324 extern void superlu_abort_and_exit(char*);
|
|
kusano |
7d535a |
00325 extern void *superlu_malloc (size_t);
|
|
kusano |
7d535a |
00326 extern int *intMalloc (int);
|
|
kusano |
7d535a |
00327 extern int *intCalloc (int);
|
|
kusano |
7d535a |
00328 extern void superlu_free (void*);
|
|
kusano |
7d535a |
00329 extern void SetIWork (int, int, int, int *, int **, int **, int **,
|
|
kusano |
7d535a |
00330 int **, int **, int **, int **);
|
|
kusano |
7d535a |
00331 extern int sp_coletree (int *, int *, int *, int, int, int *);
|
|
kusano |
7d535a |
00332 extern void relax_snode (const int, int *, const int, int *, int *);
|
|
kusano |
7d535a |
00333 extern void heap_relax_snode (const int, int *, const int, int *, int *);
|
|
kusano |
7d535a |
00334 extern int mark_relax(int, int *, int *, int *, int *, int *, int *);
|
|
kusano |
7d535a |
00335 extern void ilu_relax_snode (const int, int *, const int, int *,
|
|
kusano |
7d535a |
00336 int *, int *);
|
|
kusano |
7d535a |
00337 extern void ilu_heap_relax_snode (const int, int *, const int, int *,
|
|
kusano |
7d535a |
00338 int *, int*);
|
|
kusano |
7d535a |
00339 extern void resetrep_col (const int, const int *, int *);
|
|
kusano |
7d535a |
00340 extern int spcoletree (int *, int *, int *, int, int, int *);
|
|
kusano |
7d535a |
00341 extern int *TreePostorder (int, int *);
|
|
kusano |
7d535a |
00342 extern double SuperLU_timer_ ();
|
|
kusano |
7d535a |
00343 extern int sp_ienv (int);
|
|
kusano |
7d535a |
00344 extern int lsame_ (char *, char *);
|
|
kusano |
7d535a |
00345 extern int xerbla_ (char *, int *);
|
|
kusano |
7d535a |
00346 extern void ifill (int *, int, int);
|
|
kusano |
7d535a |
00347 extern void snode_profile (int, int *);
|
|
kusano |
7d535a |
00348 extern void super_stats (int, int *);
|
|
kusano |
7d535a |
00349 extern void check_repfnz(int, int, int, int *);
|
|
kusano |
7d535a |
00350 extern void PrintSumm (char *, int, int, int);
|
|
kusano |
7d535a |
00351 extern void StatInit(SuperLUStat_t *);
|
|
kusano |
7d535a |
00352 extern void StatPrint (SuperLUStat_t *);
|
|
kusano |
7d535a |
00353 extern void StatFree(SuperLUStat_t *);
|
|
kusano |
7d535a |
00354 extern void print_panel_seg(int, int, int, int, int *, int *);
|
|
kusano |
7d535a |
00355 extern int print_int_vec(char *,int, int *);
|
|
kusano |
7d535a |
00356 extern int slu_PrintInt10(char *, int, int *);
|
|
kusano |
7d535a |
00357
|
|
kusano |
7d535a |
00358 #ifdef __cplusplus
|
|
kusano |
7d535a |
00359 }
|
|
kusano |
7d535a |
00360 #endif
|
|
kusano |
7d535a |
00361
|
|
kusano |
7d535a |
00362 #endif
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
<address style="text-align: right;"><small>Generated on Mon Nov 22 10:23:47 2010 for SuperLU by </small></address>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
1.5.5
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|