-
Notifications
You must be signed in to change notification settings - Fork 4
/
def.h
44 lines (36 loc) · 1.44 KB
/
def.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef __DEF_H
#define __DEF_H
#include <cstdint>
// -----------------------------------------------------------------------------
// Macros
// -----------------------------------------------------------------------------
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define SQR(x) ((x) * (x))
#define SUM(x, y) ((x) + (y))
#define DIFF(x, y) ((y) - (x))
#define SWAP(x, y) {int tmp=x; x=y; y=tmp;}
// -----------------------------------------------------------------------------
// Constants
// -----------------------------------------------------------------------------
const float MAXREAL = 3.402823466e+38F;
const float MINREAL = -MAXREAL;
const int MAXINT = 2147483647;
const int MININT = -MAXINT;
const int SIZEBOOL = (int) sizeof(bool);
const int SIZEINT = (int) sizeof(int);
const int SIZECHAR = (int) sizeof(char);
const int SIZEFLOAT = (int) sizeof(float);
const int SIZEDOUBLE = (int) sizeof(double);
const float E = 2.7182818F;
const float PI = 3.141592654F;
const float FLOATZERO = 1e-6F;
const float ANGLE = PI / 8.0f;
const int MAXK = 100;
const int SCAN_SIZE = 512;
const int CANDIDATES = 10000;
const int MAX_BLOCK_NUM = 5000;
typedef float Scalar;
typedef int32_t SigType;
const long unsigned GLOBAL_SEED = 666;
#endif // __DEF_H