Definition at line 51 of file MCL.cpp.
◆ XorShift32()
| MCL::XorShift32::XorShift32 |
( |
uint32_t | seed = pros::micros() | ) |
|
|
inlineexplicit |
Definition at line 53 of file MCL.cpp.
54 :
state(seed == 0 ? 0x12345678u : seed) {}
References state.
◆ gaussian()
| float MCL::XorShift32::gaussian |
( |
float | std_dev | ) |
|
|
inline |
Definition at line 62 of file MCL.cpp.
62 {
63 const float u1 = std::max(
next_f32(), 1e-12f);
65 return std_dev * std::sqrt(-2.0f * std::log(u1))
66 * std::cos(2.0f * (float)M_PI * u2);
67 }
References next_f32().
◆ next_f32()
| float MCL::XorShift32::next_f32 |
( |
| ) |
|
|
inline |
◆ next_u32()
| uint32_t MCL::XorShift32::next_u32 |
( |
| ) |
|
|
inline |
Definition at line 55 of file MCL.cpp.
55 {
57 x ^= x << 13; x ^= x >> 17; x ^= x << 5;
59 }
References state.
Referenced by next_f32().
◆ uniform()
| float MCL::XorShift32::uniform |
( |
float | lo, |
|
|
float | hi ) |
|
inline |
◆ state
| uint32_t MCL::XorShift32::state |
The documentation for this struct was generated from the following file: