Chebyshev
Unit testing for scientific software
Loading...
Searching...
No Matches
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
37using real_t = double;
38
39
42using prec_t = long double;
43
44
45#include <limits>
46#include <vector>
47#include "../prec/interval.h"
48
49
50#define CAST_LAMBDA(func, type) [=](type x){ return func(static_cast<type>(x)); }
51
52
53namespace chebyshev {
54
55
59 template<typename Type = double>
60 using EndoFunction = std::function<Type(Type)>;
61
62
64 template<typename FloatType = long double>
65 inline constexpr FloatType get_nan() {
66 return std::numeric_limits<FloatType>::quiet_NaN();
67 }
68
69
71 const long double PI_CONST = 3.141592653589793238462643L;
72
73}
74
75
77#ifndef CHEBYSHEV_NO_ALIAS
78namespace ch = chebyshev;
79#endif
80
81#endif
long double prec_t
Floating-point type of higher precision, used in computations, such as error estimation.
Definition common.h:42
double real_t
Floating-point type, used as default for function arguments.
Definition common.h:37
General namespace of the framework.
Definition benchmark.h:22
constexpr FloatType get_nan()
Get a quiet NaN of the specified floating point type.
Definition common.h:65
std::function< Type(Type)> EndoFunction
An endofunction is a function which has the same type of input and output, such as a real function of...
Definition common.h:60
const long double PI_CONST
The Pi mathematical constant.
Definition common.h:71