Random123-0.2.0: Haskell port of Random123 library

Safe HaskellNone
LanguageHaskell98

System.Random.Random123.RandomGen

Description

Integration with the standard library RandomGen class.

Synopsis

Documentation

mkCustomCBRNG32 :: LimitedInteger c => (k -> c -> c) -> k -> CustomCBRNG32 k c Source

Creates a custom 32-bit RNG from a keyed bijection (Word32- or Word64-parametrized version of philox2, philox2R, philox4, philox4R, threefry2, threefry2R, threefry4, threefry4R) and a corresponding key.

mkCustomCBRNG64 :: LimitedInteger c => (k -> c -> c) -> k -> CustomCBRNG64 k c Source

Creates a custom 64-bit RNG from a keyed bijection (Word32- or Word64-parametrized version of philox2, philox2R, philox4, philox4R, threefry2, threefry2R, threefry4, threefry4R) and a corresponding key.

restoreCustomCBRNG32 :: (LimitedInteger k, LimitedInteger c) => (k -> c -> c) -> CBRNGState -> CustomCBRNG32 k c Source

Restores a custom 32-bit RNG from a saved state.

restoreCustomCBRNG64 :: (LimitedInteger k, LimitedInteger c) => (k -> c -> c) -> CBRNGState -> CustomCBRNG64 k c Source

Restores a custom 64-bit RNG from a saved state.

mkCBRNG32 :: Integer -> CBRNG32 Source

Creates a default 32-bit RNG (based on 32-bit philox4) with an Integer key.

mkCBRNG64 :: Integer -> CBRNG64 Source

Creates a default 64-bit RNG (based on 64-bit philox4) with an Integer key.

restoreCBRNG32 :: CBRNGState -> CBRNG32 Source

Restores a default 32-bit RNG from a saved state.

restoreCBRNG64 :: CBRNGState -> CBRNG64 Source

Restores a default 64-bit RNG from a saved state.

data CBRNG32 Source

Default 32-bit RNG. Supports serialization through Show / Read interface. Alternatively, can be serialized with getState and restored with restoreCBRNG32.

data CBRNG64 Source

Default 64-bit RNG. Supports serialization through Show / Read interface. Alternatively, can be serialized with getState and restored with restoreCBRNG64.

data CustomCBRNG32 k c Source

32-bit RNG with a custom bijection function. Can be serialized with getState and restored with restoreCustomCBRNG32 (but it is the user's responsibility to provide the original bijection).

data CustomCBRNG64 k c Source

64-bit RNG with a custom bijection function. Can be serialized with getState and restored with restoreCustomCBRNG32 (but it is the user's responsibility to provide the original bijection).

data CBRNGState Source

Generalized CBRNG state, consisting of key, counter and subcounter, where the first two are cast to integers (using liToInteger).