File rng-utils.hpp¶
FileList > epiworld > rng-utils.hpp
Go to the source code of this file
#include <cstdint>#include <limits>#include <random>#include "config.hpp"
Classes¶
| Type | Name |
|---|---|
| class | epi_xoshiro256ss Fast 64-bit PRNG based on the xoshiro256** algorithm. |
Public Functions¶
| Type | Name |
|---|---|
| epiworld_double | runif_epi (epi_xoshiro256ss & engine) Draw a uniform [0, 1) random number from an epi_xoshiro256ss engine. |
| epiworld_double | runif_mt19937 (std::mt19937 & engine) Draw a uniform [0, 1) random number from a std::mt19937 engine. |
Public Functions Documentation¶
function runif_epi¶
Draw a uniform [0, 1) random number from an epi_xoshiro256ss engine.
Uses the top N bits of the 64-bit output (where N = std::numeric_limits<epiworld_double>::digits) to produce a value in [0, 1) without any long-double arithmetic.
Parameters:
engineAn epi_xoshiro256ss engine.
Returns:
epiworld_double in [0, 1).
function runif_mt19937¶
Draw a uniform [0, 1) random number from a std::mt19937 engine.
Kept for backward compatibility with code that still holds a raw mt19937.
The documentation for this class was generated from the following file epiworld-src/include/epiworld/rng-utils.hpp