constants.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 template<typename eT>
00025 class Math
00026 {
00027 public:
00028
00029
00030 static const eT pi() { return eT(3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679); }
00031
00032
00033 static const eT e() { return eT(2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274); }
00034
00035
00036 static const eT euler() { return eT(0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495); }
00037
00038
00039 static const eT gratio() { return eT(1.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374); }
00040
00041
00042 static const eT sqrt2() { return eT(1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727); }
00043
00044
00045 static const eT eps() { return std::numeric_limits<eT>::epsilon(); }
00046
00047
00048 static const eT log_min() { static const eT out = std::log(std::numeric_limits<eT>::min()); return out; }
00049
00050
00051 static const eT log_max() { static const eT out = std::log(std::numeric_limits<eT>::max()); return out; }
00052 };
00053
00054
00055
00056
00057
00058
00059
00060 template<typename eT>
00061 class Phy
00062 {
00063 public:
00064
00065
00066 static const eT m_u() { return eT(1.660538782e-27); }
00067
00068
00069 static const eT N_A() { return eT(6.02214179e23); }
00070
00071
00072 static const eT k() { return eT(1.3806504e-23); }
00073
00074
00075 static const eT k_evk() { return eT(8.617343e-5); }
00076
00077
00078 static const eT a_0() { return eT(0.52917720859e-10); }
00079
00080
00081 static const eT mu_B() { return(927.400915e-26); }
00082
00083
00084 static const eT Z_0() { return eT(3.76730313461771e-2); }
00085
00086
00087 static const eT G_0() { return eT(7.7480917004e-5); }
00088
00089
00090 static const eT k_e() { return eT(8.9875517873681764e9); }
00091
00092
00093 static const eT eps_0() { return eT(8.85418781762039e-12); }
00094
00095
00096 static const eT m_e() { return eT(9.10938215e-31); }
00097
00098
00099 static const eT eV() { return eT(1.602176487e-19); }
00100
00101
00102 static const eT e() { return eT(1.602176487e-19); }
00103
00104
00105 static const eT F() { return eT(96485.3399); }
00106
00107
00108 static const eT alpha() { return eT(7.2973525376e-3); }
00109
00110
00111 static const eT alpha_inv() { return eT(137.035999679); }
00112
00113
00114 static const eT K_J() { return eT(483597.891e9); }
00115
00116
00117 static const eT mu_0() { return eT(1.25663706143592e-06); }
00118
00119
00120 static const eT phi_0() { return eT(2.067833667e-15); }
00121
00122
00123 static const eT R() { return eT(8.314472); }
00124
00125
00126 static const eT G() { return eT(6.67428e-11); }
00127
00128
00129 static const eT h() { return eT(6.62606896e-34); }
00130
00131
00132 static const eT h_bar() { return eT(1.054571628e-34); }
00133
00134
00135 static const eT m_p() { return eT(1.672621637e-27); }
00136
00137
00138 static const eT R_inf() { return eT(10973731.568527); }
00139
00140
00141 static const eT c_0() { return eT(299792458.0); }
00142
00143
00144 static const eT sigma() { return eT(5.670400e-8); }
00145
00146
00147 static const eT R_k() { return eT(25812.807557); }
00148
00149
00150 static const eT b() { return eT(2.8977685e-3); }
00151 };
00152
00153
00154
00155 typedef Math<float> fmath;
00156 typedef Math<double> math;
00157
00158 typedef Phy<float> fphy;
00159 typedef Phy<double> phy;
00160
00161
00162
00163