Module

Test.StrongCheck.LCG

#Seed

newtype Seed

A seed for the linear congruential generator. We omit a Semiring instance because there is no zero value, as 0 is not an acceptable seed for the generator.

Instances

#mkSeed

#runSeed

#lcgM

lcgM :: Int

The multiplier: a magic constant for the linear congruential generator

#lcgC

lcgC :: Int

The increment: a magic constant for the linear congruential generator

#lcgN

lcgN :: Int

The modulus: a magic constant for the linear congruential generator. It is equal to 2^31 - 1, a Mersenne prime. It is useful for this value to be prime, because then the requirement of the initial seed being coprime to the modulus is satisfied when the seed is between 1 and lcgN - 1.

#lcgNext

lcgNext :: Seed -> Seed

Step the linear congruential generator

#lcgPerturb

lcgPerturb :: Number -> Seed -> Seed

Perturb a seed value

#randomSeed

randomSeed :: Effect Seed

Create a random seed

Modules