Copyright | Copyright (c) 2009 Tracy Wadleigh |
---|---|
License | BSD3 |
Maintainer | Patrick Perry <patperry@stanford.edu> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell98 |
Quasi-random number generators.
- newtype QRNG = MkQRNG (ForeignPtr QRNG)
- data QRNGType
- newQRNG :: QRNGType -> Int -> IO QRNG
- resetQRNG :: QRNG -> IO ()
- getSample :: QRNG -> Ptr Double -> IO ()
- getListSample :: QRNG -> IO [Double]
- getName :: QRNG -> IO String
- getDimension :: QRNG -> IO Int
- getSize :: QRNG -> IO Word64
- getState :: QRNG -> IO [Word8]
- setState :: QRNG -> [Word8] -> IO ()
- copyQRNG :: QRNG -> QRNG -> IO ()
- cloneQRNG :: QRNG -> IO QRNG
- niederreiter :: QRNGType
- sobol :: QRNGType
- halton :: QRNGType
- reverseHalton :: QRNGType
- maxDimension :: QRNGType -> Int
Data types
Initializing
newQRNG :: QRNGType -> Int -> IO QRNG Source #
Allocate a new quasi-random number generator of the given type, generating points with the given number of dimensions.
Sampling
getSample :: QRNG -> Ptr Double -> IO () Source #
Stores the next point from the generator in the given buffer. The space available in the buffer must match the dimension of the generator. The components of the sample will each lie in the range (0,1).
Auxiliary functions
setState :: QRNG -> [Word8] -> IO () Source #
Set the generator state. The input array should have size equal to
getSize
of the generator; otherwise, strange things will happen.
Copying state
copyQRNG :: QRNG -> QRNG -> IO () Source #
copyQRNG dst src
copies the state from one generator to another. The
two generators must have the same type.
cloneQRNG :: QRNG -> IO QRNG Source #
Allocate a new quasi-random number generator that is exact copy of another generator.
Algorithms
maxDimension :: QRNGType -> Int Source #
The maximum dimension of samples that the given generator supports.