C++ main module for stochmagnet Package  1.0
constants.h
Go to the documentation of this file.
1 #ifndef CONSTANTS_H
2 #define CONSTANTS_H
3 
4 #include "types.h"
5 
6 
7 //null pointer
8 //#define null NULL
9 #define null nullptr
10 
11 //NULL Index
12 #define NULL_INDEX std::numeric_limits<tIndex>::max()
13 
14 //zero
15 template<typename T>
16 constexpr T EPSILON=std::numeric_limits<T>::epsilon();
17 
18 constexpr tReal R_EPSILON=EPSILON<tReal>;
19 constexpr tDouble D_EPSILON=EPSILON<tDouble>;
20 constexpr tFloat F_EPSILON=EPSILON<tFloat>;
21 constexpr tLDouble LD_EPSILON=EPSILON<tLDouble>;
22 
23 //pi
24 template<typename T>
25 constexpr T PI=(T) 3.141592653589793238462643383795;
26 
27 constexpr tReal R_PI=PI<tReal>;
28 constexpr tFloat F_PI=PI<tFloat>;
29 constexpr tDouble D_PI=PI<tDouble>;
30 constexpr tLDouble LD_PI=PI<tLDouble>;
31 
32 #endif
constexpr tLDouble LD_PI
Definition: constants.h:30
constexpr tDouble D_EPSILON
Definition: constants.h:19
constexpr T PI
Definition: constants.h:25
constexpr tDouble D_PI
Definition: constants.h:29
constexpr tReal R_EPSILON
Definition: constants.h:18
constexpr tReal R_PI
Definition: constants.h:27
constexpr tLDouble LD_EPSILON
Definition: constants.h:21
constexpr tFloat F_PI
Definition: constants.h:28
constexpr tFloat F_EPSILON
Definition: constants.h:20
constexpr T EPSILON
Definition: constants.h:16
#define tLDouble
Definition: types.h:70
#define tDouble
Definition: types.h:67
#define tFloat
Definition: types.h:64
#define tReal
Definition: types.h:137