Chebyshev
Unit testing for scientific software
common.h
Go to the documentation of this file.
1 
5 
6 #ifndef CHEBYSHEV_COMMON_H
7 #define CHEBYSHEV_COMMON_H
8 
9 #ifndef CHEBYSHEV_PREC_ITER
12 #define CHEBYSHEV_PREC_ITER 1000
13 #endif
14 
15 #ifndef CHEBYSHEV_PREC_TOLERANCE
17 #define CHEBYSHEV_PREC_TOLERANCE 1E-08
18 #endif
19 
20 #ifndef CHEBYSHEV_BENCHMARK_ITER
22 #define CHEBYSHEV_BENCHMARK_ITER 1000
23 #endif
24 
25 #ifndef CHEBYSHEV_BENCHMARK_RUNS
27 #define CHEBYSHEV_BENCHMARK_RUNS 10
28 #endif
29 
30 #ifndef CHEBYSHEV_OUTPUT_WIDTH
32 #define CHEBYSHEV_OUTPUT_WIDTH 12
33 #endif
34 
35 
36 #include <limits>
37 #include <vector>
38 #include "../prec/interval.h"
39 
40 
41 #define CAST_LAMBDA(func, type) [=](type x){ return func(static_cast<type>(x)); }
42 
43 
44 namespace chebyshev {
45 
46 
49  template<typename Type = double>
50  using EndoFunction = std::function<Type(Type)>;
51 
52 
54  template<typename FloatType = long double>
55  inline constexpr FloatType get_nan() {
56  return std::numeric_limits<FloatType>::quiet_NaN();
57  }
58 
59 
61  const long double PI_CONST = 3.141592653589793238462643L;
62 
63 }
64 
65 
67 #ifndef CHEBYSHEV_NO_ALIAS
68 namespace ch = chebyshev;
69 #endif
70 
71 #endif
General namespace of the framework.
Definition: benchmark_structures.h:16
constexpr FloatType get_nan()
Get a quiet NaN of the specified floating point type.
Definition: common.h:55
std::function< Type(Type)> EndoFunction
An endofunction is a function which has the same type of input and output (e.g.
Definition: common.h:50
const long double PI_CONST
The Pi mathematical constant.
Definition: common.h:61