Portability | CPP, FFI |
---|---|
Stability | experimental |
Maintainer | Don Stewart <dons@galois.com> |
Tested with: GHC 6.8.3
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.
This generator may be used with System.Random, however, that is likely to be slower than using it directly.
The random number generator
PureMT
, a pure mersenne twister pseudo-random number generator
Introduction
Create a new PureMT generator, using the clocktime as the base for the seed.
Being purely functional, the PureMT generator is an instance of
RandomGen. However, it doesn't support split
yet.
Low level access to the generator
randomWord :: PureMT -> (Word, PureMT)Source
randomInt64 :: PureMT -> (Int64, PureMT)Source
randomWord64 :: PureMT -> (Word64, PureMT)Source