hej
is hosted by
Hepforge
,
IPPP Durham
HEJ
2.1.4
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
using
result_type
= unsigned;
22
24
virtual
double
flat
() = 0;
25
27
virtual
result_type
min
()
const
= 0;
29
virtual
result_type
max
()
const
= 0;
31
virtual
result_type
operator()
() = 0;
32
33
virtual
~RNG
() =
default
;
34
};
35
37
struct
DefaultRNG
:
virtual
RNG
{
38
result_type
min
()
const override
{
39
return
0U;
40
}
41
result_type
max
()
const override
{
42
return
std::numeric_limits<result_type>::max() - 1;
43
}
44
result_type
operator()
()
override
{
45
return
flat
()*std::numeric_limits<result_type>::max();
46
}
47
};
48
}
// namespace HEJ
HEJ
Main HEJ 2 Namespace.
Definition:
mainpage.dox:1
HEJ::DefaultRNG
Helper struct with default implementations.
Definition:
RNG.hh:37
HEJ::DefaultRNG::min
result_type min() const override
Minimum number that can be generated.
Definition:
RNG.hh:38
HEJ::DefaultRNG::max
result_type max() const override
Maximum number that can be generated.
Definition:
RNG.hh:41
HEJ::DefaultRNG::operator()
result_type operator()() override
Generate random number in [min(), max()].
Definition:
RNG.hh:44
HEJ::RNG
Interface for random number generator.
Definition:
RNG.hh:19
HEJ::RNG::operator()
virtual result_type operator()()=0
Generate random number in [min(), max()].
HEJ::RNG::max
virtual result_type max() const =0
Maximum number that can be generated.
HEJ::RNG::~RNG
virtual ~RNG()=default
HEJ::RNG::min
virtual result_type min() const =0
Minimum number that can be generated.
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:21
Generated by
1.9.5