Safe Haskell | None |
---|---|
Language | Haskell98 |
Integration with the standard library RandomGen
class.
- mkCustomCBRNG32 :: LimitedInteger c => (k -> c -> c) -> k -> CustomCBRNG32 k c
- mkCustomCBRNG64 :: LimitedInteger c => (k -> c -> c) -> k -> CustomCBRNG64 k c
- restoreCustomCBRNG32 :: (LimitedInteger k, LimitedInteger c) => (k -> c -> c) -> CBRNGState -> CustomCBRNG32 k c
- restoreCustomCBRNG64 :: (LimitedInteger k, LimitedInteger c) => (k -> c -> c) -> CBRNGState -> CustomCBRNG64 k c
- mkCBRNG32 :: Integer -> CBRNG32
- mkCBRNG64 :: Integer -> CBRNG64
- restoreCBRNG32 :: CBRNGState -> CBRNG32
- restoreCBRNG64 :: CBRNGState -> CBRNG64
- data CBRNG32
- data CBRNG64
- data CustomCBRNG32 k c
- data CustomCBRNG64 k c
- data CBRNGState
- class SerializableCBRNG a where
- getState :: a -> CBRNGState
Documentation
mkCustomCBRNG32 :: LimitedInteger c => (k -> c -> c) -> k -> CustomCBRNG32 k c Source
mkCustomCBRNG64 :: LimitedInteger c => (k -> c -> c) -> k -> CustomCBRNG64 k c Source
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.
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.
Default 32-bit RNG.
Supports serialization through Show
/ Read
interface.
Alternatively, can be serialized with getState
and restored with restoreCBRNG32
.
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).
(Counter c, Word32Array c) => RandomGen (CustomCBRNG32 k c) | |
(LimitedInteger k, LimitedInteger c) => SerializableCBRNG (CustomCBRNG32 k c) |
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).
(Counter c, Word64Array c) => RandomGen (CustomCBRNG64 k c) | |
(LimitedInteger k, LimitedInteger c) => SerializableCBRNG (CustomCBRNG64 k c) |
data CBRNGState Source
Generalized CBRNG state, consisting of key, counter and subcounter,
where the first two are cast to integers (using liToInteger
).
class SerializableCBRNG a where Source
Class of RNGs allowing the state extraction.
getState :: a -> CBRNGState Source
SerializableCBRNG CBRNG64 | |
SerializableCBRNG CBRNG32 | |
(LimitedInteger k, LimitedInteger c) => SerializableCBRNG (CustomCBRNG64 k c) | |
(LimitedInteger k, LimitedInteger c) => SerializableCBRNG (CustomCBRNG32 k c) |