uncomplicate.neanderthal.random

Polymorphic functions that populate Neanderthal’s data structures with random numbers drawn from common distributions.

rng-state, rand-normal!, rand-uniform!

rand-normal!

(rand-normal! x)(rand-normal! mu sigma x)(rand-normal! rng-state x)(rand-normal! rng-state mu sigma x)

Populates vector x with normally distributed random numbers. The distribution is controlled by arguments mu and sigma. If rng-state is not provided, uses the global default rng state.

rand-uniform!

(rand-uniform! x)(rand-uniform! lower upper x)(rand-uniform! rng-state x)(rand-uniform! rng-state lower upper x)

Populates vector x with uniformly distributed random numbers. The distribution is controlled by arguments lower and upper. If rng-state is not provided, uses the engine’s global default rng state.

rng-state

(rng-state fact seed)(rng-state fact)

Creates a random number generator state compatible with a factory. Optionally accepts the seed for reproducibility.