#include <Gamma.hh>
Public Member Functions | |
MyGamma () | |
~MyGamma () | |
double | Gamma (double z) |
double | Gamma (double a, double x) |
Definition at line 46 of file Gamma.hh.
double MyGamma::Gamma | ( | double | a, | |
double | x | |||
) |
Definition at line 60 of file Gamma.cc.
00061 { 00062 // Computation of the incomplete gamma function P(a,x) 00063 // 00064 // The algorithm is based on the formulas and code as denoted in 00065 // Numerical Recipes 2nd ed. on p. 210-212 (W.H.Press et al.). 00066 // 00067 //--- Nve 14-nov-1998 UU-SAP Utrecht 00068 00069 if (a <= 0 || x <= 0) return 0; 00070 00071 if (x < (a+1)) return GamSer(a,x); 00072 else return GamCf(a,x); 00073 }
double MyGamma::Gamma | ( | double | z | ) |
Definition at line 42 of file Gamma.cc.
Referenced by GVFlashShowerParameterisation::gam().
00043 { 00044 // Computation of gamma(z) for all z>0. 00045 // 00046 // The algorithm is based on the article by C.Lanczos [1] as denoted in 00047 // Numerical Recipes 2nd ed. on p. 207 (W.H.Press et al.). 00048 // 00049 // [1] C.Lanczos, SIAM Journal of Numerical Analysis B1 (1964), 86. 00050 // 00051 //--- Nve 14-nov-1998 UU-SAP Utrecht 00052 00053 if (z<=0) return 0; 00054 00055 double v = LnGamma(z); 00056 return std::exp(v); 00057 }