00001
00005
00006
00007 #ifndef __SUPERLU_UTIL
00008 #define __SUPERLU_UTIL
00009
00010 #include <stdio.h>
00011 #include <stdlib.h>
00012 #include <string.h>
00013 #include <malloc.h>
00014 #include <assert.h>
00015
00016
00017 #ifndef USER_ABORT
00018 #define USER_ABORT(msg) superlu_abort_and_exit(msg)
00019 #endif
00020
00021 #define ABORT(err_msg) \
00022 { char msg[256];\
00023 sprintf(msg,"%s at line %d in file %s\n",err_msg,__LINE__, __FILE__);\
00024 USER_ABORT(msg); }
00025
00026
00027 #ifndef USER_MALLOC
00028 #define USER_MALLOC(size) superlu_malloc(size)
00029 #endif
00030
00031 #define SUPERLU_MALLOC(size) USER_MALLOC(size)
00032
00033 #ifndef USER_FREE
00034 #define USER_FREE(addr) superlu_free(addr)
00035 #endif
00036
00037 #define SUPERLU_FREE(addr) USER_FREE(addr)
00038
00039 #ifdef HAVE_TBCICONFIG_H
00040 # include "tbciconfig.h"
00041 #else
00042 # include "config_manual.h"
00043 #endif
00044
00045 #if defined (_SYSTYPE_SVR4) || defined(HAVE_MINMAX_IN_SYS_PARAM_H)
00046 # include <sys/param.h>
00047 #endif
00048
00049 #ifndef MAX
00050 # define MAX(x, y) ( (x) > (y) ? (x) : (y) )
00051 #endif
00052 #ifndef MIN
00053 # define MIN(x, y) ( (x) < (y) ? (x) : (y) )
00054 #endif
00055
00056
00057
00058
00059 #define EMPTY (-1)
00060 #define NO (-1)
00061 #define FALSE 0
00062 #define TRUE 1
00063
00064
00065
00066
00067 typedef float flops_t;
00068 typedef unsigned char Logical;
00069
00070
00071
00072
00073
00074
00075
00076 typedef enum {
00077 COLPERM,
00078 RELAX,
00079 ETREE,
00080 EQUIL,
00081 FACT,
00082 RCOND,
00083 SOLVE,
00084 REFINE,
00085 FLOAT,
00086 TRSV,
00087 GEMV,
00088 FERR,
00089 NPHASES
00090 } PhaseType;
00091
00092 typedef struct {
00093 int *panel_histo;
00094 double *utime;
00095 flops_t *ops;
00096 } SuperLUStat_t;
00097
00098
00099 #define FIRSTCOL_OF_SNODE(i) (xsup[i])
00100
00101
00102 #ifdef __cplusplus
00103 extern "C" {
00104 #endif
00105
00106 extern void PrintStat (SuperLUStat_t *);
00107
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111
00112 #endif