00001
00002
00003
00006
00007 #ifndef INCLUDE_LIB
00008 #define INCLUDE_LIB
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #define UseExceptions // use C++ exceptions
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #define USING_DOUBLE // elements of type double
00032
00033
00034 #define bool_LIB 0 // for compatibility with my older libraries
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #define TypeDefException
00049
00050
00051
00052
00053
00054 #if defined __GNUG__ && __GNUG__ >= 3
00055 #define _STANDARD_ // use standard library
00056 #define ios_format_flags ios::fmtflags
00057 #endif
00058
00059
00060 #if defined __ICC
00061 #define _STANDARD_ // use standard library
00062 #define ios_format_flags ios::fmtflags
00063 #endif
00064
00065
00066 #if defined _MSC_VER && _MSC_VER >= 1300
00067 #define _STANDARD_ // use standard library
00068 #endif
00069
00070
00071 #ifdef _STANDARD_ // using standard library
00072 #include <cstdlib>
00073 #if defined _MSC_VER && _MSC_VER == 1200
00074 #include <limits>
00075 #endif
00076 #ifdef WANT_STREAM
00077 #include <iostream>
00078 #include <iomanip>
00079 #endif
00080 #ifdef WANT_MATH
00081 #include <cmath>
00082 #endif
00083 #ifdef WANT_STRING
00084 #include <cstring>
00085 #endif
00086 #ifdef WANT_TIME
00087 #include <ctime>
00088 #endif
00089 #ifdef WANT_FSTREAM
00090 #include <fstream>
00091 #endif
00092 using namespace std;
00093 #else
00094
00095 #define DEFAULT_HEADER // use AT&T style header
00096
00097
00098 #ifdef _MSC_VER // Microsoft
00099 #include <stdlib.h>
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 #ifdef WANT_STREAM
00110 #include <iostream.h>
00111 #include <iomanip.h>
00112 #endif
00113 #ifdef WANT_MATH
00114 #include <math.h>
00115 #include <float.h>
00116 #endif
00117 #ifdef WANT_STRING
00118 #include <string.h>
00119 #endif
00120 #ifdef WANT_TIME
00121 #include <time.h>
00122 #endif
00123 #ifdef WANT_FSTREAM
00124 #include <fstream.h>
00125 #endif
00126 #undef DEFAULT_HEADER
00127 #endif
00128
00129 #ifdef __ZTC__ // Zortech
00130 #include <stdlib.h>
00131 #ifdef WANT_STREAM
00132 #include <iostream.hpp>
00133 #include <iomanip.hpp>
00134 #define flush "" // not defined in iomanip?
00135 #endif
00136 #ifdef WANT_MATH
00137 #include <math.h>
00138 #include <float.h>
00139 #endif
00140 #ifdef WANT_STRING
00141 #include <string.h>
00142 #endif
00143 #ifdef WANT_TIME
00144 #include <time.h>
00145 #endif
00146 #ifdef WANT_FSTREAM
00147 #include <fstream.h>
00148 #endif
00149 #undef DEFAULT_HEADER
00150 #endif
00151
00152 #if defined __BCPLUSPLUS__ || defined __TURBOC__ // Borland or Turbo
00153 #include <stdlib.h>
00154 #ifdef WANT_STREAM
00155 #include <iostream.h>
00156 #include <iomanip.h>
00157 #endif
00158 #ifdef WANT_MATH
00159 #include <math.h>
00160 #include <float.h>
00161
00162
00163 #endif
00164 #ifdef WANT_STRING
00165 #include <string.h>
00166 #endif
00167 #ifdef WANT_TIME
00168 #include <time.h>
00169 #endif
00170 #ifdef WANT_FSTREAM
00171 #include <fstream.h>
00172 #endif
00173 #undef DEFAULT_HEADER
00174 #endif
00175
00176 #ifdef __GNUG__ // Gnu C++
00177 #include <stdlib.h>
00178 #ifdef WANT_STREAM
00179 #include <iostream.h>
00180 #include <iomanip.h>
00181 #endif
00182 #ifdef WANT_MATH
00183 #include <math.h>
00184 #include <float.h>
00185 #endif
00186 #ifdef WANT_STRING
00187 #include <string.h>
00188 #endif
00189 #ifdef WANT_TIME
00190 #include <time.h>
00191 #endif
00192 #ifdef WANT_FSTREAM
00193 #include <fstream.h>
00194 #endif
00195 #undef DEFAULT_HEADER
00196 #endif
00197
00198 #ifdef __WATCOMC__ // Watcom C/C++
00199 #include <stdlib.h>
00200 #ifdef WANT_STREAM
00201 #include <iostream.h>
00202 #include <iomanip.h>
00203 #endif
00204 #ifdef WANT_MATH
00205 #include <math.h>
00206 #include <float.h>
00207 #endif
00208 #ifdef WANT_STRING
00209 #include <string.h>
00210 #endif
00211 #ifdef WANT_TIME
00212 #include <time.h>
00213 #endif
00214 #ifdef WANT_FSTREAM
00215 #include <fstream.h>
00216 #endif
00217 #undef DEFAULT_HEADER
00218 #endif
00219
00220
00221 #ifdef macintosh // MPW C++ on the Mac
00222 #include <stdlib.h>
00223 #ifdef WANT_STREAM
00224 #include <iostream.h>
00225 #include <iomanip.h>
00226 #endif
00227 #ifdef WANT_MATH
00228 #include <float.h>
00229 #include <math.h>
00230 #endif
00231 #ifdef WANT_STRING
00232 #include <string.h>
00233 #endif
00234 #ifdef WANT_TIME
00235 #include <time.h>
00236 #endif
00237 #ifdef WANT_FSTREAM
00238 #include <fstream.h>
00239 #endif
00240 #undef DEFAULT_HEADER
00241 #endif
00242
00243 #ifdef use_float_h // use float.h for precision values
00244 #include <stdlib.h>
00245 #ifdef WANT_STREAM
00246 #include <iostream.h>
00247 #include <iomanip.h>
00248 #endif
00249 #ifdef WANT_MATH
00250 #include <float.h>
00251 #include <math.h>
00252 #endif
00253 #ifdef WANT_STRING
00254 #include <string.h>
00255 #endif
00256 #ifdef WANT_TIME
00257 #include <time.h>
00258 #endif
00259 #ifdef WANT_FSTREAM
00260 #include <fstream.h>
00261 #endif
00262 #undef DEFAULT_HEADER
00263 #endif
00264
00265
00266 #ifdef DEFAULT_HEADER // for example AT&T
00267 #define ATandT
00268 #include <stdlib.h>
00269 #ifdef WANT_STREAM
00270 #include <iostream.h>
00271 #include <iomanip.h>
00272 #endif
00273 #ifdef WANT_MATH
00274 #include <math.h>
00275 #define SystemV // use System V
00276 #include <values.h>
00277 #endif
00278 #ifdef WANT_STRING
00279 #include <string.h>
00280 #endif
00281 #ifdef WANT_TIME
00282 #include <time.h>
00283 #endif
00284 #ifdef WANT_FSTREAM
00285 #include <fstream.h>
00286 #endif
00287 #endif // DEFAULT_HEADER
00288
00289 #endif // _STANDARD_
00290
00291 #ifdef use_namespace
00292 namespace RBD_COMMON {
00293 #endif
00294
00295
00296 #ifdef USING_FLOAT // set precision type to float
00297 typedef float Real;
00298 typedef double long_Real;
00299 #endif
00300
00301 #ifdef USING_DOUBLE // set precision type to double
00302 typedef double Real;
00303 typedef long double long_Real;
00304 #endif
00305
00306
00307
00308
00309 #ifndef bool_LIB
00310 #define bool_LIB 0
00311
00312 class bool
00313 {
00314 int value;
00315 public:
00316 bool(const int b) { value = b ? 1 : 0; }
00317 bool(const void* b) { value = b ? 1 : 0; }
00318 bool() {}
00319 operator int() const { return value; }
00320 int operator!() const { return !value; }
00321 };
00322
00323
00324 const bool true = 1;
00325 const bool false = 0;
00326
00327 #endif
00328
00329
00330 #ifdef use_namespace
00331 }
00332 #endif
00333
00334
00335 #ifdef use_namespace
00336 namespace RBD_COMMON {}
00337 namespace RBD_LIBRARIES
00338 {
00339 using namespace RBD_COMMON;
00340 }
00341 #endif
00342
00343
00344 #endif
00345
00346
00348