00001
00030 #ifndef _DEFINES_H
00031 #define _DEFINES_H
00032
00034 #define NOMINMAX
00035
00036
00037 #if (defined(_WIN32) && !defined(_WINDOWS))
00038 # define _WINDOWS
00039 #endif
00040
00041
00042 #ifdef __linux__
00043 # define _LINUX
00044 #endif
00045
00047 #define DUMP_LEAKS()
00048
00056 # define rand_double() ((double) rand() / (RAND_MAX + 0.00001))
00057
00058 #ifdef _LINUX
00059 # define INIT_EXPORT __attribute__ ((constructor))
00060 # define FINI_EXPORT __attribute__ ((destructor))
00061 #else
00062
00063 # define INIT_EXPORT
00064
00065 # define FINI_EXPORT
00066 #endif
00067
00068 #ifdef _WINDOWS
00069 # ifdef _DEBUG
00070 # undef DUMP_LEAKS
00071 # define DUMP_LEAKS() _CrtDumpMemoryLeaks()
00072 # define _CRTDBG_MAP_ALLOC
00073 # include <malloc.h>
00074 # include <stdlib.h>
00075 # ifndef _WIN32_WCE
00076 # include <crtdbg.h>
00077 # endif
00078 # endif // _DEBUG
00079
00080 # define bit_vector vector<bool>
00081 # define tzset _tzset
00082 # define vsnprintf _vsnprintf
00083
00084 # define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
00085 # include <windows.h>
00086 # include <winbase.h>
00087 #endif // _WINDOWS
00088
00089 #ifdef _WIN32_WCE
00090 # include <windows.h>
00091 # include <winbase.h>
00092 # define strdup _strdup
00093 # define ltoa _ltoa
00094 # define itoa _itoa
00095 # define ftoa _ftoa
00096
00097
00098 # define try
00099 # define throw wce_assert<TCHAR>(false, TEXT(__FILE__), __LINE__, L"Exception thrown");
00100 # define catch(x) if (false)
00101 # define finally
00102 #endif // _WIN32_WCE
00103
00104 #ifdef _SYMBIAN
00105 # include <e32base.h>
00106 # include <e32cons.h>
00107 # include <e32std.h>
00108 # include <e32math.h>
00109
00110 # define try
00111 # define throw User::Exit(1);
00112 # define catch(x) if (false)
00113 # define finally
00114
00115
00116 #endif
00117
00124 #define _DEBUG_CLASSIFIERS 1
00125 #define _DEBUG_FEATURES 1
00126 #define _DEBUG_PREDICTORS 1
00127
00128
00135 #define NO_OPTIMIZATIONS 0
00136
00137 #define OPTIMIZATIONS_SPLAYTREE 0
00138 #define OPTIMIZATIONS_CACHE_SIMILARITY 1
00139 #define OPTIMIZATIONS_SPLIT_MERGE 0
00140
00141
00142 #include "debug.h"
00143
00144
00145 #include <algorithm>
00146 #include <list>
00147 #include <map>
00148 #include <string>
00149 #include <vector>
00150 #include <backward/bvector.h>
00151
00152
00153 #ifndef _SYMBIAN
00154 # include <math.h>
00155 # include <limits>
00156
00157 using namespace std;
00158 #endif
00159
00165 typedef vector<string> stringvector;
00166
00168 typedef map<string, string> parametermap;
00169
00171
00172 #endif // _DEFINES_H