-
Notifications
You must be signed in to change notification settings - Fork 10
/
mobius.h
116 lines (90 loc) · 2.21 KB
/
mobius.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//NOTE: This is designed to be built as a unity build, i.e. in only a single compilation unit.
#if !defined(MOBIUS_H)
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#include <oleauto.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <functional>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <iostream>
#include <string.h>
#include <assert.h>
#include <float.h>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <codecvt>
#include <random>
#include <cctype>
//NOTE: we use the intrin header for __rdtsc(); The intrinsic is in different headers for different compilers. If you compile with a different compiler than what is already set up you have to add in some lines below.
// NOTE: Commented this out because it was causing a problem somwhere, but it makes MOBIUS_PRINT_TIMING_INFO not work.
/*
#if defined(__GNUC__) || defined(__GNUG__)
#include <x86intrin.h>
#elif defined(_MSC_VER)
#include <intrin.h>
#endif
*/
typedef uint64_t u64;
typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;
typedef int64_t s64;
typedef int32_t s32;
typedef int16_t s16;
typedef int8_t s8;
//NOTE: We allow the error handling to be replaced by the application. This is for instance useful for the python wrapper.
#if !defined(MOBIUS_ERROR_OVERRIDE)
void
ErrorPrint() {}
template<typename t, typename... v>
void
ErrorPrint(t Value, v... Tail)
{
std::cerr << Value;
ErrorPrint(Tail...);
}
template<typename... v>
void
FatalError(v... Tail)
{
ErrorPrint(Tail...);
exit(1);
}
void
WarningPrint() {}
template<typename t, typename... v>
void
WarningPrint(t Value, v... Tail)
{
std::cout << Value;
WarningPrint(Tail...);
}
#endif
#include "Src/mobius_math.h"
#include "Src/mobius_util.h"
#include "Src/bucket_allocator.h"
#include "Src/token_string.h"
#include "Src/datetime.h"
#include "Src/mobius_model.h"
#include "Src/mobius_data_set.h"
#include "Src/jacobian.h"
#include "Src/mobius_model_run.h"
#include "Src/debug_printing.h"
#include "Src/peek_queue.h"
#include "Src/file.h"
#include "Src/lexer.h"
#include "Src/mobius_io.h"
#include "Src/spreadsheet_io.h"
#include "Src/mobius_solvers.h"
#define MOBIUS_H
#endif