C++ main module for gpm Package  1.0
types.h
Go to the documentation of this file.
1 #ifndef TYPES_H
2 #define TYPES_H
3 #include <algorithm>
4 #include <string>
5 #include <complex>
6 #include <assert.h>
7 #include <stdlib.h>
8 
9 
10 
11 using namespace std;
12 
13 #define null NULL
14 #define tFlag unsigned char
15 #define tShort short
16 
17 #ifndef tReal
18 #define tReal long double
19 #endif
20 
21 #define tRealFormat "%Lg"
22 
23 //#define tReal double
24 //#define tRealFormat "%lg"
25 
26 #if defined(WIN32) || defined(WIN64)
27 #define tLong long long int
28 #else
29 #define tLong long int
30 #endif
31 
32 #define tInteger unsigned tLong
33 #define tRelativeInteger tLong
34 #define tInt int
35 #define tBoolean bool
36 #define tString string
37 #define tComplex complex<tReal>
38 #define tDoubleComplex complex<double>
39 #define tFloatComplex complex<float>
40 #define tCharacter char
41 #define tTime unsigned long long
42 #define EPS 1.e-12
43 #define EPS2 1.e-24
44 #define modZ(a,b) ( ( (a)>=0) ? (a)%(b) : (a)%(b)+(b) )
45 #define square(a) ( (a)*(a) )
46 #define iand(a,b) ( (a) & (b) )
47 
48 //#define max(a,b) (((a) > (b)) ? (a) : (b))
49 //#define min(a,b) (((a) < (b)) ? (a) : (b))
50 //#define modulo(a,b) ((a)-(b)*((tInteger)((a)/(b))))
51 #if defined(WIN32) || defined(WIN64)
52 #undef M_PI
53 #define M_PI 3.14159265358979323846
54 #endif
55 
56 #ifndef REAL_INFINITY
57 #define REAL_INFINITY 3.40282347e+38
58 // float Maximum number = 3.40282347e+38
59 // double Maximum number = 1.7976931348623157e+308
60 // long double Maximum number = 1.18973149535723176508575932662800702e+4932
61 
62 #endif
63 #ifndef REAL_EPS
64 #define REAL_EPS 9.62964972193617926527988971292463845e-35
65 // min value of x such as 1+x!=1
66 // float minimum number 5.96046519e-08
67 // double 1.1102230246251568e-16
68 // long double 9.62964972193617926527988971292463845e-35
69 #endif
70 
71 #ifdef PRINT
72 #define PRINT_(a) {cout<<a;}
73 #define PRINTLN_(a) {cout<<a<<"\n";}
74 #else
75 #define PRINT_(a) {}
76 #define PRINTLN_(a) {}
77 #endif
78 
79 #ifdef NDEBUG
80 #define ASSERT_IN(a) {}
81 #else
82 #define ASSERT_IN(a) {assert(a);}
83 #endif
84 
85 #ifdef NDEBUG
86 #define ASSERT_OUT(a) {}
87 #else
88 #define ASSERT_OUT(a) {assert(a);}
89 #endif
90 
91 
92 
93 #endif