![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
PCG32 pseudo-random generator (O'Neill, 2014). More...
#include <random.h>
Public Member Functions | |
| Rng (uint64_t seed, uint64_t stream=DEFAULT_STREAM) | |
| Seed with an explicit state and (optionally) stream selector. | |
| void | seed (uint64_t seed, uint64_t stream=DEFAULT_STREAM) |
| Re-seed in place, discarding the current sequence position. | |
| uint32_t | nextU32 () |
| Advance the state and return the next raw 32-bit value. | |
PCG32 pseudo-random generator (O'Neill, 2014).
Deterministic and seedable, so each owner can have its own reproducible stream.
|
inlineexplicit |
Seed with an explicit state and (optionally) stream selector.
| seed | Initial state; any value. |
| stream | Sequence selector; same seed, different stream is uncorrelated. |
|
inline |
Re-seed in place, discarding the current sequence position.
| seed | Initial state; any value. |
| stream | Sequence selector; see the constructor. |
|
inline |
Advance the state and return the next raw 32-bit value.
One LCG step, then PCG's xorshift-then-rotate output permutation.