#include <random.h>
◆ rand_state() [1/2]
VW::rand_state::rand_state |
( |
| ) |
|
|
default |
◆ rand_state() [2/2]
VW::rand_state::rand_state |
( |
uint64_t |
initial | ) |
|
|
inline |
Construct a new rand state object with the given seed.
- Parameters
-
◆ get_and_update_gaussian()
float VW::rand_state::get_and_update_gaussian |
( |
| ) |
|
|
inline |
Generate a random number from the gaussian distribution using the Box-Muller transform.
- Returns
- float number sampled from gaussian distribution
◆ get_and_update_random()
float VW::rand_state::get_and_update_random |
( |
| ) |
|
|
inline |
Get the next random value in the range [0,1] and update the PRG state.
- Returns
- float random number in range [0,1]
◆ get_current_state()
constexpr uint64_t VW::rand_state::get_current_state |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the current random state.
- Returns
- uint64_t state value of PRG
◆ get_random()
float VW::rand_state::get_random |
( |
| ) |
const |
|
inline |
Get the next random value in the range [0,1], but do not update the PRG state. This means that if this is called successively, the same value will be returned.
- Returns
- float
◆ set_random_state()
void VW::rand_state::set_random_state |
( |
uint64_t |
new_state | ) |
|
|
inlinenoexcept |
Override the current PRG state value.
- Parameters
-
The documentation for this class was generated from the following file:
- /nix/store/2saqbz278bj3pvhbfxlcc50cjbvs3h0h-source/vowpalwabbit/common/include/vw/common/random.h