Lumiera  0.pre.03
»edit your freedom«
RandomSequencer< GEN > Class Template Reference

#include "lib/random.hpp"

Description

template<class GEN>
class lib::RandomSequencer< GEN >

Access point to a selection of random number sources.

For each kind of performance or usage, a common execution scheme is established to initiate generated number sequences, allowing for seemingly random yet reproducible behaviour — or for actually contingent behaviour when necessary. Client code should rely on Dependency-Injection or the static accessors.

Definition at line 64 of file random.hpp.

Public Member Functions

 RandomSequencer (SeedNucleus &)
 Build new generator, drawing seed from a virtual seed source.
 
template<class G >
 RandomSequencer (RandomSequencer< G > &)
 Build new generator, drawing a seed from given parent generator.
 
template<class DIST >
auto distribute (DIST)
 generic adapter: draw next number to use the given distribution
 
HashVal hash ()
 non-zero hash value from full 64bit range
 
int i (uint bound=_iBOUND())
 drop-in replacement for rand() % bound More...
 
int i32 ()
 random number from full integer range (incl. negative values)
 
double normal (double mean=0.0, double stdev=1.0)
 normal distribution (gaussian)
 
double range (double start, double bound)
 random double from designated interval (upper bound excluded)
 
void reseed (SeedNucleus &)
 inject controlled randomisation
 
uint64_t u64 ()
 random 64bit number from full range.
 
double uni ()
 random double drawn from interval [0.0 ... 1.0[
 

Classes

class  Seed
 

Private Attributes

GEN generator_
 

Member Function Documentation

◆ i()

int i ( uint  bound = _iBOUND())
inline

drop-in replacement for rand() % bound

Parameters
boundupper bound (exclusive!)

Definition at line 205 of file random.hpp.

+ Inheritance diagram for RandomSequencer< GEN >:
+ Collaboration diagram for RandomSequencer< GEN >:

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