|
libvisual
0.5.0
|
Pseudorandom number generator class. More...
#include <libvisual/lv_random.h>
Public Types | |
| typedef RandomSeed | Seed |
Public Member Functions | |
| RandomContext (Seed seed) | |
| Creates a new RandomContext with a given seed. More... | |
| RandomContext (RandomContext const &)=delete | |
| RandomContext (RandomContext &&rhs) | |
| Move constructor. | |
| ~RandomContext () | |
| Destructor. | |
| RandomContext & | operator= (RandomContext const &)=delete |
| RandomContext & | operator= (RandomContext &&rhs) |
| void | set_seed (uint32_t seed) |
| Sets the seed. More... | |
| uint32_t | get_int () |
| Returns a random integer. More... | |
| uint32_t | get_int (unsigned int min, unsigned int max) |
| Returns a random integer in a given range. More... | |
| double | get_double () |
| Returns a random double-precision floating point value between 0.0 and 1.0. More... | |
| float | get_float () |
| Returns a random single-precision floating point value between 0.0 and 1.0. More... | |
Pseudorandom number generator class.
Definition at line 48 of file lv_random.h.
|
explicit |
Creates a new RandomContext with a given seed.
| seed | Initial seed for generating random number sequences |
Definition at line 41 of file lv_random.cpp.
| double LV::RandomContext::get_double | ( | ) |
Returns a random double-precision floating point value between 0.0 and 1.0.
Definition at line 90 of file lv_random.cpp.
| float LV::RandomContext::get_float | ( | ) |
Returns a random single-precision floating point value between 0.0 and 1.0.
Definition at line 112 of file lv_random.cpp.
Referenced by get_int().
| uint32_t LV::RandomContext::get_int | ( | ) |
Returns a random integer.
Definition at line 69 of file lv_random.cpp.
Referenced by get_int(), and LV::rand().
| uint32_t LV::RandomContext::get_int | ( | unsigned int | min, |
| unsigned int | max | ||
| ) |
Returns a random integer in a given range.
| min | Lower bound |
| max | Upper bound |
Definition at line 74 of file lv_random.cpp.
| void LV::RandomContext::set_seed | ( | uint32_t | seed | ) |
Sets the seed.
| seed | New seed |
Definition at line 64 of file lv_random.cpp.
Referenced by RandomContext(), and LV::System::set_rng_seed().