random.c File Reference
Random number generator - Definition. More...
Functions | |
void | vl_rand_init (VlRand *self) |
Initialise random number generator. More... | |
void | vl_rand_seed (VlRand *self, vl_uint32 s) |
Seed the state of the random number generator. More... | |
void | vl_rand_seed_by_array (VlRand *self, vl_uint32 const key [], vl_size keySize) |
Seed the state of the random number generator by an array. More... | |
void | vl_rand_permute_indexes (VlRand *self, vl_index *array, vl_size size) |
Randomly permute and array of indexes. More... | |
vl_uint32 | vl_rand_uint32 (VlRand *self) |
Generate a random UINT32. More... | |
Detailed Description
Function Documentation
◆ vl_rand_init()
void vl_rand_init | ( | VlRand * | self | ) |
- Parameters
-
self number generator.
◆ vl_rand_permute_indexes()
- Parameters
-
self random number generator. array array of indexes. size number of element in the array.
The function uses Algorithm P, also known as Knuth shuffle.
◆ vl_rand_seed()
◆ vl_rand_seed_by_array()
- Parameters
-
self random number generator. key array of numbers. keySize length of the array.