Shuffle preprocessor metaprogram.
More...
#include "host.h"
#include "random.h"
#include <assert.h>
- Author
- Andrea Vedaldi
- Todo:
- large array compatibility.
◆ VL_SHUFFLE_array [1/2]
Data type of the shuffle container
◆ VL_SHUFFLE_array [2/2]
#define VL_SHUFFLE_array ShuffleType* |
Data type of the shuffle container
◆ VL_SHUFFLE_prefix
#define VL_SHUFFLE_prefix ShufflePrefix |
Prefix of the shuffle functions
◆ VL_SHUFFLE_type
#define VL_SHUFFLE_type ShuffleType |
Data type of the shuffle elements
◆ VL_SHUFFLE_shuffle()
- Parameters
-
array | (in/out) pointer to the array. |
size | size of the array. |
rand | random number generator to use. |
The function randomly permutes the array.
◆ VL_SHUFFLE_swap()
- Parameters
-
array | shuffle array. |
indexA | index of the first element to swap. |
indexB | index of the second element to swap. |
The function swaps the two elements a and @ b. The function uses a temporary element of type VL_SHUFFLE_type and the copy operator =
.