module Bindings.Gsl.LeastSquaresFitting 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
import Bindings.Gsl.VectorsAndMatrices.DataTypes
foreign import ccall "gsl_fit_linear" c'gsl_fit_linear
:: Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> CSize -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt
foreign import ccall "&gsl_fit_linear" p'gsl_fit_linear
:: FunPtr (Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> CSize -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt)
foreign import ccall "gsl_fit_wlinear" c'gsl_fit_wlinear
:: Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> CSize -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt
foreign import ccall "&gsl_fit_wlinear" p'gsl_fit_wlinear
:: FunPtr (Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> CSize -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt)
foreign import ccall "gsl_fit_linear_est" c'gsl_fit_linear_est
:: CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt
foreign import ccall "&gsl_fit_linear_est" p'gsl_fit_linear_est
:: FunPtr (CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt)
foreign import ccall "gsl_fit_mul" c'gsl_fit_mul
:: Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> CSize -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt
foreign import ccall "&gsl_fit_mul" p'gsl_fit_mul
:: FunPtr (Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> CSize -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt)
foreign import ccall "gsl_fit_wmul" c'gsl_fit_wmul
:: Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> CSize -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt
foreign import ccall "&gsl_fit_wmul" p'gsl_fit_wmul
:: FunPtr (Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> Ptr CDouble -> CSize -> CSize -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt)
foreign import ccall "gsl_fit_mul_est" c'gsl_fit_mul_est
:: CDouble -> CDouble -> CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt
foreign import ccall "&gsl_fit_mul_est" p'gsl_fit_mul_est
:: FunPtr (CDouble -> CDouble -> CDouble -> Ptr CDouble -> Ptr CDouble -> IO CInt)
data C'gsl_multifit_linear_workspace = C'gsl_multifit_linear_workspace{
c'gsl_multifit_linear_workspace'n :: CSize,
c'gsl_multifit_linear_workspace'p :: CSize,
c'gsl_multifit_linear_workspace'A :: Ptr C'gsl_matrix,
c'gsl_multifit_linear_workspace'Q :: Ptr C'gsl_matrix,
c'gsl_multifit_linear_workspace'QSI :: Ptr C'gsl_matrix,
c'gsl_multifit_linear_workspace'S :: Ptr C'gsl_vector,
c'gsl_multifit_linear_workspace't :: Ptr C'gsl_vector,
c'gsl_multifit_linear_workspace'xt :: Ptr C'gsl_vector,
c'gsl_multifit_linear_workspace'D :: Ptr C'gsl_vector
} deriving (Eq,Show)
p'gsl_multifit_linear_workspace'n p = plusPtr p 0
p'gsl_multifit_linear_workspace'n :: Ptr (C'gsl_multifit_linear_workspace) -> Ptr (CSize)
p'gsl_multifit_linear_workspace'p p = plusPtr p 4
p'gsl_multifit_linear_workspace'p :: Ptr (C'gsl_multifit_linear_workspace) -> Ptr (CSize)
p'gsl_multifit_linear_workspace'A p = plusPtr p 8
p'gsl_multifit_linear_workspace'A :: Ptr (C'gsl_multifit_linear_workspace) -> Ptr (Ptr C'gsl_matrix)
p'gsl_multifit_linear_workspace'Q p = plusPtr p 12
p'gsl_multifit_linear_workspace'Q :: Ptr (C'gsl_multifit_linear_workspace) -> Ptr (Ptr C'gsl_matrix)
p'gsl_multifit_linear_workspace'QSI p = plusPtr p 16
p'gsl_multifit_linear_workspace'QSI :: Ptr (C'gsl_multifit_linear_workspace) -> Ptr (Ptr C'gsl_matrix)
p'gsl_multifit_linear_workspace'S p = plusPtr p 20
p'gsl_multifit_linear_workspace'S :: Ptr (C'gsl_multifit_linear_workspace) -> Ptr (Ptr C'gsl_vector)
p'gsl_multifit_linear_workspace't p = plusPtr p 24
p'gsl_multifit_linear_workspace't :: Ptr (C'gsl_multifit_linear_workspace) -> Ptr (Ptr C'gsl_vector)
p'gsl_multifit_linear_workspace'xt p = plusPtr p 28
p'gsl_multifit_linear_workspace'xt :: Ptr (C'gsl_multifit_linear_workspace) -> Ptr (Ptr C'gsl_vector)
p'gsl_multifit_linear_workspace'D p = plusPtr p 32
p'gsl_multifit_linear_workspace'D :: Ptr (C'gsl_multifit_linear_workspace) -> Ptr (Ptr C'gsl_vector)
instance Storable C'gsl_multifit_linear_workspace where
sizeOf _ = 36
alignment _ = 4
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
return $ C'gsl_multifit_linear_workspace v0 v1 v2 v3 v4 v5 v6 v7 v8
poke p (C'gsl_multifit_linear_workspace v0 v1 v2 v3 v4 v5 v6 v7 v8) = 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
return ()
foreign import ccall "gsl_multifit_linear_alloc" c'gsl_multifit_linear_alloc
:: CSize -> CSize -> IO (Ptr C'gsl_multifit_linear_workspace)
foreign import ccall "&gsl_multifit_linear_alloc" p'gsl_multifit_linear_alloc
:: FunPtr (CSize -> CSize -> IO (Ptr C'gsl_multifit_linear_workspace))
foreign import ccall "gsl_multifit_linear_free" c'gsl_multifit_linear_free
:: Ptr C'gsl_multifit_linear_workspace -> IO ()
foreign import ccall "&gsl_multifit_linear_free" p'gsl_multifit_linear_free
:: FunPtr (Ptr C'gsl_multifit_linear_workspace -> IO ())
foreign import ccall "gsl_multifit_linear" c'gsl_multifit_linear
:: Ptr C'gsl_matrix -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt
foreign import ccall "&gsl_multifit_linear" p'gsl_multifit_linear
:: FunPtr (Ptr C'gsl_matrix -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt)
foreign import ccall "gsl_multifit_wlinear" c'gsl_multifit_wlinear
:: Ptr C'gsl_matrix -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt
foreign import ccall "&gsl_multifit_wlinear" p'gsl_multifit_wlinear
:: FunPtr (Ptr C'gsl_matrix -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt)
foreign import ccall "gsl_multifit_linear_svd" c'gsl_multifit_linear_svd
:: Ptr C'gsl_matrix -> Ptr C'gsl_vector -> CDouble -> Ptr CSize -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt
foreign import ccall "&gsl_multifit_linear_svd" p'gsl_multifit_linear_svd
:: FunPtr (Ptr C'gsl_matrix -> Ptr C'gsl_vector -> CDouble -> Ptr CSize -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt)
foreign import ccall "gsl_multifit_wlinear_svd" c'gsl_multifit_wlinear_svd
:: Ptr C'gsl_matrix -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> CDouble -> Ptr CSize -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt
foreign import ccall "&gsl_multifit_wlinear_svd" p'gsl_multifit_wlinear_svd
:: FunPtr (Ptr C'gsl_matrix -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> CDouble -> Ptr CSize -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt)
foreign import ccall "gsl_multifit_linear_usvd" c'gsl_multifit_linear_usvd
:: Ptr C'gsl_matrix -> Ptr C'gsl_vector -> CDouble -> Ptr CSize -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt
foreign import ccall "&gsl_multifit_linear_usvd" p'gsl_multifit_linear_usvd
:: FunPtr (Ptr C'gsl_matrix -> Ptr C'gsl_vector -> CDouble -> Ptr CSize -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt)
foreign import ccall "gsl_multifit_wlinear_usvd" c'gsl_multifit_wlinear_usvd
:: Ptr C'gsl_matrix -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> CDouble -> Ptr CSize -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt
foreign import ccall "&gsl_multifit_wlinear_usvd" p'gsl_multifit_wlinear_usvd
:: FunPtr (Ptr C'gsl_matrix -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> CDouble -> Ptr CSize -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr C'gsl_multifit_linear_workspace -> IO CInt)
foreign import ccall "gsl_multifit_linear_est" c'gsl_multifit_linear_est
:: Ptr C'gsl_vector -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr CDouble -> IO CInt
foreign import ccall "&gsl_multifit_linear_est" p'gsl_multifit_linear_est
:: FunPtr (Ptr C'gsl_vector -> Ptr C'gsl_vector -> Ptr C'gsl_matrix -> Ptr CDouble -> Ptr CDouble -> IO CInt)
foreign import ccall "gsl_multifit_linear_residuals" c'gsl_multifit_linear_residuals
:: Ptr C'gsl_matrix -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> IO CInt
foreign import ccall "&gsl_multifit_linear_residuals" p'gsl_multifit_linear_residuals
:: FunPtr (Ptr C'gsl_matrix -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> Ptr C'gsl_vector -> IO CInt)