|
liba 0.1.15
An algorithm library based on C/C++
|
Data Structures | |
| struct | a_rand_lcg48 |
| instance structure for the linear congruential generator and 48-bit integer arithmetic More... | |
Macros | |
| #define | A_RAND_LCG48_INIT {A_U64_C(0x5DEECE66D), A_U16_C(0xB), {A_U16_C(0x330E), A_U16_C(0xABCD), A_U16_C(0x1234)}} |
Typedefs | |
| typedef struct a_rand_lcg48 | a_rand_lcg48 |
Functions | |
| void | a_rand_lcg48_init (a_rand_lcg48 *ctx, a_i64 x) |
| initialize with a seed value for the linear congruential generator and 48-bit integer arithmetic. | |
| void | a_rand_lcg48_seed (a_rand_lcg48 *ctx, a_u16 const x[3]) |
| initialize with a specific state for the linear congruential generator and 48-bit integer arithmetic. | |
| a_u64 | a_rand_lcg48_next (a_rand_lcg48 *ctx, a_u16 x[3]) |
| perform one iteration for the linear congruential generator and 48-bit integer arithmetic. | |
| a_i32 | a_rand_lcg48i (a_rand_lcg48 *ctx) |
| generate a signed 32-bit random integer. | |
| a_i32 | a_rand_lcg48i_ (a_rand_lcg48 *ctx, a_u16 x[3]) |
| generate a signed 32-bit random integer. | |
| a_u32 | a_rand_lcg48u (a_rand_lcg48 *ctx) |
| generate an unsigned 32-bit random integer. | |
| a_u32 | a_rand_lcg48u_ (a_rand_lcg48 *ctx, a_u16 x[3]) |
| generate an unsigned 32-bit random integer. | |
| a_f64 | a_rand_lcg48f (a_rand_lcg48 *ctx) |
| generate a 64-bit floating-point random number in [0,1). | |
| a_f64 | a_rand_lcg48f_ (a_rand_lcg48 *ctx, a_u16 x[3]) |
| generate a 64-bit floating-point random number in [0,1). | |
| void | a_rand_lcg48_shuf (a_rand_lcg48 *ctx, void *ptr, a_size num, a_size siz) |
| shuffle the elements of an array in place using the Fisher-Yates (Knuth) shuffle algorithm. | |
| void a_rand_lcg48_init | ( | a_rand_lcg48 * | ctx, |
| a_i64 | x ) |
initialize with a seed value for the linear congruential generator and 48-bit integer arithmetic.
| [in,out] | ctx | points to an instance of the linear congruential generator and 48-bit integer arithmetic |
| [in] | x | is the seed value |
| a_u64 a_rand_lcg48_next | ( | a_rand_lcg48 * | ctx, |
| a_u16 | x[3] ) |
perform one iteration for the linear congruential generator and 48-bit integer arithmetic.
| [in,out] | ctx | points to an instance of the linear congruential generator and 48-bit integer arithmetic |
| [in,out] | x | points to the state array |
| void a_rand_lcg48_seed | ( | a_rand_lcg48 * | ctx, |
| a_u16 const | x[3] ) |
initialize with a specific state for the linear congruential generator and 48-bit integer arithmetic.
| [in,out] | ctx | points to an instance of the linear congruential generator and 48-bit integer arithmetic |
| [in] | x | is the specific state. If null, use the internal state. |
| void a_rand_lcg48_shuf | ( | a_rand_lcg48 * | ctx, |
| void * | ptr, | ||
| a_size | num, | ||
| a_size | siz ) |
shuffle the elements of an array in place using the Fisher-Yates (Knuth) shuffle algorithm.
| [in,out] | ctx | points to an instance of the linear congruential generator and 48-bit integer arithmetic |
| [in] | ptr | points to the elements in the array |
| [in] | num | number of the elements in the array |
| [in] | siz | size of each element in the array |
| a_f64 a_rand_lcg48f | ( | a_rand_lcg48 * | ctx | ) |
generate a 64-bit floating-point random number in [0,1).
| [in,out] | ctx | points to an instance of the linear congruential generator and 48-bit integer arithmetic |
| a_f64 a_rand_lcg48f_ | ( | a_rand_lcg48 * | ctx, |
| a_u16 | x[3] ) |
generate a 64-bit floating-point random number in [0,1).
| [in,out] | ctx | points to an instance of the linear congruential generator and 48-bit integer arithmetic |
| [in,out] | x | points to the state array. If null, use the internal state. |
| a_i32 a_rand_lcg48i | ( | a_rand_lcg48 * | ctx | ) |
generate a signed 32-bit random integer.
| [in,out] | ctx | points to an instance of the linear congruential generator and 48-bit integer arithmetic |
| a_i32 a_rand_lcg48i_ | ( | a_rand_lcg48 * | ctx, |
| a_u16 | x[3] ) |
generate a signed 32-bit random integer.
| [in,out] | ctx | points to an instance of the linear congruential generator and 48-bit integer arithmetic |
| [in,out] | x | points to the state array |
| a_u32 a_rand_lcg48u | ( | a_rand_lcg48 * | ctx | ) |
generate an unsigned 32-bit random integer.
| [in,out] | ctx | points to an instance of the linear congruential generator and 48-bit integer arithmetic |
| a_u32 a_rand_lcg48u_ | ( | a_rand_lcg48 * | ctx, |
| a_u16 | x[3] ) |
generate an unsigned 32-bit random integer.
| [in,out] | ctx | points to an instance of the linear congruential generator and 48-bit integer arithmetic |
| [in,out] | x | points to the state array. If null, use the internal state. |