-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.h
58 lines (42 loc) · 820 Bytes
/
util.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Author: Chris Wailes <[email protected]>
* Project: Parallel Linear Program Solver
* Date: 2011/10/26
* Description: Header file for utility functions.
*/
#ifndef UTIL_H
#define UTIL_H
#define ABS(a) (a < 0 ? -a : a)
#define MAX(a,b) (a < b ? b : a)
#define MIN(a,b) (a < b ? a : b)
#define EPSILON 1e-10
#define FPN_IS_ZERO(n) (-EPSILON < n && n < EPSILON)
#include <sys/types.h>
typedef enum {
FALSE = 0,
TRUE = 1
} bool;
typedef enum {
GS
} method_t;
typedef enum {
NONE = 0,
AUTO,
OMP,
PTHREADS
} pmode_t;
typedef struct {
char* filename;
method_t method;
pmode_t pmode;
bool blands;
bool profys;
uint simplex_limit;
bool init_done;
uint ncpus;
bool verbose;
bool vv;
char* mathprog_filename;
} config_t;
void get_config(int argc, char** argv);
#endif