|
C(++)ECCO
C++ Error Control COding: a header-only library for ECC simulations and experiments, modeling complete coding systems across arbitrary finite fields and complex inter-field relationships - Christian Senger <senger@inue.uni-stuttgart.de>
|
Thread-local random number generator with shared seeding policy. More...
#include <helpers.hpp>
Static Public Member Functions | |
| static std::mt19937 & | get () |
| Get thread-local random number generator. | |
| static void | seed (uint32_t seed) |
| Set deterministic seed for all threads. | |
| static void | use_hardware_seed () |
| Enable hardware-based random seeding. | |
Thread-local random number generator with shared seeding policy.
Provides one std::mt19937 engine per thread. seed() selects deterministic seeding; use_hardware_seed() returns to seeding from std::random_device. A seed change is observed on the next call to get in each thread.
Definition at line 56 of file helpers.hpp.
|
inlinestatic |
Get thread-local random number generator.
Initializes the engine on first access. If the global seed generation changed since the previous access in this thread, reseeds before returning.
Definition at line 65 of file helpers.hpp.

|
inlinestatic |
Set deterministic seed for all threads.
| seed | Base seed value (combined with a per-thread registration index) |
Selects deterministic seeding. Each thread derives its seed from seed and an index assigned on the thread's first use of the generator; the first thread (index 0) uses seed unchanged. Single-threaded runs are therefore fully reproducible. In multithreaded runs the set of streams is fixed, but their assignment to threads follows first-use order, which scheduling may permute across runs.
Definition at line 81 of file helpers.hpp.
|
inlinestatic |
Enable hardware-based random seeding.
Selects seeding from std::random_device.
Definition at line 92 of file helpers.hpp.