packages feed

casadi-bindings-core-2.1.3.0: Casadi/Core/Classes/ImplicitFunction.hs

{-# OPTIONS_GHC -Wall #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# Language ForeignFunctionInterface #-}
{-# Language FlexibleInstances #-}
{-# Language MultiParamTypeClasses #-}

module Casadi.Core.Classes.ImplicitFunction
       (
         ImplicitFunction,
         ImplicitFunctionClass(..),
         implicitFunction__0,
         implicitFunction__1,
         implicitFunction__2,
         implicitFunction__3,
         implicitFunction_doc,
         implicitFunction_getF,
         implicitFunction_getJac,
         implicitFunction_getLinsol,
         implicitFunction_hasPlugin,
         implicitFunction_loadPlugin,
       ) where


import Prelude hiding ( Functor )

import Data.Vector ( Vector )
import Foreign.C.Types
import Foreign.Marshal ( new, free )
import Foreign.Storable ( peek )
import Foreign.Ptr ( Ptr, nullPtr )
import Foreign.ForeignPtr ( newForeignPtr )
import System.IO.Unsafe ( unsafePerformIO ) -- for show instances

import Casadi.Internal.CToolsInstances ( )
import Casadi.Internal.FormatException ( formatException )
import Casadi.Internal.MarshalTypes ( StdVec, StdString) -- StdPair StdOstream'
import Casadi.Internal.Marshal ( Marshal(..), withMarshal )
import Casadi.Internal.WrapReturn ( WrapReturn(..) )
import Casadi.Core.Data
import Casadi.Core.Enums

-- direct wrapper
foreign import ccall unsafe "casadi__ImplicitFunction__CONSTRUCTOR__0" c_casadi__ImplicitFunction__CONSTRUCTOR__0
  :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr Function' -> IO (Ptr ImplicitFunction')
casadi__ImplicitFunction__CONSTRUCTOR__0
  :: String -> Function -> IO ImplicitFunction
casadi__ImplicitFunction__CONSTRUCTOR__0 x0 x1 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__ImplicitFunction__CONSTRUCTOR__0 errStrPtrP x0' x1'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
implicitFunction__0 :: String -> Function -> IO ImplicitFunction
implicitFunction__0 = casadi__ImplicitFunction__CONSTRUCTOR__0


-- direct wrapper
foreign import ccall unsafe "casadi__ImplicitFunction__CONSTRUCTOR__1" c_casadi__ImplicitFunction__CONSTRUCTOR__1
  :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr Function' -> Ptr Function' -> IO (Ptr ImplicitFunction')
casadi__ImplicitFunction__CONSTRUCTOR__1
  :: String -> Function -> Function -> IO ImplicitFunction
casadi__ImplicitFunction__CONSTRUCTOR__1 x0 x1 x2 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  withMarshal x2 $ \x2' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__ImplicitFunction__CONSTRUCTOR__1 errStrPtrP x0' x1' x2'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
implicitFunction__1 :: String -> Function -> Function -> IO ImplicitFunction
implicitFunction__1 = casadi__ImplicitFunction__CONSTRUCTOR__1


-- direct wrapper
foreign import ccall unsafe "casadi__ImplicitFunction__CONSTRUCTOR__2" c_casadi__ImplicitFunction__CONSTRUCTOR__2
  :: Ptr (Ptr StdString) -> Ptr StdString -> Ptr Function' -> Ptr Function' -> Ptr LinearSolver' -> IO (Ptr ImplicitFunction')
casadi__ImplicitFunction__CONSTRUCTOR__2
  :: String -> Function -> Function -> LinearSolver -> IO ImplicitFunction
casadi__ImplicitFunction__CONSTRUCTOR__2 x0 x1 x2 x3 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  withMarshal x2 $ \x2' ->
  withMarshal x3 $ \x3' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__ImplicitFunction__CONSTRUCTOR__2 errStrPtrP x0' x1' x2' x3'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
implicitFunction__2 :: String -> Function -> Function -> LinearSolver -> IO ImplicitFunction
implicitFunction__2 = casadi__ImplicitFunction__CONSTRUCTOR__2


-- direct wrapper
foreign import ccall unsafe "casadi__ImplicitFunction__CONSTRUCTOR__3" c_casadi__ImplicitFunction__CONSTRUCTOR__3
  :: Ptr (Ptr StdString) -> IO (Ptr ImplicitFunction')
casadi__ImplicitFunction__CONSTRUCTOR__3
  :: IO ImplicitFunction
casadi__ImplicitFunction__CONSTRUCTOR__3  =

  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__ImplicitFunction__CONSTRUCTOR__3 errStrPtrP 
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
implicitFunction__3 :: IO ImplicitFunction
implicitFunction__3 = casadi__ImplicitFunction__CONSTRUCTOR__3


-- direct wrapper
foreign import ccall unsafe "casadi__ImplicitFunction__doc" c_casadi__ImplicitFunction__doc
  :: Ptr (Ptr StdString) -> Ptr StdString -> IO (Ptr StdString)
casadi__ImplicitFunction__doc
  :: String -> IO String
casadi__ImplicitFunction__doc x0 =
  withMarshal x0 $ \x0' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__ImplicitFunction__doc errStrPtrP x0'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
implicitFunction_doc :: String -> IO String
implicitFunction_doc = casadi__ImplicitFunction__doc


-- direct wrapper
foreign import ccall unsafe "casadi__ImplicitFunction__getF" c_casadi__ImplicitFunction__getF
  :: Ptr (Ptr StdString) -> Ptr ImplicitFunction' -> IO (Ptr Function')
casadi__ImplicitFunction__getF
  :: ImplicitFunction -> IO Function
casadi__ImplicitFunction__getF x0 =
  withMarshal x0 $ \x0' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__ImplicitFunction__getF errStrPtrP x0'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
implicitFunction_getF :: ImplicitFunctionClass a => a -> IO Function
implicitFunction_getF x = casadi__ImplicitFunction__getF (castImplicitFunction x)


-- direct wrapper
foreign import ccall unsafe "casadi__ImplicitFunction__getJac" c_casadi__ImplicitFunction__getJac
  :: Ptr (Ptr StdString) -> Ptr ImplicitFunction' -> IO (Ptr Function')
casadi__ImplicitFunction__getJac
  :: ImplicitFunction -> IO Function
casadi__ImplicitFunction__getJac x0 =
  withMarshal x0 $ \x0' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__ImplicitFunction__getJac errStrPtrP x0'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
implicitFunction_getJac :: ImplicitFunctionClass a => a -> IO Function
implicitFunction_getJac x = casadi__ImplicitFunction__getJac (castImplicitFunction x)


-- direct wrapper
foreign import ccall unsafe "casadi__ImplicitFunction__getLinsol" c_casadi__ImplicitFunction__getLinsol
  :: Ptr (Ptr StdString) -> Ptr ImplicitFunction' -> IO (Ptr LinearSolver')
