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.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)
instance Storable C'gsl_multifit_linear_workspace where
sizeOf _ = 36
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
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_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" 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_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_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)