CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

BetaDistribution.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id:
3
5#include <assert.h>
6#include <cmath>
7using namespace std;
8
9namespace Genfun {
10FUNCTION_OBJECT_IMP(BetaDistribution)
11
12
14 _alpha("a", 1.0, 0.0, 100),
15 _beta ("beta", 1.0, 0.0, 100)
16{}
17
19AbsFunction( right ),
20_alpha(right._alpha),
21_beta (right._beta)
22{
23}
24
27
28double BetaDistribution::operator() (double x) const {
29 double a = _alpha.getValue(),b=_beta.getValue();
30 return pow(x,a-1)*pow((1-x),b-1)*
31 exp(_logGamma(a+b)-_logGamma(a)-_logGamma(b));
32
33}
34
36 return _alpha;
37}
38
39
41 return _beta;
42}
43
44
45
46} // namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
virtual double operator()(double argument) const
virtual double getValue() const
Definition Parameter.cc:27