CLHEP
2.4.7.1
C++ Class Library for High Energy Physics
CLHEP
Random
RandBinomial.icc
Go to the documentation of this file.
1
// $Id: RandBinomial.icc,v 1.3 2010/06/16 17:24:53 garren Exp $
2
// -*- C++ -*-
3
//
4
// -----------------------------------------------------------------------
5
// HEP Random
6
// --- RandBinomial ---
7
// inlined functions implementation file
8
// -----------------------------------------------------------------------
9
10
// =======================================================================
11
// Gabriele Cosmo - Created: 18th August 1998
12
// =======================================================================
13
14
namespace
CLHEP
{
15
16
inline
RandBinomial::RandBinomial
(
HepRandomEngine
& anEngine,
long
n,
17
double
p )
18
:
HepRandom
( ), localEngine( &anEngine,
do_nothing_deleter
() ),
19
defaultN(n), defaultP(p) {}
20
21
inline
RandBinomial::RandBinomial
(
HepRandomEngine
* anEngine,
long
n,
22
double
p )
23
:
HepRandom
( ), localEngine( anEngine),
24
defaultN(n), defaultP(p) {}
25
26
inline
double
RandBinomial::shoot
() {
27
return
shoot
( 1, 0.5 );
28
}
29
30
inline
double
RandBinomial::shoot
(
HepRandomEngine
* anEngine ) {
31
return
shoot
( anEngine, 1, 0.5 );
32
}
33
34
inline
double
RandBinomial::operator()
() {
35
return
fire
( defaultN, defaultP );
36
}
37
38
inline
double
RandBinomial::operator()
(
long
n,
double
p ) {
39
return
fire
( n, p );
40
}
41
42
inline
double
RandBinomial::fire
() {
43
return
fire
( defaultN, defaultP );
44
}
45
46
}
// namespace CLHEP
CLHEP::HepRandomEngine
Definition
RandomEngine.h:55
CLHEP::HepRandom::HepRandom
HepRandom()
CLHEP::RandBinomial::RandBinomial
RandBinomial(HepRandomEngine &anEngine, long n=1, double p=0.5)
Definition
RandBinomial.icc:16
CLHEP::RandBinomial::fire
double fire()
Definition
RandBinomial.icc:42
CLHEP::RandBinomial::shoot
static double shoot()
Definition
RandBinomial.icc:26
CLHEP::RandBinomial::operator()
double operator()()
Definition
RandBinomial.icc:34
CLHEP
Definition
ClhepVersion.h:13
CLHEP::do_nothing_deleter
Definition
memory.h:25
Generated by
1.13.2