gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-252-gf9a3f78
a Global And Modular Bsm Inference Tool
Gambit::Utils::threadsafe_rng Class Referenceabstract

Base class for thread-safe random number generators. More...

#include <threadsafe_rng.hpp>

Inheritance diagram for Gambit::Utils::threadsafe_rng:

Public Types

typedef std::uint64_t result_type
 Return type (will convert underlying RNG type to this) More...
 

Public Member Functions

virtual ~threadsafe_rng ()=0
 Pure virtual destructor to force overriding in derived class. More...
 
virtual result_type operator() ()=0
 Operator used for getting random deviates. More...
 

Static Public Member Functions

static constexpr result_type min ()
 Operators for compliance with RandomNumberEngine interface -> random distribution sampling. More...
 
static constexpr result_type max ()
 

Detailed Description

Base class for thread-safe random number generators.

Must conform to the requirements of UniformRandomBitGenerator, see e.g. https://en.cppreference.com/w/cpp/named_req/UniformRandomBitGenerator Importantly, operator() must return UNSIGNED INTEGERS!

Definition at line 69 of file threadsafe_rng.hpp.

Member Typedef Documentation

◆ result_type

Return type (will convert underlying RNG type to this)

Definition at line 73 of file threadsafe_rng.hpp.

Constructor & Destructor Documentation

◆ ~threadsafe_rng()

Gambit::Utils::threadsafe_rng::~threadsafe_rng ( )
inlinepure virtual

Pure virtual destructor to force overriding in derived class.

Give an inline implementation of the destructor, to prevent link errors but keep base class pure virtual.

Definition at line 87 of file threadsafe_rng.hpp.

87 {}

Member Function Documentation

◆ max()

static constexpr result_type Gambit::Utils::threadsafe_rng::max ( )
inlinestatic

Definition at line 83 of file threadsafe_rng.hpp.

83 { return UINT64_MAX; }

◆ min()

static constexpr result_type Gambit::Utils::threadsafe_rng::min ( )
inlinestatic

Operators for compliance with RandomNumberEngine interface -> random distribution sampling.

Definition at line 82 of file threadsafe_rng.hpp.

82 { return 0; }

◆ operator()()

virtual result_type Gambit::Utils::threadsafe_rng::operator() ( )
pure virtual

Operator used for getting random deviates.

Implemented in Gambit::Utils::specialised_threadsafe_rng< Engine >.


The documentation for this class was generated from the following file: