packages feed

casadi-bindings-core-1.9.0.1: 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_getAll__0,
         slice_getAll__1,
         slice_isSlice,
         slice_isSlice2,
       ) 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 Slice where
  show = unsafePerformIO . printableObject_getDescription
-- 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) -> CInt -> CInt -> IO (Ptr Slice')
casadi__Slice__CONSTRUCTOR__2
  :: Int -> Int -> 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 :: Int -> Int -> 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 -> CInt -> IO (Ptr Slice')
casadi__Slice__CONSTRUCTOR__3
  :: Int -> Int -> Int -> IO Slice
casadi__Slice__CONSTRUCTOR__3 x0 x1 x2 =
  withMarshal x0 $ \x0' ->
  withMarshal x1 $ \x1' ->
  withMarshal x2 $ \x2' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__Slice__CONSTRUCTOR__3 errStrPtrP x0' x1' x2'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
slice__3 :: Int -> 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 -> IO (Ptr Slice')
casadi__Slice__CONSTRUCTOR__4
  :: Int -> IO Slice
casadi__Slice__CONSTRUCTOR__4 x0 =
  withMarshal x0 $ \x0' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__Slice__CONSTRUCTOR__4 errStrPtrP x0'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
slice__4 :: 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) -> IO (Ptr Slice')
casadi__Slice__CONSTRUCTOR__5
  :: IO Slice
casadi__Slice__CONSTRUCTOR__5  =

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


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


-- 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__isSlice" c_casadi__Slice__isSlice
  :: Ptr (Ptr StdString) -> Ptr (StdVec CInt) -> IO CInt
casadi__Slice__isSlice
  :: Vector Int -> IO Bool
casadi__Slice__isSlice x0 =
  withMarshal x0 $ \x0' ->
  do
    errStrPtrP <- new nullPtr
    ret <- c_casadi__Slice__isSlice errStrPtrP x0'
    errStrPtr <- peek errStrPtrP
    free errStrPtrP
    if errStrPtr == nullPtr then wrapReturn ret else wrapReturn errStrPtr >>= (error . formatException)


-- classy wrapper
slice_isSlice :: Vector Int -> IO Bool
slice_isSlice = casadi__Slice__isSlice


-- 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