liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
a_rand_lcg48 Struct Reference

instance structure for the linear congruential generator and 48-bit integer arithmetic More...

#include <rand.h>

Public Member Functions

void init (a_i64 x_)
 initialize with a seed value for the linear congruential generator and 48-bit integer arithmetic.
void seed (a_u16 const x_[3]=NULL)
 initialize with a specific state for the linear congruential generator and 48-bit integer arithmetic.
a_u64 next (a_u16 x_[3])
 perform one iteration for the linear congruential generator and 48-bit integer arithmetic.
a_i32 i (a_u16 x_[3]=NULL)
 generate a signed 32-bit random integer.
a_u32 u (a_u16 x_[3]=NULL)
 generate an unsigned 32-bit random integer.
a_f64 f (a_u16 x_[3]=NULL)
 generate a 64-bit floating-point random number in [0,1).
void shuf (void *ptr, a_size num, a_size siz)
 shuffle the elements of an array in place using the Fisher-Yates (Knuth) shuffle algorithm.

Data Fields

a_u64 a
a_u16 c
a_u16 x [3]

Detailed Description

instance structure for the linear congruential generator and 48-bit integer arithmetic

Member Function Documentation

◆ f()

a_f64 a_rand_lcg48::f ( a_u16 x_[3] = NULL)
inline

generate a 64-bit floating-point random number in [0,1).

See also
a_rand_lcg48f
a_rand_lcg48f_

◆ i()

a_i32 a_rand_lcg48::i ( a_u16 x_[3] = NULL)
inline

generate a signed 32-bit random integer.

See also
a_rand_lcg48i
a_rand_lcg48i_

◆ init()

void a_rand_lcg48::init ( a_i64 x_)
inline

initialize with a seed value for the linear congruential generator and 48-bit integer arithmetic.

See also
a_rand_lcg48_init

◆ next()

a_u64 a_rand_lcg48::next ( a_u16 x_[3])
inline

perform one iteration for the linear congruential generator and 48-bit integer arithmetic.

See also
a_rand_lcg48_next

◆ seed()

void a_rand_lcg48::seed ( a_u16 const x_[3] = NULL)
inline

initialize with a specific state for the linear congruential generator and 48-bit integer arithmetic.

See also
a_rand_lcg48_seed

◆ shuf()

void a_rand_lcg48::shuf ( void * ptr,
a_size num,
a_size siz )
inline

shuffle the elements of an array in place using the Fisher-Yates (Knuth) shuffle algorithm.

See also
a_rand_lcg48_shuf

◆ u()

a_u32 a_rand_lcg48::u ( a_u16 x_[3] = NULL)
inline

generate an unsigned 32-bit random integer.

See also
a_rand_lcg48u
a_rand_lcg48u_

Field Documentation

◆ a

a_u64 a_rand_lcg48::a

multiplier term

◆ c

a_u16 a_rand_lcg48::c

increment term

◆ x

a_u16 a_rand_lcg48::x[3]

random value


The documentation for this struct was generated from the following file: