Shuffling algorithm.
More...
|
static void | cal_shuffle (void *array, size_t count, size_t size, void *buffer, size_t(*randfunc)(void *, size_t), void *randfunc_ctx) |
| Shuffles elements in an array. More...
|
|
static void cal_shuffle |
( |
void * |
array, |
|
|
size_t |
count, |
|
|
size_t |
size, |
|
|
void * |
buffer, |
|
|
size_t(*)(void *, size_t) |
randfunc, |
|
|
void * |
randfunc_ctx |
|
) |
| |
|
inlinestatic |
Shuffles elements in an array.
- Parameters
-
array | A pointer to an array of elements. |
count | The number of elements in array . |
size | The size of each element in bytes. |
buffer | A pointer to a temporary writable buffer capable of holding at least size bytes. It must not alias array . |
randfunc | A function that generates a nonnegative random value less than or equal to its second argument. |
randfunc_ctx | An arbitrary value passed as the first argument to random . |