A handy class to return random numbers. More...
#include "randomizer.h"
Public Member Functions | |
Randomizer (unsigned long seed=0) | |
If seed is nonzero, it is used to define the tables; if it is zero a random seed is generated. More... | |
Randomizer (const Randomizer ©) | |
unsigned long | get_seed () |
Returns a unique seed value based on the seed value passed to this Randomizer object (and on its current state). More... | |
void | operator= (const Randomizer ©) |
int | random_int (int range) |
Returns a random integer in the range [0, range). More... | |
double | random_real (double range) |
Returns a random double in the range [0, range). More... | |
double | random_real_unit () |
Returns a random double in the range [-0.5, 0.5). More... | |
Static Public Member Functions | |
static unsigned long | get_next_seed () |
Returns a random seed value for the next global Randomizer object. More... | |
A handy class to return random numbers.
Definition at line 26 of file randomizer.h.
|
inlineexplicit |
If seed is nonzero, it is used to define the tables; if it is zero a random seed is generated.
Definition at line 19 of file randomizer.I.
|
inlinestatic |
Returns a random seed value for the next global Randomizer object.
Definition at line 69 of file randomizer.I.
|
inline |
Returns a unique seed value based on the seed value passed to this Randomizer object (and on its current state).
Definition at line 82 of file randomizer.I.
Referenced by PerlinNoise::get_seed().
|
inline |
Returns a random integer in the range [0, range).
Definition at line 45 of file randomizer.I.
References random_real().
|
inline |
Returns a random double in the range [0, range).
Definition at line 53 of file randomizer.I.
Referenced by random_int(), and random_real_unit().
|
inline |
Returns a random double in the range [-0.5, 0.5).
Definition at line 61 of file randomizer.I.
References random_real().