Function rgsl::types::rng::unix::random_glic2

source ·
pub fn random_glic2() -> RngType
Expand description

These generators implement the random family of functions, a set of linear feedback shift register generators originally used in BSD Unix. There are several versions of random in use today: the original BSD version (e.g. on SunOS4), a libc5 version (found on older GNU/Linux systems) and a glibc2 version. Each version uses a different seeding procedure, and thus produces different sequences.

The original BSD routines accepted a variable length buffer for the generator state, with longer buffers providing higher-quality randomness. The random function implemented algorithms for buffer lengths of 8, 32, 64, 128 and 256 bytes, and the algorithm with the largest length that would fit into the user-supplied buffer was used. To support these algorithms additional generators are available with the following names,

  • gsl_rng_random8_bsd
  • gsl_rng_random32_bsd
  • gsl_rng_random64_bsd
  • gsl_rng_random128_bsd
  • gsl_rng_random256_bsd

where the numeric suffix indicates the buffer length. The original BSD random function used a 128-byte default buffer and so gsl_rng_random_bsd has been made equivalent to gsl_rng_random128_bsd. Corresponding versions of the libc5 and glibc2 generators are also available, with the names gsl_rng_random8_libc5, gsl_rng_random8_glibc2, etc.