hej
is hosted by
Hepforge
,
IPPP Durham
HEJ 2
2.0
High energy resummation for hadron colliders
Loading...
Searching...
No Matches
include
HEJ
RNG.hh
Go to the documentation of this file.
1
12
#pragma once
13
14
#include <limits>
15
16
namespace
HEJ
{
17
19
struct
RNG
{
21
virtual
double
flat
() = 0;
22
24
virtual
unsigned
min
()
const
= 0;
26
virtual
unsigned
max
()
const
= 0;
28
virtual
unsigned
operator()
() = 0;
29
30
virtual
~RNG
() =
default
;
31
};
32
34
struct
DefaultRNG
:
virtual
RNG
{
35
unsigned
min
()
const override
{
36
return
0u;
37
}
38
unsigned
max
()
const override
{
39
return
std::numeric_limits<unsigned>::max() - 1;
40
}
41
unsigned
operator()
()
override
{
42
return
flat
()*std::numeric_limits<unsigned int>::max();
43
}
44
};
45
}
HEJ
Main HEJ 2 Namespace.
Definition:
mainpage.dox:1
HEJ::DefaultRNG
Helper struct with default implementations.
Definition:
RNG.hh:34
HEJ::DefaultRNG::max
unsigned max() const override
Maximum number that can be generated.
Definition:
RNG.hh:38
HEJ::DefaultRNG::operator()
unsigned operator()() override
Generate random number in [min(), max()].
Definition:
RNG.hh:41
HEJ::DefaultRNG::min
unsigned min() const override
Minimum number that can be generated.
Definition:
RNG.hh:35
HEJ::RNG
Interface for random number generator.
Definition:
RNG.hh:19
HEJ::RNG::~RNG
virtual ~RNG()=default
HEJ::RNG::flat
virtual double flat()=0
Generate random number in (0,1].
HEJ::RNG::min
virtual unsigned min() const =0
Minimum number that can be generated.
HEJ::RNG::operator()
virtual unsigned operator()()=0
Generate random number in [min(), max()].
HEJ::RNG::max
virtual unsigned max() const =0
Maximum number that can be generated.
Generated by
1.9.5