module Bindings.Gsl.ComplexNumbers 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.Alloc (alloca)
import Foreign.Marshal.Array (peekArray,pokeArray)
import Data.Int
import Data.Word
type C'gsl_complex_packed = CUInt
type C'gsl_complex_packed_float = CUInt
type C'gsl_complex_packed_long_double = CUInt
type C'gsl_const_complex_packed = CUInt
type C'gsl_const_complex_packed_float = CUInt
type C'gsl_const_complex_packed_long_double = CUInt
type C'gsl_complex_packed_array = CUInt
type C'gsl_complex_packed_array_float = CUInt
type C'gsl_complex_packed_array_long_double = CUInt
type C'gsl_const_complex_packed_array = CUInt
type C'gsl_const_complex_packed_array_float = CUInt
type C'gsl_const_complex_packed_array_long_double = CUInt
type C'gsl_complex_packed_ptr = CUInt
type C'gsl_complex_packed_float_ptr = CUInt
type C'gsl_complex_packed_long_double_ptr = CUInt
type C'gsl_const_complex_packed_ptr = CUInt
type C'gsl_const_complex_packed_float_ptr = CUInt
type C'gsl_const_complex_packed_long_double_ptr = CUInt
data C'gsl_complex = C'gsl_complex{
c'gsl_complex'dat :: [CDouble]
} deriving (Eq,Show)
p'gsl_complex'dat p = plusPtr p 0
p'gsl_complex'dat :: Ptr (C'gsl_complex) -> Ptr (CDouble)
instance Storable C'gsl_complex where
sizeOf _ = 16
alignment _ = 4
peek p = do
v0 <- let s = div 16 $ sizeOf $ (undefined :: CDouble) in peekArray s (plusPtr p 0)
return $ C'gsl_complex v0
poke p (C'gsl_complex v0) = do
let s = div 8101253775701835792 $ sizeOf $ (undefined :: CDouble)
pokeArray (plusPtr p 0) (take s v0)
return ()
data C'gsl_complex_float = C'gsl_complex_float{
c'gsl_complex_float'dat :: [CFloat]
} deriving (Eq,Show)
p'gsl_complex_float'dat p = plusPtr p 0
p'gsl_complex_float'dat :: Ptr (C'gsl_complex_float) -> Ptr (CFloat)
instance Storable C'gsl_complex_float where
sizeOf _ = 8
alignment _ = 4
peek p = do
v0 <- let s = div 8 $ sizeOf $ (undefined :: CFloat) in peekArray s (plusPtr p 0)
return $ C'gsl_complex_float v0
poke p (C'gsl_complex_float v0) = do
let s = div 8 $ sizeOf $ (undefined :: CFloat)
pokeArray (plusPtr p 0) (take s v0)
return ()