NGSolve  5.3
ngstd.hpp
1 #ifndef FILE_NGSTD
2 #define FILE_NGSTD
3 
4 /*********************************************************************/
5 /* File: ngstd.hpp */
6 /* Author: Joachim Schoeberl */
7 /* Date: 25. Mar. 2000 */
8 /*********************************************************************/
9 
10 /*
11  ng-standard classes
12 */
13 
14 #include <ngs_stdcpp_include.hpp>
15 
16 #ifdef WIN32
17  #ifdef NGINTERFACE_EXPORTS
18  #define DLL_HEADER __declspec(dllexport)
19  #else
20  #define DLL_HEADER __declspec(dllimport)
21  #endif
22 
23  #ifdef NGS_EXPORTS
24  #define NGS_DLL_HEADER __declspec(dllexport)
25  #else
26  #define NGS_DLL_HEADER __declspec(dllimport)
27  #endif
28 
29 
30 #else
31  #if __GNUC__ >= 4
32  #define DLL_HEADER __attribute__ ((visibility ("default")))
33  #else
34  #define DLL_HEADER
35  #endif
36 // #define NGS_DLL_HEADER
37 
38 
39 /*
40  #ifdef NGINTERFACE_EXPORTS
41  #define DLL_HEADER __declspec(dllexport)
42  #else
43  #define DLL_HEADER __declspec(dllimport)
44  #endif
45 */
46 
47  #if __GNUC__ >= 4
48  #define NGS_DLL_HEADER __attribute__ ((visibility ("default")))
49  #else
50  #define NGS_DLL_HEADER
51  #endif
52 
53 
54 #endif
55 
56 /*
57 inline void * operator new (size_t cnt)
58 {
59  static int cnt_new = 0;
60  cnt_new++;
61  std::cout << "private new called, cnt = " << cnt_new << ", bytes = " << cnt << std::endl;
62  return operator new(cnt, std::nothrow);
63 }
64 
65 inline void * operator new[] (size_t cnt)
66 {
67  static int cnt_new = 0;
68  cnt_new++;
69  std::cout << "private new[] called, cnt = " << cnt_new << ", bytes = " << cnt << std::endl;
70  return operator new[](cnt, std::nothrow);
71 }
72 */
73 
74 
75 
76 
77 
78 // #include "dynamicmem.hpp"
79 
80 
81 namespace ngstd
82 {
83  NGS_DLL_HEADER extern int printmessage_importance;
84  NGS_DLL_HEADER extern const std::string ngsolve_version;
85 }
86 
87 
88 
89 /*
90 namespace ngstd
91 {
92  using netgen::DynamicMem;
93 }
94 */
95 
96 
104 namespace ngstd
105 {
106  using namespace std;
107  template <typename T>
109  {
110  T val;
111  public:
112  ParallelValue (const T & _val) : val(_val) { ; }
113  operator T () const { return val; }
114  };
115 
116  template <typename FUNC> class ParallelFunction
117  {
118  FUNC f;
119  public:
120  ParallelFunction (const FUNC & _f) : f(_f) { ; }
121  operator FUNC () const { return f; }
122  auto operator() (size_t i) const { return f(i); }
123  };
124 
125 }
126 
127 #include <ngs_defines.hpp>
128 
129 // #include "mycomplex.hpp"
130 #include <core/ngcore.hpp>
131 namespace ngstd
132 {
133  using namespace ngcore;
134  using ngcore::INT;
135 } // namespace ngstd
136 
137 #include "ngs_utils.hpp"
138 #include "ngsstream.hpp"
139 #include "templates.hpp"
140 
141 #include "simd.hpp"
142 #include "simd_complex.hpp"
143 
144 #include "blockalloc.hpp"
145 #include "autoptr.hpp"
146 #include "memusage.hpp"
147 
148 #include "evalfunc.hpp"
149 #include "sample_sort.hpp"
150 
151 #include "autodiff.hpp"
152 #include "autodiffdiff.hpp"
153 #include "polorder.hpp"
154 #include "stringops.hpp"
155 #include "statushandler.hpp"
156 
157 #include "mpiwrapper.hpp"
158 #ifndef WIN32
159 #include "sockets.hpp"
160 #endif
161 
162 namespace ngstd
163 {
164 #ifdef WIN32
165  const char dirslash = '\\';
166 #else
167  const char dirslash = '/';
168 #endif
169 }
170 
171 
172 inline void NOOP_Deleter(void *) { ; }
173 
174 
175 #ifdef GOLD
176 #include <ngstd_gold.hpp>
177 #endif
178 
179 
180 
181 #include "cuda_ngstd.hpp"
182 
183 #endif
Definition: ngstd.hpp:116
namespace for standard data types and algorithms.
Definition: ngstd.hpp:81
Definition: ngstd.hpp:108