casadi__ImplicitFunction__getLinsol
  :: ImplicitFunction -> IO LinearSolver
casadi__ImplicitFunction__getLinsol x0 =
  withMarshal x0 $ \x0' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__ImplicitFunction__getLinsol errStrPtrP x0'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
implicitFunction_getLinsol :: ImplicitFunctionClass a => a -> IO LinearSolver
implicitFunction_getLinsol x = casadi__ImplicitFunction__getLinsol (castImplicitFunction x)


-- direct wrapper
foreign import ccall unsafe "casadi__ImplicitFunction__hasPlugin" c_casadi__ImplicitFunction__hasPlugin
  :: Ptr (Ptr StdString) -> Ptr StdString -> IO CInt
casadi__ImplicitFunction__hasPlugin
  :: String -> IO Bool
casadi__ImplicitFunction__hasPlugin x0 =
  withMarshal x0 $ \x0' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__ImplicitFunction__hasPlugin errStrPtrP x0'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
implicitFunction_hasPlugin :: String -> IO Bool
implicitFunction_hasPlugin = casadi__ImplicitFunction__hasPlugin


-- direct wrapper
foreign import ccall unsafe "casadi__ImplicitFunction__loadPlugin" c_casadi__ImplicitFunction__loadPlugin
  :: Ptr (Ptr StdString) -> Ptr StdString -> IO ()
casadi__ImplicitFunction__loadPlugin
  :: String -> IO ()
casadi__ImplicitFunction__loadPlugin x0 =
  withMarshal x0 $ \x0' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__ImplicitFunction__loadPlugin errStrPtrP x0'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
implicitFunction_loadPlugin :: String -> IO ()
implicitFunction_loadPlugin = casadi__ImplicitFunction__loadPlugin