mersenne-random-pure64-0.2.2.0: Generate high quality pseudorandom numbers purely using a Mersenne Twister

CopyrightCopyright (c) 2008, Bertram Felgenhauer <int-e@gmx.de>
LicenseBSD3
MaintainerDon Stewart <dons@galois.com>
Stabilityexperimental
PortabilityTested with: GHC 6.8.3
Safe HaskellNone
LanguageHaskell98

System.Random.Mersenne.Pure64.MTBlock

Contents

Description

A purely functional binding 64 bit binding to the classic mersenne twister random number generator. This is more flexible than the impure 'mersenne-random' library, at the cost of being a bit slower. This generator is however, many times faster than System.Random, and yields high quality randoms with a long period.

Synopsis

Block type

Block functions

seedBlock :: Word64 -> MTBlock Source #

create a new MT block, seeded with the given Word64 value

nextBlock :: MTBlock -> MTBlock Source #

step: create a new MTBlock buffer from the previous one

lookupBlock :: MTBlock -> Int -> Word64 Source #

look up an element of an MT block

Misc functions

blockLen :: Int Source #

length of an MT block

mixWord64 :: Word64 -> Word64 Source #

MT's word mix function.

(MT applies this function to each Word64 from the buffer before returning it)