![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "lib/random.hpp"
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.
Classes | |
| class | Seed |
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. | |
| int | i (uint bound=_iBOUND()) |
drop-in replacement for rand() % bound | |
| int | i32 () |
| random number from full integer range (incl. negative values) | |
| uint64_t | u64 () |
| random 64bit number from full range. | |
| double | uni () |
random double drawn from interval [0.0 ... 1.0[ | |
| double | range (double start, double bound) |
| random double from designated interval (upper bound excluded) | |
| double | normal (double mean=0.0, double stdev=1.0) |
| normal distribution (gaussian) | |
| HashVal | hash () |
| non-zero hash value from full 64bit range | |
| template<class DIST > | |
| auto | distribute (DIST) |
| generic adapter: draw next number to use the given distribution | |
| void | reseed (SeedNucleus &) |
| inject controlled randomisation | |
Private Attributes | |
| GEN | generator_ |
|
inline |
Build new generator, drawing seed from a virtual seed source.
Definition at line 174 of file random.hpp.
Build new generator, drawing a seed from given parent generator.
Definition at line 181 of file random.hpp.
|
inline |
drop-in replacement for rand() % bound
| bound | upper bound (exclusive!) |
Definition at line 205 of file random.hpp.
Referenced by CallQueue_test::Worker::Worker(), and lib::rani().
Here is the caller graph for this function:
|
inline |
random number from full integer range (incl. negative values)
Definition at line 216 of file random.hpp.
Referenced by Random_test::verify_reproducibleSequence().
Here is the caller graph for this function:
|
inline |
random 64bit number from full range.
Definition at line 224 of file random.hpp.
Referenced by TempDir::establishNewDirectory(), TempDir::establishNewFile(), RandomSequencer< GEN >::Seed::getSeed(), SuiteSeedNucleus::getSeed(), NodeDevel_test::processing_combineFrames(), NodeDevel_test::processing_duplicateMultichan(), NodeDevel_test::processing_generateFrame(), NodeDevel_test::processing_generateMultichan(), NodeDevel_test::processing_manipulateFrame(), NodeDevel_test::processing_manipulateMultichan(), OutputProxyProvider_test::run(), NodeDevel_test::testRand_buildFilterNode(), NodeDevel_test::testRand_buildMixNode(), and NodeDevel_test::testRand_simpleUsage().
Here is the caller graph for this function:
|
inline |
random double drawn from interval [0.0 ... 1.0[
Definition at line 232 of file random.hpp.
Referenced by LimitedRandomGenerate< max >::defaultSrc(), RandomConcurrent_test::investigate_concurrentAccess(), ParameterRange< CONF >::perform(), NodeDevel_test::processing_combineFrames(), NodeDevel_test::testRand_buildMixNode(), and NodeBase_test::verify_TurnoutSystem().
Here is the caller graph for this function:
|
inline |
random double from designated interval (upper bound excluded)
Definition at line 239 of file random.hpp.
Referenced by lib::ranRange().
Here is the caller graph for this function:
|
inline |
normal distribution (gaussian)
Definition at line 246 of file random.hpp.
Referenced by lib::ranNormal().
Here is the caller graph for this function:
|
inline |
non-zero hash value from full 64bit range
Definition at line 253 of file random.hpp.
Referenced by lib::ranHash(), and steam::engine::test::anonymous_namespace{testframe.cpp}::stampHeader().
Here is the caller graph for this function:
|
inline |
generic adapter: draw next number to use the given distribution
Definition at line 197 of file random.hpp.
Referenced by steam::engine::test::anonymous_namespace{testframe.cpp}::drawSeed().
Here is the caller graph for this function:
|
inline |
inject controlled randomisation
Definition at line 188 of file random.hpp.
References SeedNucleus::getSeed().
Referenced by lib::randomiseRandomness(), and Test::seedRand().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 66 of file random.hpp.
Inheritance diagram for RandomSequencer< GEN >:
Collaboration diagram for RandomSequencer< GEN >: