module Bindings.Gsl.MonteCarloIntegration where
import Foreign.Ptr (Ptr,FunPtr,plusPtr)
import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr)
import Foreign.Storable
import Foreign.C.Types
import Foreign.C.String (CString,CStringLen,CWString,CWStringLen)
import Foreign.Marshal.Array (peekArray,pokeArray)
import Data.Int
import Data.Word
import Bindings.Gsl.RandomNumberGeneration
data C'gsl_monte_function = C'gsl_monte_function{
c'gsl_monte_function'f :: FunPtr (Ptr CDouble -> CSize -> Ptr () -> IO CDouble)
,
c'gsl_monte_function'dim :: CSize
,
c'gsl_monte_function'params :: Ptr ()
} deriving (Eq,Show)
instance Storable C'gsl_monte_function where
sizeOf _ = 12
alignment = sizeOf
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
v2 <- peekByteOff p 8
return $ C'gsl_monte_function v0 v1 v2
poke p (C'gsl_monte_function v0 v1 v2) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
pokeByteOff p 8 v2
return ()
foreign import ccall "inline_GSL_MONTE_FN_EVAL" c'GSL_MONTE_FN_EVAL
:: Ptr C'gsl_monte_function -> Ptr CDouble -> IO CDouble
data C'gsl_monte_plain_state = C'gsl_monte_plain_state{
c'gsl_monte_plain_state'dim :: CSize
,
c'gsl_monte_plain_state'x :: Ptr CDouble
} deriving (Eq,Show)
instance Storable C'gsl_monte_plain_state where
sizeOf _ = 8
alignment = sizeOf
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
return $ C'gsl_monte_plain_state v0 v1
poke p (C'gsl_monte_plain_state v0 v1) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
return ()
foreign import ccall "gsl_monte_plain_integrate" c'gsl_monte_plain_integrate
:: Ptr C'gsl_monte_function -> Ptr CDouble -> Ptr CDouble -> CSize -> CSize -> Ptr C'gsl_rng -> Ptr C'gsl_monte_plain_state -> Ptr CDouble -> Ptr CDouble -> IO CInt
foreign import ccall "&gsl_monte_plain_integrate" p'gsl_monte_plain_integrate
:: FunPtr (Ptr C'gsl_monte_function -> Ptr CDouble -> Ptr CDouble -> CSize -> CSize -> Ptr C'gsl_rng -> Ptr C'gsl_monte_plain_state -> Ptr CDouble -> Ptr CDouble -> IO CInt)
foreign import ccall "gsl_monte_plain_alloc" c'gsl_monte_plain_alloc
:: CSize -> IO (Ptr C'gsl_monte_plain_state)
foreign import ccall "&gsl_monte_plain_alloc" p'gsl_monte_plain_alloc
:: FunPtr (CSize -> IO (Ptr C'gsl_monte_plain_state))
foreign import ccall "gsl_monte_plain_init" c'gsl_monte_plain_init
:: Ptr C'gsl_monte_plain_state -> IO CInt
foreign import ccall "&gsl_monte_plain_init" p'gsl_monte_plain_init
:: FunPtr (Ptr C'gsl_monte_plain_state -> IO CInt)
foreign import ccall "gsl_monte_plain_free" c'gsl_monte_plain_free
:: Ptr C'gsl_monte_plain_state -> IO ()
foreign import ccall "&gsl_monte_plain_free" p'gsl_monte_plain_free
:: FunPtr (Ptr C'gsl_monte_plain_state -> IO ())
data C'gsl_monte_miser_state = C'gsl_monte_miser_state{
c'gsl_monte_miser_state'min_calls :: CSize
,
c'gsl_monte_miser_state'min_calls_per_bisection :: CSize
,
c'gsl_monte_miser_state'dither :: CDouble
,
c'gsl_monte_miser_state'estimate_frac :: CDouble
,
c'gsl_monte_miser_state'alpha :: CDouble
,
c'gsl_monte_miser_state'dim :: CSize
,
c'gsl_monte_miser_state'estimate_style :: CInt
,
c'gsl_monte_miser_state'depth :: CInt
,
c'gsl_monte_miser_state'verbose :: CInt
,
c'gsl_monte_miser_state'x :: Ptr CDouble
,
c'gsl_monte_miser_state'xmid :: Ptr CDouble
,
c'gsl_monte_miser_state'sigma_l :: Ptr CDouble
,
c'gsl_monte_miser_state'sigma_r :: Ptr CDouble
,
c'gsl_monte_miser_state'fmax_l :: Ptr CDouble
,
c'gsl_monte_miser_state'fmax_r :: Ptr CDouble
,
c'gsl_monte_miser_state'fmin_l :: Ptr CDouble
,
c'gsl_monte_miser_state'fmin_r :: Ptr CDouble
,
c'gsl_monte_miser_state'fsum_l :: Ptr CDouble
,
c'gsl_monte_miser_state'fsum_r :: Ptr CDouble
,
c'gsl_monte_miser_state'fsum2_l :: Ptr CDouble
,
c'gsl_monte_miser_state'fsum2_r :: Ptr CDouble
,
c'gsl_monte_miser_state'hits_l :: Ptr CSize
,
c'gsl_monte_miser_state'hits_r :: Ptr CSize
} deriving (Eq,Show)
instance Storable C'gsl_monte_miser_state where
sizeOf _ = 104
alignment = sizeOf
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
v2 <- peekByteOff p 8
v3 <- peekByteOff p 16
v4 <- peekByteOff p 24
v5 <- peekByteOff p 32
v6 <- peekByteOff p 36
v7 <- peekByteOff p 40
v8 <- peekByteOff p 44
v9 <- peekByteOff p 48
v10 <- peekByteOff p 52
v11 <- peekByteOff p 56
v12 <- peekByteOff p 60
v13 <- peekByteOff p 64
v14 <- peekByteOff p 68
v15 <- peekByteOff p 72
v16 <- peekByteOff p 76
v17 <- peekByteOff p 80
v18 <- peekByteOff p 84
v19 <- peekByteOff p 88
v20 <- peekByteOff p 92
v21 <- peekByteOff p 96
v22 <- peekByteOff p 100
return $ C'gsl_monte_miser_state v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22
poke p (C'gsl_monte_miser_state v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
pokeByteOff p 8 v2
pokeByteOff p 16 v3
pokeByteOff p 24 v4
pokeByteOff p 32 v5
pokeByteOff p 36 v6
pokeByteOff p 40 v7
pokeByteOff p 44 v8
pokeByteOff p 48 v9
pokeByteOff p 52 v10
pokeByteOff p 56 v11
pokeByteOff p 60 v12
pokeByteOff p 64 v13
pokeByteOff p 68 v14
pokeByteOff p 72 v15
pokeByteOff p 76 v16
pokeByteOff p 80 v17
pokeByteOff p 84 v18
pokeByteOff p 88 v19
pokeByteOff p 92 v20
pokeByteOff p 96 v21
pokeByteOff p 100 v22
return ()
foreign import ccall "gsl_monte_miser_integrate" c'gsl_monte_miser_integrate
:: Ptr C'gsl_monte_function -> Ptr CDouble -> Ptr CDouble -> CSize -> CSize -> Ptr C'gsl_rng -> Ptr C'gsl_monte_miser_state -> Ptr CDouble -> Ptr CDouble -> IO CInt
foreign import ccall "&gsl_monte_miser_integrate" p'gsl_monte_miser_integrate
:: FunPtr (Ptr C'gsl_monte_function -> Ptr CDouble -> Ptr CDouble -> CSize -> CSize -> Ptr C'gsl_rng -> Ptr C'gsl_monte_miser_state -> Ptr CDouble -> Ptr CDouble -> IO CInt)
foreign import ccall "gsl_monte_miser_alloc" c'gsl_monte_miser_alloc
:: CSize -> IO (Ptr C'gsl_monte_miser_state)
foreign import ccall "&gsl_monte_miser_alloc" p'gsl_monte_miser_alloc
:: FunPtr (CSize -> IO (Ptr C'gsl_monte_miser_state))
foreign import ccall "gsl_monte_miser_init" c'gsl_monte_miser_init
:: Ptr C'gsl_monte_miser_state -> IO CInt
foreign import ccall "&gsl_monte_miser_init" p'gsl_monte_miser_init
:: FunPtr (Ptr C'gsl_monte_miser_state -> IO CInt)
foreign import ccall "gsl_monte_miser_free" c'gsl_monte_miser_free
:: Ptr C'gsl_monte_miser_state -> IO ()
foreign import ccall "&gsl_monte_miser_free" p'gsl_monte_miser_free
:: FunPtr (Ptr C'gsl_monte_miser_state -> IO ())
c'GSL_VEGAS_MODE_IMPORTANCE = 1
c'GSL_VEGAS_MODE_IMPORTANCE :: (Num a) => a
c'GSL_VEGAS_MODE_IMPORTANCE_ONLY = 0
c'GSL_VEGAS_MODE_IMPORTANCE_ONLY :: (Num a) => a
c'GSL_VEGAS_MODE_STRATIFIED = 1
c'GSL_VEGAS_MODE_STRATIFIED :: (Num a) => a
data C'gsl_monte_vegas_state = C'gsl_monte_vegas_state{
c'gsl_monte_vegas_state'dim :: CSize
,
c'gsl_monte_vegas_state'bins_max :: CSize
,
c'gsl_monte_vegas_state'bins :: CUInt
,
c'gsl_monte_vegas_state'boxes :: CUInt
,
c'gsl_monte_vegas_state'xi :: Ptr CDouble
,
c'gsl_monte_vegas_state'xin :: Ptr CDouble
,
c'gsl_monte_vegas_state'delx :: Ptr CDouble
,
c'gsl_monte_vegas_state'weight :: Ptr CDouble
,
c'gsl_monte_vegas_state'vol :: CDouble
,
c'gsl_monte_vegas_state'x :: Ptr CDouble
,
c'gsl_monte_vegas_state'bin :: Ptr CInt
,
c'gsl_monte_vegas_state'box :: Ptr CInt
,
c'gsl_monte_vegas_state'd :: Ptr CDouble
,
c'gsl_monte_vegas_state'alpha :: CDouble
,
c'gsl_monte_vegas_state'mode :: CInt
,
c'gsl_monte_vegas_state'verbose :: CInt
,
c'gsl_monte_vegas_state'iterations :: CUInt
,
c'gsl_monte_vegas_state'stage :: CInt
,
c'gsl_monte_vegas_state'jac :: CDouble
,
c'gsl_monte_vegas_state'wtd_int_sum :: CDouble
,
c'gsl_monte_vegas_state'sum_wgts :: CDouble
,
c'gsl_monte_vegas_state'chi_sum :: CDouble
,
c'gsl_monte_vegas_state'chisq :: CDouble
,
c'gsl_monte_vegas_state'result :: CDouble
,
c'gsl_monte_vegas_state'sigma :: CDouble
,
c'gsl_monte_vegas_state'it_start :: CUInt
,
c'gsl_monte_vegas_state'it_num :: CUInt
,
c'gsl_monte_vegas_state'samples :: CUInt
,
c'gsl_monte_vegas_state'calls_per_box :: CUInt
,
c'gsl_monte_vegas_state'ostream :: Ptr CFile
} deriving (Eq,Show)
instance Storable C'gsl_monte_vegas_state where
sizeOf _ = 156
alignment = sizeOf
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
v2 <- peekByteOff p 8
v3 <- peekByteOff p 12
v4 <- peekByteOff p 16
v5 <- peekByteOff p 20
v6 <- peekByteOff p 24
v7 <- peekByteOff p 28
v8 <- peekByteOff p 32
v9 <- peekByteOff p 40
v10 <- peekByteOff p 44
v11 <- peekByteOff p 48
v12 <- peekByteOff p 52
v13 <- peekByteOff p 56
v14 <- peekByteOff p 64
v15 <- peekByteOff p 68
v16 <- peekByteOff p 72
v17 <- peekByteOff p 76
v18 <- peekByteOff p 80
v19 <- peekByteOff p 88
v20 <- peekByteOff p 96
v21 <- peekByteOff p 104
v22 <- peekByteOff p 112
v23 <- peekByteOff p 120
v24 <- peekByteOff p 128
v25 <- peekByteOff p 136
v26 <- peekByteOff p 140
v27 <- peekByteOff p 144
v28 <- peekByteOff p 148
v29 <- peekByteOff p 152
return $ C'gsl_monte_vegas_state v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 v25 v26 v27 v28 v29
poke p (C'gsl_monte_vegas_state v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 v25 v26 v27 v28 v29) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
pokeByteOff p 8 v2
pokeByteOff p 12 v3
pokeByteOff p 16 v4
pokeByteOff p 20 v5
pokeByteOff p 24 v6
pokeByteOff p 28 v7
pokeByteOff p 32 v8
pokeByteOff p 40 v9
pokeByteOff p 44 v10
pokeByteOff p 48 v11
pokeByteOff p 52 v12
pokeByteOff p 56 v13
pokeByteOff p 64 v14
pokeByteOff p 68 v15
pokeByteOff p 72 v16
pokeByteOff p 76 v17
pokeByteOff p 80 v18
pokeByteOff p 88 v19
pokeByteOff p 96 v20
pokeByteOff p 104 v21
pokeByteOff p 112 v22
pokeByteOff p 120 v23
pokeByteOff p 128 v24
pokeByteOff p 136 v25
pokeByteOff p 140 v26
pokeByteOff p 144 v27
pokeByteOff p 148 v28
pokeByteOff p 152 v29
return ()
foreign import ccall "gsl_monte_vegas_integrate" c'gsl_monte_vegas_integrate
:: Ptr C'gsl_monte_function -> Ptr CDouble -> Ptr CDouble -> CSize -> CSize -> Ptr C'gsl_rng -> Ptr C'gsl_monte_vegas_state -> Ptr CDouble -> Ptr CDouble -> IO CInt
foreign import ccall "&gsl_monte_vegas_integrate" p'gsl_monte_vegas_integrate
:: FunPtr (Ptr C'gsl_monte_function -> Ptr CDouble -> Ptr CDouble -> CSize -> CSize -> Ptr C'gsl_rng -> Ptr C'gsl_monte_vegas_state -> Ptr CDouble -> Ptr CDouble -> IO CInt)
foreign import ccall "gsl_monte_vegas_alloc" c'gsl_monte_vegas_alloc
:: CSize -> IO (Ptr C'gsl_monte_vegas_state)
foreign import ccall "&gsl_monte_vegas_alloc" p'gsl_monte_vegas_alloc
:: FunPtr (CSize -> IO (Ptr C'gsl_monte_vegas_state))
foreign import ccall "gsl_monte_vegas_init" c'gsl_monte_vegas_init
:: Ptr C'gsl_monte_vegas_state -> IO CInt
foreign import ccall "&gsl_monte_vegas_init" p'gsl_monte_vegas_init
:: FunPtr (Ptr C'gsl_monte_vegas_state -> IO CInt)
foreign import ccall "gsl_monte_vegas_free" c'gsl_monte_vegas_free
:: Ptr C'gsl_monte_vegas_state -> IO ()
foreign import ccall "&gsl_monte_vegas_free" p'gsl_monte_vegas_free
:: FunPtr (Ptr C'gsl_monte_vegas_state -> IO ())