hej
is hosted by
Hepforge
,
IPPP Durham
HEJ
2.2.2
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
//
20
// See https://en.cppreference.com/w/cpp/named_req/UniformRandomBitGenerator
21
// for requirements.
22
struct
RNG
{
24
using
result_type
= unsigned;
25
27
virtual
double
flat
() = 0;
28
30
constexpr
static
result_type
min
() {
31
return
0u;
32
}
33
35
constexpr
static
result_type
max
() {
36
return
std::numeric_limits<result_type>::max() - 1;
37
}
38
40
result_type
operator()
() {
41
return
flat
()*std::numeric_limits<result_type>::max();
42
}
43
44
virtual
~RNG
() =
default
;
45
};
46
}
// namespace HEJ
HEJ
Main HEJ 2 Namespace.
Definition:
mainpage.dox:1
HEJ::RNG
Interface for random number generator.
Definition:
RNG.hh:22
HEJ::RNG::max
static constexpr result_type max()
Maximum number that can be generated.
Definition:
RNG.hh:35
HEJ::RNG::operator()
result_type operator()()
Generate random number in [min(), max()].
Definition:
RNG.hh:40
HEJ::RNG::min
static constexpr result_type min()
Minimum number that can be generated.
Definition:
RNG.hh:30
HEJ::RNG::~RNG
virtual ~RNG()=default
HEJ::RNG::flat
virtual double flat()=0
Generate random number in [0,1)
HEJ::RNG::result_type
unsigned result_type
Random number type, see std::RandomNumberDistribution.
Definition:
RNG.hh:24
Generated by
1.9.5