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.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_long_double = C'gsl_complex_long_double{
c'gsl_complex_long_double'dat :: [CLDouble]
} deriving (Eq,Show)
instance Storable C'gsl_complex_long_double where
sizeOf _ = 24
alignment = sizeOf
peek p = do
v0 <- peekArray 2 (plusPtr p 0)
return $ C'gsl_complex_long_double v0
poke p (C'gsl_complex_long_double v0) = do
pokeArray (plusPtr p 0) (take 2 v0)
return ()
data C'gsl_complex = C'gsl_complex{
c'gsl_complex'dat :: [CDouble]
} deriving (Eq,Show)
instance Storable C'gsl_complex where
sizeOf _ = 16
alignment = sizeOf
peek p = do
v0 <- peekArray 2 (plusPtr p 0)
return $ C'gsl_complex v0
poke p (C'gsl_complex v0) = do
pokeArray (plusPtr p 0) (take 2 v0)
return ()
data C'gsl_complex_float = C'gsl_complex_float{
c'gsl_complex_float'dat :: [CFloat]
} deriving (Eq,Show)
instance Storable C'gsl_complex_float where
sizeOf _ = 8
alignment = sizeOf
peek p = do
v0 <- peekArray 2 (plusPtr p 0)
return $ C'gsl_complex_float v0
poke p (C'gsl_complex_float v0) = do
pokeArray (plusPtr p 0) (take 2 v0)
return ()