From http://burtleburtle.net/bob/rand/smallprng.html, a not awful fast random number source.
More...
#include "small_prng.hpp"
|
| using | value_type = uint32_t |
| | The type produced by the small prng.
|
| |
|
| | small_prng (uint32_t seed=0xdeadbeef) noexcept |
| | Construct an instance with seed
|
| |
| uint32_t | operator() () noexcept |
| | Return value_type of pseudo-randomness.
|
| |
|
| static uint32_t | rot (uint32_t x, uint32_t k) noexcept |
| |
|
| uint32_t | a |
| |
| uint32_t | b |
| |
| uint32_t | c |
| |
| uint32_t | d |
| |
◆ value_type
The type produced by the small prng.
◆ small_prng()
| quickcpplib::_xxx::algorithm::small_prng::small_prng::small_prng |
( |
uint32_t |
seed = 0xdeadbeef | ) |
|
|
inlineexplicitnoexcept |
Construct an instance with seed
58 {
61 for(size_t i = 0; i < 20; ++i)
62 (*this)();
63 }
uint32_t d
Definition small_prng.hpp:49
uint32_t a
Definition small_prng.hpp:46
uint32_t c
Definition small_prng.hpp:48
uint32_t b
Definition small_prng.hpp:47
◆ rot()
| static uint32_t quickcpplib::_xxx::algorithm::small_prng::small_prng::rot |
( |
uint32_t |
x, |
|
|
uint32_t |
k |
|
) |
| |
|
inlinestaticprotectednoexcept |
51{ return (((x) << (k)) | ((x) >> (32 - (k)))); }
◆ operator()()
| uint32_t quickcpplib::_xxx::algorithm::small_prng::small_prng::operator() |
( |
| ) |
|
|
inlinenoexcept |
Return value_type of pseudo-randomness.
67 {
68 uint32_t e =
a -
rot(
b, 27);
74 }
static uint32_t rot(uint32_t x, uint32_t k) noexcept
Definition small_prng.hpp:51
| uint32_t quickcpplib::_xxx::algorithm::small_prng::small_prng::a |
|
protected |
| uint32_t quickcpplib::_xxx::algorithm::small_prng::small_prng::b |
|
protected |
| uint32_t quickcpplib::_xxx::algorithm::small_prng::small_prng::c |
|
protected |
| uint32_t quickcpplib::_xxx::algorithm::small_prng::small_prng::d |
|
protected |
The documentation for this class was generated from the following file: