repa-algorithms-2.0.0.3: Algorithms using the Repa array library.

Data.Array.Repa.Algorithms.Randomish

Synopsis

Documentation

Arguments

 :: Shape sh => sh Shape of array -> Int Minumum value in output. -> Int Maximum value in output. -> Int Random seed. -> Array sh Int Array of randomish numbers.

Use the ''minimal standard'' Lehmer generator to quickly generate some random numbers with reasonable statistical properties. By ''reasonable'' we mean good enough for games and test data, but not cryptography or anything where the quality of the randomness really matters.

By nature of the algorithm, the maximum value in the output is clipped to (valMin + 2^31 - 1)

From ''Random Number Generators: Good ones are hard to find'' Stephen K. Park and Keith W. Miller. Communications of the ACM, Oct 1988, Volume 31, Number 10.

Arguments

 :: Int Length of vector. -> Int Minumum value in output. -> Int Maximum value in output. -> Int Random seed. -> Vector Int Vector of randomish numbers.

Arguments

 :: Shape sh => sh Shape of array -> Double Minumum value in output. -> Double Maximum value in output. -> Int Random seed. -> Array sh Double Array of randomish numbers.

Generate some randomish doubles with terrible statistical properties. This just takes randomish ints then scales them, so there's not much randomness in low-order bits.

Arguments

 :: Int Length of vector -> Double Minimum value in output -> Double Maximum value in output -> Int Random seed. -> Vector Double Vector of randomish doubles.

Generate some randomish doubles with terrible statistical properties. This just takes randmish ints then scales them, so there's not much randomness in low-order bits.