random.c File Reference
Random number generator - Definition. More...
Functions | |
void | vl_rand_init (VlRand *self) |
Initialise random number generator. | |
void | vl_rand_seed (VlRand *self, vl_uint32 s) |
Seed the state of the random number generator. | |
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. | |
void | vl_rand_permute_indexes (VlRand *self, vl_index *array, vl_size size) |
Randomly permute and array of indexes. | |
vl_uint32 | vl_rand_uint32 (VlRand *self) |
Generate a random UINT32. |
Detailed Description
Function Documentation
void vl_rand_init | ( | VlRand * | self | ) |
- Parameters:
-
self number generator.
- 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.
- Parameters:
-
self random number generator. key array of numbers. keySize length of the array.