Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MyGamma Class Reference

#include <Gamma.hh>

Public Member Functions

 MyGamma ()
 
 ~MyGamma ()
 
double Gamma (double z)
 
double Gamma (double a, double x)
 

Detailed Description

Definition at line 46 of file Gamma.hh.

Constructor & Destructor Documentation

MyGamma::MyGamma ( )

Definition at line 37 of file Gamma.cc.

37 {}
MyGamma::~MyGamma ( )

Definition at line 39 of file Gamma.cc.

39 {}

Member Function Documentation

double MyGamma::Gamma ( double  z)

Definition at line 42 of file Gamma.cc.

43 {
44  // Computation of gamma(z) for all z>0.
45  //
46  // The algorithm is based on the article by C.Lanczos [1] as denoted in
47  // Numerical Recipes 2nd ed. on p. 207 (W.H.Press et al.).
48  //
49  // [1] C.Lanczos, SIAM Journal of Numerical Analysis B1 (1964), 86.
50  //
51  //--- Nve 14-nov-1998 UU-SAP Utrecht
52 
53  if (z<=0) return 0;
54 
55  double v = LnGamma(z);
56  return std::exp(v);
57 }
tuple v
Definition: test.py:18
tuple z
Definition: test.py:28

Here is the caller graph for this function:

double MyGamma::Gamma ( double  a,
double  x 
)

Definition at line 60 of file Gamma.cc.

61 {
62  // Computation of the incomplete gamma function P(a,x)
63  //
64  // The algorithm is based on the formulas and code as denoted in
65  // Numerical Recipes 2nd ed. on p. 210-212 (W.H.Press et al.).
66  //
67  //--- Nve 14-nov-1998 UU-SAP Utrecht
68 
69  if (a <= 0 || x <= 0) return 0;
70 
71  if (x < (a+1)) return GamSer(a,x);
72  else return GamCf(a,x);
73 }
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
tuple x
Definition: test.py:50

The documentation for this class was generated from the following files: