forked from feelpp/verdandi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VerdandiHeader.hxx
213 lines (173 loc) · 6.12 KB
/
VerdandiHeader.hxx
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
// Copyright (C) 2008-2009 INRIA
// Author(s): Vivien Mallet, Claire Mouton
//
// This file is part of the data assimilation library Verdandi.
//
// Verdandi is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; either version 2.1 of the License, or (at your option)
// any later version.
//
// Verdandi is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
// more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Verdandi. If not, see http://www.gnu.org/licenses/.
//
// For more information, visit the Verdandi web site:
// http://verdandi.gforge.inria.fr/
#ifndef VERDANDI_FILE_VERDANDIHEADER_HXX
//! The namespace of the data assimilation library Verdandi.
namespace Verdandi
{
} // namespace Verdandi.
#include <iostream>
#include <fstream>
#include <map>
#include <list>
#include <cmath>
#include <utility>
//////////////////
// DEBUG LEVELS //
//////////////////
#ifdef VERDANDI_DEBUG_LEVEL_4
#ifndef VERDANDI_DEBUG_LEVEL_3
#define VERDANDI_DEBUG_LEVEL_3
#endif
#define SELDON_DEBUG_LEVEL_4
#endif
#ifdef VERDANDI_DEBUG_LEVEL_3
#ifndef VERDANDI_DEBUG_LEVEL_2
#define VERDANDI_DEBUG_LEVEL_2
#endif
#define SELDON_DEBUG_LEVEL_3
#endif
#ifdef VERDANDI_DEBUG_LEVEL_2
#ifndef VERDANDI_DEBUG_LEVEL_1
#define VERDANDI_DEBUG_LEVEL_1
#endif
#ifndef VERDANDI_CHECK_DIMENSIONS
#define VERDANDI_CHECK_DIMENSIONS
#endif
#define SELDON_DEBUG_LEVEL_2
#endif
#ifdef VERDANDI_DEBUG_LEVEL_1
#ifndef VERDANDI_DEBUG_LEVEL_0
#define VERDANDI_DEBUG_LEVEL_0
#endif
#define SELDON_DEBUG_LEVEL_1
#ifndef VERDANDI_CHECK_IO
#define VERDANDI_CHECK_IO
#endif
#endif
#ifdef VERDANDI_DEBUG_LEVEL_0
#define SELDON_DEBUG_LEVEL_0
#ifndef VERDANDI_DEBUG_LEVEL_2
#define VERDANDI_IS_ACTIVE false
#endif
#endif
#ifdef VERDANDI_WITH_ABORT
#define SELDON_WITH_ABORT
#endif
#ifndef VERDANDI_WITH_ABORT
#define OPS_WITH_EXCEPTION
#endif
// Uncomment these lines to disable the logger and its messages. This is
// useful to speed up the unit tests.
// #define VERDANDI_IGNORE_MESSAGE
// #define VERDANDI_LOG_IS_ACTIVE 0
// Convenient macros to catch exceptions.
#ifndef VERDANDI_TRY
#define VERDANDI_TRY try {
#endif
#ifndef VERDANDI_CATCH
#define VERDANDI_CATCH \
catch(Verdandi::Error& Err) \
{ \
Err.CoutWhat(); \
return 1; \
} \
catch(Seldon::Error& Err) \
{ \
Err.CoutWhat(); \
return 1; \
} \
catch(::Ops::Error& Err) \
{ \
Err.CoutWhat(); \
return 1; \
} \
catch(std::exception& Err) \
{ \
std::cout << "C++ exception: " \
<< Err.what() << std::endl; \
return 1; \
} \
catch(std::string& str) \
{ \
std::cout << str << std::endl; \
return 1; \
} \
catch(const char* str) \
{ \
std::cout << str << std::endl; \
return 1; \
}
#endif
#ifndef VERDANDI_CATCH_ANY
#define VERDANDI_CATCH_ANY \
catch(...) \
{ \
std::cout << "Unknown exception..." << std::endl; \
return 1; \
}
#endif
#ifndef VERDANDI_END
#define VERDANDI_END \
} \
VERDANDI_CATCH \
VERDANDI_CATCH_ANY
#endif
#ifdef WIN32
#define int64_t __int64
#endif
#include "seldon/SeldonHeader.hxx"
#include "seldon/vector/Vector2.hxx"
#include "seldon/vector/Vector3.hxx"
namespace Verdandi
{
using namespace std;
using namespace Seldon;
using Seldon::to_num;
using Seldon::to_str;
} // namespace Verdandi.
#ifndef VERDANDI_PYTHON_VERSION
#define VERDANDI_PYTHON_VERSION 3.8
#endif
#include "share/VerdandiOps.hxx"
#include "share/Logger.hxx"
#include "share/Error.hxx"
#include "share/UsefulFunction.hxx"
#include "share/MessageHandler.hxx"
#include "share/VerdandiBase.hxx"
#include "share/OutputSaver.hxx"
#ifdef VERDANDI_SPARSE
#define VERDANDI_TANGENT_LINEAR_OPERATOR_SPARSE
#define VERDANDI_OBSERVATION_ERROR_SPARSE
#define VERDANDI_STATE_ERROR_SPARSE
#endif
#ifdef VERDANDI_DENSE
#define VERDANDI_TANGENT_LINEAR_OPERATOR_DENSE
#define VERDANDI_STATE_ERROR_DENSE
#endif
#ifdef __GXX_EXPERIMENTAL_CXX0X__
#define VERDANDI_HAS_CXX11
#elif defined __clang__
#define VERDANDI_HAS_CXX11
#elif __cplusplus > 199711L
#define VERDANDI_HAS_CXX11
#endif
#define VERDANDI_FILE_VERDANDIHEADER_HXX
#endif