CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
src
LogGamma.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id: LogGamma.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
3
// ---------------------------------------------------------------------------
4
5
#include "
CLHEP/GenericFunctions/LogGamma.hh
"
6
#include <cmath>
// for log()
7
8
namespace
Genfun {
9
FUNCTION_OBJECT_IMP
(LogGamma)
10
11
const
double
LogGamma::_coefficient[6]={
12
+76.18009172947146,
13
-86.50532032941677,
14
+24.01409824083091,
15
-1.231739572450155,
16
0.1208650973866179E-2,
17
-0.5395239384953E-5};
18
19
LogGamma::LogGamma
()
20
{}
21
22
LogGamma::LogGamma
(
const
LogGamma
& right) :
AbsFunction
(right)
23
{}
24
25
LogGamma::~LogGamma
() {
26
}
27
28
double
LogGamma::operator()
(
double
x)
const
{
29
double
y=x,tmp=x+5.5,ser=1.000000000190015,c=2.5066282746310005;
30
tmp -= (x+0.5)*log(tmp);
31
for
(
int
j=0;j<6;j++) ser += _coefficient[j]/++y;
32
return
-tmp+log(c*ser/x);
33
}
34
35
}
// namespace Genfun
Genfun::LogGamma::operator()
virtual double operator()(double argument) const
Definition:
LogGamma.cc:28
Genfun::AbsFunction
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:48
LogGamma.hh
Genfun::LogGamma::~LogGamma
virtual ~LogGamma()
Definition:
LogGamma.cc:25
Genfun::LogGamma
Definition:
CLHEP/GenericFunctions/LogGamma.hh:19
FUNCTION_OBJECT_IMP
#define FUNCTION_OBJECT_IMP(classname)
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:156
Genfun::LogGamma::LogGamma
LogGamma()
Definition:
LogGamma.cc:19
Generated on Sat Apr 26 2014 07:58:34 for CLHEP by
1.8.6