casadi-bindings-core-2.1.3.0: Casadi/Core/Classes/Variable.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.Variable
(
Variable,
VariableClass(..),
variable,
variable_atTime__0,
variable_atTime__1,
variable_atTime__2,
variable_atTime__3,
variable_getDescription,
variable_getRepresentation,
variable_name,
variable_setName,
) 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__Variable__CONSTRUCTOR" c_casadi__Variable__CONSTRUCTOR
:: Ptr (Ptr StdString) -> IO (Ptr Variable')
casadi__Variable__CONSTRUCTOR
:: IO Variable
casadi__Variable__CONSTRUCTOR =
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Variable__CONSTRUCTOR errStrPtrP
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
variable :: IO Variable
variable = casadi__Variable__CONSTRUCTOR
-- direct wrapper
foreign import ccall unsafe "casadi__Variable__atTime__0" c_casadi__Variable__atTime__0
:: Ptr (Ptr StdString) -> Ptr Variable' -> CDouble -> IO (Ptr SXElement')
casadi__Variable__atTime__0
:: Variable -> Double -> IO SXElement
casadi__Variable__atTime__0 x0 x1 =
withMarshal x0 $ \x0' ->
withMarshal x1 $ \x1' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Variable__atTime__0 errStrPtrP x0' x1'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
variable_atTime__0 :: VariableClass a => a -> Double -> IO SXElement
variable_atTime__0 x = casadi__Variable__atTime__0 (castVariable x)
-- direct wrapper
foreign import ccall unsafe "casadi__Variable__atTime__1" c_casadi__Variable__atTime__1
:: Ptr (Ptr StdString) -> Ptr Variable' -> CDouble -> CInt -> IO (Ptr SXElement')
casadi__Variable__atTime__1
:: Variable -> Double -> Bool -> IO SXElement
casadi__Variable__atTime__1 x0 x1 x2 =
withMarshal x0 $ \x0' ->
withMarshal x1 $ \x1' ->
withMarshal x2 $ \x2' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Variable__atTime__1 errStrPtrP x0' x1' x2'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
variable_atTime__1 :: VariableClass a => a -> Double -> Bool -> IO SXElement
variable_atTime__1 x = casadi__Variable__atTime__1 (castVariable x)
-- direct wrapper
foreign import ccall unsafe "casadi__Variable__atTime__2" c_casadi__Variable__atTime__2
:: Ptr (Ptr StdString) -> Ptr Variable' -> CDouble -> IO (Ptr SXElement')
casadi__Variable__atTime__2
:: Variable -> Double -> IO SXElement
casadi__Variable__atTime__2 x0 x1 =
withMarshal x0 $ \x0' ->
withMarshal x1 $ \x1' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Variable__atTime__2 errStrPtrP x0' x1'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
variable_atTime__2 :: VariableClass a => a -> Double -> IO SXElement
variable_atTime__2 x = casadi__Variable__atTime__2 (castVariable x)
-- direct wrapper
foreign import ccall unsafe "casadi__Variable__atTime__3" c_casadi__Variable__atTime__3
:: Ptr (Ptr StdString) -> Ptr Variable' -> CDouble -> CInt -> IO (Ptr SXElement')
casadi__Variable__atTime__3
:: Variable -> Double -> Bool -> IO SXElement
casadi__Variable__atTime__3 x0 x1 x2 =
withMarshal x0 $ \x0' ->
withMarshal x1 $ \x1' ->
withMarshal x2 $ \x2' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Variable__atTime__3 errStrPtrP x0' x1' x2'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
variable_atTime__3 :: VariableClass a => a -> Double -> Bool -> IO SXElement
variable_atTime__3 x = casadi__Variable__atTime__3 (castVariable x)
-- direct wrapper
foreign import ccall unsafe "casadi__Variable__name" c_casadi__Variable__name
:: Ptr (Ptr StdString) -> Ptr Variable' -> IO (Ptr StdString)
casadi__Variable__name
:: Variable -> IO String
casadi__Variable__name x0 =
withMarshal x0 $ \x0' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Variable__name errStrPtrP x0'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
variable_name :: VariableClass a => a -> IO String
variable_name x = casadi__Variable__name (castVariable x)
-- direct wrapper
foreign import ccall unsafe "casadi__Variable__setName" c_casadi__Variable__setName
:: Ptr (Ptr StdString) -> Ptr Variable' -> Ptr StdString -> IO ()
casadi__Variable__setName
:: Variable -> String -> IO ()
casadi__Variable__setName x0 x1 =
withMarshal x0 $ \x0' ->
withMarshal x1 $ \x1' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Variable__setName errStrPtrP x0' x1'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
variable_setName :: VariableClass a => a -> String -> IO ()
variable_setName x = casadi__Variable__setName (castVariable x)
-- direct wrapper
foreign import ccall unsafe "casadi__Variable__getRepresentation" c_casadi__Variable__getRepresentation
:: Ptr (Ptr StdString) -> Ptr Variable' -> IO (Ptr StdString)
casadi__Variable__getRepresentation
:: Variable -> IO String
casadi__Variable__getRepresentation x0 =
withMarshal x0 $ \x0' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Variable__getRepresentation errStrPtrP x0'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
variable_getRepresentation :: VariableClass a => a -> IO String
variable_getRepresentation x = casadi__Variable__getRepresentation (castVariable x)
-- direct wrapper
foreign import ccall unsafe "casadi__Variable__getDescription" c_casadi__Variable__getDescription
:: Ptr (Ptr StdString) -> Ptr Variable' -> IO (Ptr StdString)
casadi__Variable__getDescription
:: Variable -> IO String
casadi__Variable__getDescription x0 =
withMarshal x0 $ \x0' ->
do
errStrPtrP <- new nullPtr
ret <- c_casadi__Variable__getDescription errStrPtrP x0'
errStrPtr <- peek errStrPtrP
free errStrPtrP
if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)
-- classy wrapper
variable_getDescription :: VariableClass a => a -> IO String
variable_getDescription x = casadi__Variable__getDescription (castVariable x)