CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
src
BetaDistribution.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id:
3
4
#include "
CLHEP/GenericFunctions/BetaDistribution.hh
"
5
#include <assert.h>
6
#include <cmath>
7
using namespace
std;
8
9
namespace
Genfun {
10
FUNCTION_OBJECT_IMP
(BetaDistribution)
11
12
13
BetaDistribution
::
BetaDistribution
():
14
_alpha("
a
", 1.0, 0.0, 100),
15
_beta ("beta", 1.0, 0.0, 100)
16
{}
17
18
BetaDistribution::BetaDistribution(
const
BetaDistribution
& right):
19
AbsFunction
( right ),
20
_alpha(right._alpha),
21
_beta (right._beta)
22
{
23
}
24
25
BetaDistribution::~BetaDistribution
() {
26
}
27
28
double
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
35
Parameter
&
BetaDistribution::alpha
() {
36
return
_alpha;
37
}
38
39
40
Parameter
&
BetaDistribution::beta
() {
41
return
_beta;
42
}
43
44
45
46
}
// namespace Genfun
Generated on Mon May 6 2013 04:04:10 for CLHEP by
1.8.1.2