00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_BASE_HH
00020 #define OST_BASE_HH
00021
00022 #include <string>
00023 #include <cmath>
00024 #include <math.h>
00025 #include <complex>
00026 #include <ost/config.hh>
00027 #include <ost/dllexport.hh>
00028
00029 #ifndef uint
00030 typedef unsigned int uint;
00031 #endif
00032
00033 #ifndef uchar
00034 typedef unsigned char uchar;
00035 #endif
00036
00037 #ifndef ushort
00038 typedef unsigned short int ushort;
00039 #endif
00040
00041
00042 #if OST_DOUBLE_PRECISION
00043 typedef double Real;
00044 #else
00045 typedef float Real;
00046 #endif
00047
00048 #ifdef Complex
00049
00050 #undef Complex
00051 #endif
00052 typedef std::complex<Real> Complex;
00053 typedef unsigned short Word;
00054
00055
00056
00057 #ifndef round_function
00058 #define round_function
00059 #ifndef round
00060 inline Real round( Real d )
00061 {
00062 return floor(d+Real(0.5));
00063 }
00064 #endif
00065 #endif
00066
00067 #ifndef rint_function
00068 #define rint_function
00069 #ifndef rint
00070 inline Real rint(Real d)
00071 {
00072 return floor(d+Real(0.5));
00073 }
00074 #endif
00075 #endif
00076
00077 #if _MSC_VER
00078 #pragma warning(disable:4251)
00079 #pragma warning(disable:4275)
00080 #pragma warning(disable:4244)
00081 #pragma warning(disable:4231)
00082 #pragma warning(disable:4305)
00083 #pragma warning(disable:4351) // turn off "new behavior ... will be default initialized" warning
00084
00085 #ifndef log2_function
00086 #define log2_function
00087 #ifndef log2
00088
00089
00090 inline double log2( double n )
00091 {
00092
00093 return log( double(n) ) / log( 2.0 );
00094 }
00095 #endif
00096 #endif
00097
00098 # ifdef FindAtom
00099 # undef FindAtom
00100 # endif
00101 # ifdef AddAtom
00102 # undef AddAtom
00103 # endif
00104
00105 #endif
00106
00107
00108 typedef std::string String;
00109
00110
00111 #endif