|
CDT++ 1.0.0-rc1
Causal Dynamical Triangulations in C++
|
A run-owned PCG engine with a recorded seed and stream identifier. More...
#include <Random.hpp>
Public Types | |
| using | result_type = pcg64::result_type |
Public Member Functions | |
| Random () | |
| Construct a root stream from operating-system entropy. | |
| Random (Random_seed const seed, Random_stream const stream=0) | |
| Construct a reproducible PCG stream without consulting entropy. | |
| auto | operator() () -> result_type |
| auto | seed () const noexcept -> Random_seed |
| auto | split (Random_stream const stream) const -> Random |
| Create a fresh reproducible stream from the same root seed. | |
| auto | stream () const noexcept -> Random_stream |
Static Public Member Functions | |
| static auto constexpr | max () noexcept -> result_type |
| static auto constexpr | min () noexcept -> result_type |
Static Private Member Functions | |
| static auto | entropy_seed () -> Random_seed |
Private Attributes | |
| pcg64 | m_engine |
| Random_seed | m_seed {} |
| Random_stream | m_stream {} |
A run-owned PCG engine with a recorded seed and stream identifier.
Construct one root engine per simulation. Pass engines by reference to distributions and stochastic algorithms instead of drawing fresh entropy for each sample. split() creates a reproducible, independently parameterized PCG stream for a subsystem or worker.
Random is intentionally not internally synchronized. A mutable instance belongs to one run or one thread. Parallel code must give each worker a distinct stream before drawing from it.
Definition at line 42 of file Random.hpp.
| using cdt::Random::result_type = pcg64::result_type |
Definition at line 45 of file Random.hpp.
|
inline |
Construct a root stream from operating-system entropy.
Definition at line 63 of file Random.hpp.
References Random().
|
inlineexplicit |
Construct a reproducible PCG stream without consulting entropy.
| seed | Root seed recorded for the run. |
| stream | PCG stream selector; distinct values select distinct sequences for the same root seed. |
Definition at line 69 of file Random.hpp.
|
inlinestaticnodiscardprivate |
Definition at line 52 of file Random.hpp.
|
inlinestaticnodiscardconstexprnoexcept |
Definition at line 76 of file Random.hpp.
|
inlinestaticnodiscardconstexprnoexcept |
Definition at line 73 of file Random.hpp.
|
inlinenodiscard |
Definition at line 79 of file Random.hpp.
|
inlinenodiscardnoexcept |
Definition at line 82 of file Random.hpp.
Referenced by Random().
|
inlinenodiscard |
Create a fresh reproducible stream from the same root seed.
Definition at line 89 of file Random.hpp.
References Random(), and stream().
Referenced by main().
|
inlinenodiscardnoexcept |
Definition at line 85 of file Random.hpp.
|
private |
Definition at line 50 of file Random.hpp.
|
private |
Definition at line 48 of file Random.hpp.
|
private |
Definition at line 49 of file Random.hpp.