#include <Gamma.hh>
|
double | GamCf (double a, double x) |
|
double | GamSer (double a, double x) |
|
|
static double | Abs (double d) |
|
static float | Abs (float d) |
|
static int | Abs (int d) |
|
static long | Abs (long d) |
|
static short | Abs (short d) |
|
static double | Exp (double x) |
|
static double | LnGamma (double z) |
|
static double | Log (double x) |
|
Definition at line 45 of file Gamma.hh.
◆ MyGamma()
◆ ~MyGamma()
◆ Abs() [1/5]
static double MyGamma::Abs |
( |
double |
d | ) |
|
|
inlinestaticprivate |
Definition at line 65 of file Gamma.hh.
65{ return (d > 0) ? d : -d; }
◆ Abs() [2/5]
static float MyGamma::Abs |
( |
float |
d | ) |
|
|
inlinestaticprivate |
Definition at line 64 of file Gamma.hh.
64{ return (d > 0) ? d : -d; }
◆ Abs() [3/5]
static int MyGamma::Abs |
( |
int |
d | ) |
|
|
inlinestaticprivate |
Definition at line 62 of file Gamma.hh.
62{ return (d > 0) ? d : -d; }
◆ Abs() [4/5]
static long MyGamma::Abs |
( |
long |
d | ) |
|
|
inlinestaticprivate |
Definition at line 63 of file Gamma.hh.
63{ return (d > 0) ? d : -d; }
◆ Abs() [5/5]
static short MyGamma::Abs |
( |
short |
d | ) |
|
|
inlinestaticprivate |
◆ Exp()
static double MyGamma::Exp |
( |
double |
x | ) |
|
|
inlinestaticprivate |
◆ GamCf()
double MyGamma::GamCf |
( |
double |
a, |
|
|
double |
x |
|
) |
| |
|
private |
Definition at line 66 of file Gamma.cc.
67{
68
69
70
71
72
73
74
75
76 int itmax = 100;
78 double fpmin = 1.e-30;
79
80 if (a <= 0 || x <= 0) return 0;
81
83 double b = x+1-a;
84 double c = 1/fpmin;
85 double d = 1/b;
86 double h = d;
88 for (int i=1; i<=itmax; i++) {
89 an = double(-i)*(double(i)-a);
90 b += 2;
92 if (
Abs(d) < fpmin) d = fpmin;
94 if (
Abs(c) < fpmin) c = fpmin;
95 d = 1/d;
96 del = d*c;
97 h = h*del;
98 if (
Abs(del-1) <
eps)
break;
99
100 }
101 double v =
Exp(-x+a*
Log(x)-gln)*h;
102 return (1-v);
103}
static const G4double eps
static short Abs(short d)
static double LnGamma(double z)
static double Log(double x)
static double Exp(double x)
References Abs(), G4InuclParticleNames::an, eps, Exp(), LnGamma(), and Log().
Referenced by Gamma().
◆ Gamma() [1/2]
double MyGamma::Gamma |
( |
double |
a, |
|
|
double |
x |
|
) |
| |
Definition at line 50 of file Gamma.cc.
51{
52
53
54
55
56
57
58
59 if (a <= 0 || x <= 0) return 0;
60
61 if (x < (a+1))
return GamSer(a,x);
62 else return GamCf(a,x);
63}
double GamCf(double a, double x)
double GamSer(double a, double x)
References GamCf(), and GamSer().
◆ Gamma() [2/2]
double MyGamma::Gamma |
( |
double |
z | ) |
|
◆ GamSer()
double MyGamma::GamSer |
( |
double |
a, |
|
|
double |
x |
|
) |
| |
|
private |
◆ LnGamma()
double MyGamma::LnGamma |
( |
double |
z | ) |
|
|
staticprivate |
Definition at line 137 of file Gamma.cc.
138{
139 if (z <= 0)
140 return 0;
141
142 return std::lgamma(z);
143}
Referenced by GamCf(), and GamSer().
◆ Log()
static double MyGamma::Log |
( |
double |
x | ) |
|
|
inlinestaticprivate |
The documentation for this class was generated from the following files:
- source/parameterisations/gflash/include/Gamma.hh
- source/parameterisations/gflash/src/Gamma.cc