Class for generating random numbers.
More...
|
| | rand_gen (unsigned int seed=get_location_id()) |
| |
|
size_t | rand (void) |
| | Generates a random number in the range [0, numeric_limits<size_t>::max()).
|
| |
| size_t | rand (size_t max) |
| | Generates a random number in the range [0, max). More...
|
| |
| size_t | rand (size_t min, size_t max) |
| | Generates a random number in the range [min, max). More...
|
| |
|
|
typedef boost::random::uniform_int_distribution< size_t > | rng_dist_t |
| |
|
|
boost::random::mt19937 | m_rng |
| |
Class for generating random numbers.
Generators that need to produce random numbers in a thread-safe way should inherit from this class and call this->rand(...) to get random numbers.
◆ rand_gen()
| stapl::generators::rand_gen::rand_gen |
( |
unsigned int |
seed = get_location_id() | ) |
|
- Parameters
-
| seed | The seed for random-number generation. |
◆ rand() [1/2]
| size_t stapl::generators::rand_gen::rand |
( |
size_t |
max | ) |
|
Generates a random number in the range [0, max).
- Parameters
-
| max | The maximum value of the output random number (exclusive). |
◆ rand() [2/2]
| size_t stapl::generators::rand_gen::rand |
( |
size_t |
min, |
|
|
size_t |
max |
|
) |
| |
Generates a random number in the range [min, max).
- Parameters
-
| min | The minimum value of the output random number. |
| max | The maximum value of the output random number (exclusive). |
The documentation for this struct was generated from the following file: