|
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... | |
| struct | a_rand_pcg32 |
| instance structure for the permuted congruential generator and 64-bit integer arithmetic More... | |
Typedefs | |
| typedef struct a_rand_lcg48 | a_rand_lcg48 |
| typedef struct a_rand_pcg32 | a_rand_pcg32 |
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_pcg32_init (a_rand_pcg32 *ctx, a_u64 x, a_u64 c) |
| initialize with initial value for the permuted congruential generator and 64-bit integer arithmetic. | |
| a_u32 | a_rand_pcg32u (a_rand_pcg32 *ctx) |
| generate an unsigned 32-bit random integer. | |
| a_u32 | a_rand_pcg32n (a_rand_pcg32 *ctx, a_u32 n) |
| generate an unsigned 32-bit random integer in [0,n). | |
| a_f64 | a_rand_pcg32f (a_rand_pcg32 *ctx) |
| generate a 64-bit floating-point random number in [0,1). | |
| void | a_rand_pcg32_shuf (a_rand_pcg32 *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. |
| void a_rand_pcg32_init | ( | a_rand_pcg32 * | ctx, |
| a_u64 | x, | ||
| a_u64 | c ) |
initialize with initial value for the permuted congruential generator and 64-bit integer arithmetic.
| [in,out] | ctx | points to an instance of the permuted congruential generator and 64-bit integer arithmetic |
| [in] | x | is the state initializer |
| [in] | c | is the sequence selector |
| void a_rand_pcg32_shuf | ( | a_rand_pcg32 * | 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 permuted congruential generator and 64-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_pcg32f | ( | a_rand_pcg32 * | ctx | ) |
generate a 64-bit floating-point random number in [0,1).
| [in,out] | ctx | points to an instance of the permuted congruential generator and 64-bit integer arithmetic |
| a_u32 a_rand_pcg32n | ( | a_rand_pcg32 * | ctx, |
| a_u32 | n ) |
generate an unsigned 32-bit random integer in [0,n).
| [in,out] | ctx | points to an instance of the permuted congruential generator and 64-bit integer arithmetic |
| [in] | n | is the upper bound (exclusive) |
| a_u32 a_rand_pcg32u | ( | a_rand_pcg32 * | ctx | ) |
generate an unsigned 32-bit random integer.
| [in,out] | ctx | points to an instance of the permuted congruential generator and 64-bit integer arithmetic |