casadi-bindings-core-1.9.0.1: Casadi/Core/Classes/Integrator.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.Integrator
(
Integrator,
IntegratorClass(..),
integrator,
integrator_clone,
integrator_getDAE,
integrator_integrate,
integrator_integrateB,
integrator_printStats,
integrator_reset,
integrator_resetB,
) 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.Core.Classes.PrintableObject
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
instance Show Integrator where
show = unsafePerformIO . printableObject_getDescription
-- direct wrapper
foreign import ccall unsafe "casadi__Integrator__CONSTRUCTOR" c_casadi__Integrator__CONSTRUCTOR
:: Ptr (Ptr StdString) -> IO (Ptr Integrator')
casadi__Integrator__CONSTRUCTOR
:: IO Integrator
casadi__Integrator__CONSTRUCTOR =
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Integrator__CONSTRUCTOR errStrPtrP
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
integrator :: IO Integrator
integrator = casadi__Integrator__CONSTRUCTOR
-- direct wrapper
foreign import ccall unsafe "casadi__Integrator__clone" c_casadi__Integrator__clone
:: Ptr (Ptr StdString) -> Ptr Integrator' -> IO (Ptr Integrator')
casadi__Integrator__clone
:: Integrator -> IO Integrator
casadi__Integrator__clone x0 =
withMarshal x0 $ \x0' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Integrator__clone errStrPtrP x0'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
integrator_clone :: IntegratorClass a => a -> IO Integrator
integrator_clone x = casadi__Integrator__clone (castIntegrator x)
-- direct wrapper
foreign import ccall unsafe "casadi__Integrator__getDAE" c_casadi__Integrator__getDAE
:: Ptr (Ptr StdString) -> Ptr Integrator' -> IO (Ptr Function')
casadi__Integrator__getDAE
:: Integrator -> IO Function
casadi__Integrator__getDAE x0 =
withMarshal x0 $ \x0' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Integrator__getDAE errStrPtrP x0'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
integrator_getDAE :: IntegratorClass a => a -> IO Function
integrator_getDAE x = casadi__Integrator__getDAE (castIntegrator x)
-- direct wrapper
foreign import ccall unsafe "casadi__Integrator__integrate" c_casadi__Integrator__integrate
:: Ptr (Ptr StdString) -> Ptr Integrator' -> CDouble -> IO ()
casadi__Integrator__integrate
:: Integrator -> Double -> IO ()
casadi__Integrator__integrate x0 x1 =
withMarshal x0 $ \x0' ->
withMarshal x1 $ \x1' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Integrator__integrate errStrPtrP x0' x1'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
integrator_integrate :: IntegratorClass a => a -> Double -> IO ()
integrator_integrate x = casadi__Integrator__integrate (castIntegrator x)
-- direct wrapper
foreign import ccall unsafe "casadi__Integrator__integrateB" c_casadi__Integrator__integrateB
:: Ptr (Ptr StdString) -> Ptr Integrator' -> CDouble -> IO ()
casadi__Integrator__integrateB
:: Integrator -> Double -> IO ()
casadi__Integrator__integrateB x0 x1 =
withMarshal x0 $ \x0' ->
withMarshal x1 $ \x1' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Integrator__integrateB errStrPtrP x0' x1'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
integrator_integrateB :: IntegratorClass a => a -> Double -> IO ()
integrator_integrateB x = casadi__Integrator__integrateB (castIntegrator x)
-- direct wrapper
foreign import ccall unsafe "casadi__Integrator__printStats" c_casadi__Integrator__printStats
:: Ptr (Ptr StdString) -> Ptr Integrator' -> IO ()
casadi__Integrator__printStats
:: Integrator -> IO ()
casadi__Integrator__printStats x0 =
withMarshal x0 $ \x0' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Integrator__printStats errStrPtrP x0'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
integrator_printStats :: IntegratorClass a => a -> IO ()
integrator_printStats x = casadi__Integrator__printStats (castIntegrator x)
-- direct wrapper
foreign import ccall unsafe "casadi__Integrator__reset" c_casadi__Integrator__reset
:: Ptr (Ptr StdString) -> Ptr Integrator' -> IO ()
casadi__Integrator__reset
:: Integrator -> IO ()
casadi__Integrator__reset x0 =
withMarshal x0 $ \x0' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Integrator__reset errStrPtrP x0'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
integrator_reset :: IntegratorClass a => a -> IO ()
integrator_reset x = casadi__Integrator__reset (castIntegrator x)
-- direct wrapper
foreign import ccall unsafe "casadi__Integrator__resetB" c_casadi__Integrator__resetB
:: Ptr (Ptr StdString) -> Ptr Integrator' -> IO ()
casadi__Integrator__resetB
:: Integrator -> IO ()
casadi__Integrator__resetB x0 =
withMarshal x0 $ \x0' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Integrator__resetB errStrPtrP x0'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
integrator_resetB :: IntegratorClass a => a -> IO ()
integrator_resetB x = casadi__Integrator__resetB (castIntegrator x)