00001 #if !defined(__DSDP_KERNAL_H)
00002 #define __DSDP_KERNAL_H
00003
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010 #include <math.h>
00011 #include <string.h>
00012 #include <float.h>
00013
00014
00015 #ifdef __FUNCT__
00016 #undef __FUNCT__
00017 #endif
00018 #define __FUNCT__ "DSDPUnknownFunction"
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 extern void DSDPError(const char*, int, const char*);
00031
00032 #ifndef DSDPCHKERR
00033 #define DSDPCHKERR(a) { if (a){ DSDPError(__FUNCT__,__LINE__,__FILE__); return a; } }
00034 #endif
00035
00036 #ifdef DSDPFunctionReturn
00037 #undef DSDPFunctionReturn
00038 #endif
00039 #define DSDPFunctionReturn return
00040
00041 #ifdef DSDPFunctionBegin
00042 #undef DSDPFunctionBegin
00043 #endif
00044 #define DSDPFunctionBegin { }
00045
00046 #ifdef DSDPMATLAB
00047 #include "mex.h"
00048 #define DSDPPrintf mexPrintf
00049 #define DSDPErrorPrintf mexPrintf
00050 #endif
00051
00052 #include "dsdpmem.h"
00053
00054 #ifndef DSDPPrintf
00055 #define DSDPPrintf printf
00056 #endif
00057
00058 #ifndef DSDPErrorPrintf
00059 #define DSDPErrorPrintf printf
00060 #endif
00061
00062 extern void DSDPLogFInfo(void *vobj, int outlevel, const char message[], ...);
00063 #define DSDPLogInfo DSDPLogFInfo
00064
00065
00066
00067 extern int DSDPFError(void *vobj, const char *func, int linen,const char *filef, const char message[], ...);
00068
00069 #define DSDPSETERR(a,b) {DSDPFError(0,__FUNCT__,__LINE__,__FILE__,b); return (a); }
00070 #define DSDPSETERR1(a,b,c) {DSDPFError(0,__FUNCT__,__LINE__,__FILE__,b,c); return (a); }
00071 #define DSDPSETERR2(a,b,c,d) {DSDPFError(0,__FUNCT__,__LINE__,__FILE__,b,c,d); return (a); }
00072 #define DSDPSETERR3(a,b,c,d,e) {DSDPFError(0,__FUNCT__,__LINE__,__FILE__,b,c,d,e); return (a); }
00073
00074
00075
00076
00077 #define DSDPMin(a,b) ((a <= b)? (a) : (b))
00078 #define DSDPMax(a,b) ((a >= b)? (a) : (b))
00079
00080 extern void DSDPTime(double*);
00081
00082 extern void DSDPMemoryLog(void);
00083 extern int DSDPEventLogBegin(int);
00084 extern int DSDPEventLogEnd(int);
00085 extern int DSDPEventLogRegister(const char*, int*);
00086 extern int DSDPEventLogInitialize(void);
00087 extern int DSDPEventLogSummary(void);
00088 extern int DSDPEventLogInitialize(void);
00089 #endif