packages feed

casadi-bindings-core-2.2.0.0: Casadi/Core/Classes/Slice.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.Slice
       (
         Slice,
         SliceClass(..),
         slice__0,
         slice__1,
         slice__2,
         slice__3,
         slice__4,
         slice__5,
         slice__6,
         slice_getAll__0,
         slice_getAll__1,
         slice_getAll__2,
         slice_getDescription,
         slice_getRepresentation,
         slice_isScalar,
         slice_isSlice2,
         slice_isSlice__0,
         slice_isSlice__1,
         slice_toScalar,
       ) 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__Slice__CONSTRUCTOR__0" c_casadi__Slice__CONSTRUCTOR__0
  :: Ptr (Ptr StdString) -> Ptr (StdVec CInt) -> Ptr Slice' -> IO (Ptr Slice')
casadi__Slice__CONSTRUCTOR__0
  :: Vector Int -> Slice -> IO Slice
casadi__Slice__CONSTRUCTOR__0 x0 x1 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__Slice__CONSTRUCTOR__0 errStrPtrP x0' x1'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
slice__0 :: Vector Int -> Slice -> IO Slice
slice__0 = casadi__Slice__CONSTRUCTOR__0


-- direct wrapper
foreign import ccall unsafe "casadi__Slice__CONSTRUCTOR__1" c_casadi__Slice__CONSTRUCTOR__1
  :: Ptr (Ptr StdString) -> Ptr (StdVec CInt) -> IO (Ptr Slice')
casadi__Slice__CONSTRUCTOR__1
  :: Vector Int -> IO Slice
casadi__Slice__CONSTRUCTOR__1 x0 =
  withMarshal x0 $ \x0' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__Slice__CONSTRUCTOR__1 errStrPtrP x0'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
slice__1 :: Vector Int -> IO Slice
slice__1 = casadi__Slice__CONSTRUCTOR__1


-- direct wrapper
foreign import ccall unsafe "casadi__Slice__CONSTRUCTOR__2" c_casadi__Slice__CONSTRUCTOR__2
  :: Ptr (Ptr StdString) -> Ptr (StdVec CInt) -> CInt -> IO (Ptr Slice')
casadi__Slice__CONSTRUCTOR__2
  :: Vector Int -> Bool -> IO Slice
casadi__Slice__CONSTRUCTOR__2 x0 x1 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__Slice__CONSTRUCTOR__2 errStrPtrP x0' x1'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
slice__2 :: Vector Int -> Bool -> IO Slice
slice__2 = casadi__Slice__CONSTRUCTOR__2


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


-- classy wrapper
slice__3 :: Int -> Int -> IO Slice
slice__3 = casadi__Slice__CONSTRUCTOR__3


-- direct wrapper
foreign import ccall unsafe "casadi__Slice__CONSTRUCTOR__4" c_casadi__Slice__CONSTRUCTOR__4
  :: Ptr (Ptr StdString) -> CInt -> CInt -> CInt -> IO (Ptr Slice')
casadi__Slice__CONSTRUCTOR__4
  :: Int -> Int -> Int -> IO Slice
casadi__Slice__CONSTRUCTOR__4 x0 x1 x2 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  withMarshal x2 $ \x2' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__Slice__CONSTRUCTOR__4 errStrPtrP x0' x1' x2'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
slice__4 :: Int -> Int -> Int -> IO Slice
slice__4 = casadi__Slice__CONSTRUCTOR__4


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


-- classy wrapper
slice__5 :: Int -> IO Slice
slice__5 = casadi__Slice__CONSTRUCTOR__5


-- direct wrapper
foreign import ccall unsafe "casadi__Slice__CONSTRUCTOR__6" c_casadi__Slice__CONSTRUCTOR__6
  :: Ptr (Ptr StdString) -> IO (Ptr Slice')
casadi__Slice__CONSTRUCTOR__6
  :: IO Slice
casadi__Slice__CONSTRUCTOR__6  =

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


-- classy wrapper
slice__6 :: IO Slice
slice__6 = casadi__Slice__CONSTRUCTOR__6


-- direct wrapper
foreign import ccall unsafe "casadi__Slice__getAll__0" c_casadi__Slice__getAll__0
  :: Ptr (Ptr StdString) -> Ptr Slice' -> Ptr Slice' -> CInt -> IO (Ptr (StdVec CInt))
casadi__Slice__getAll__0
  :: Slice -> Slice -> Int -> IO (Vector Int)
casadi__Slice__getAll__0 x0 x1 x2 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  withMarshal x2 $ \x2' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__Slice__getAll__0 errStrPtrP x0' x1' x2'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
slice_getAll__0 :: SliceClass a => a -> Slice -> Int -> IO (Vector Int)
slice_getAll__0 x = casadi__Slice__getAll__0 (castSlice x)


-- direct wrapper
foreign import ccall unsafe "casadi__Slice__getAll__1" c_casadi__Slice__getAll__1
  :: Ptr (Ptr StdString) -> Ptr Slice' -> CInt -> IO (Ptr (StdVec CInt))
casadi__Slice__getAll__1
  :: Slice -> Int -> IO (Vector Int)
casadi__Slice__getAll__1 x0 x1 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__Slice__getAll__1 errStrPtrP x0' x1'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
slice_getAll__1 :: SliceClass a => a -> Int -> IO (Vector Int)
slice_getAll__1 x = casadi__Slice__getAll__1 (castSlice x)


-- direct wrapper
foreign import ccall unsafe "casadi__Slice__getAll__2" c_casadi__Slice__getAll__2
  :: Ptr (Ptr StdString) -> Ptr Slice' -> CInt -> CInt -> IO (Ptr (StdVec CInt))
casadi__Slice__getAll__2
  :: Slice -> Int -> Bool -> IO (Vector Int)
casadi__Slice__getAll__2 x0 x1 x2 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  withMarshal x2 $ \x2' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__Slice__getAll__2 errStrPtrP x0' x1' x2'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
slice_getAll__2 :: SliceClass a => a -> Int -> Bool -> IO (Vector Int)
slice_getAll__2 x = casadi__Slice__getAll__2 (castSlice x)


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


-- classy wrapper
slice_isScalar :: SliceClass a => a -> Int -> IO Bool
slice_isScalar x = casadi__Slice__isScalar (castSlice x)


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


-- classy wrapper
slice_isSlice__0 :: Vector Int -> IO Bool
slice_isSlice__0 = casadi__Slice__isSlice__0


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


-- classy wrapper
slice_isSlice__1 :: Vector Int -> Bool -> IO Bool
slice_isSlice__1 = casadi__Slice__isSlice__1


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


-- classy wrapper
slice_isSlice2 :: Vector Int -> IO Bool
slice_isSlice2 = casadi__Slice__isSlice2


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


-- classy wrapper
slice_toScalar :: SliceClass a => a -> Int -> IO Int
slice_toScalar x = casadi__Slice__toScalar (castSlice x)


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


-- classy wrapper
slice_getRepresentation :: SliceClass a => a -> IO String
slice_getRepresentation x = casadi__Slice__getRepresentation (castSlice x)


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


-- classy wrapper
slice_getDescription :: SliceClass a => a -> IO String
slice_getDescription x = casadi__Slice__getDescription (castSlice x)