Function rsl::rng

Function Documentation

RSL_EXPORT auto rsl::rng(std::seed_seq seed_sequence = {}) -> std::mt19937&

Get a random number generator.

The first time this function is called it creates a thread_local random number generator. If a seed sequence is provided on that first call it is used to create the generator, otherwise the random device is used to seed the generator. After the first call to this function, if a seed sequence is provided this function throws. The returned value is a reference to a thread_local static generator.

Parameters:

seed_sequence – Seed sequence for random number generator

Returns:

Seeded random number generator