casadi-bindings 3.1.0.2 → 3.1.0.3
raw patch · 6 files changed
+32/−2 lines, 6 files
Files
- casadi-bindings.cabal +1/−1
- src/Casadi/CMatrix.hs +1/−0
- src/Casadi/DM.hs +4/−0
- src/Casadi/MX.hs +9/−1
- src/Casadi/Overloading.hs +13/−0
- src/Casadi/SX.hs +4/−0
casadi-bindings.cabal view
@@ -1,5 +1,5 @@ name: casadi-bindings-version: 3.1.0.2+version: 3.1.0.3 synopsis: mid-level bindings to CasADi category: Numerical, Math description:
src/Casadi/CMatrix.hs view
@@ -69,6 +69,7 @@ cor :: a -> a -> a -- TODO(greg): any and all repmat :: a -> (Int, Int) -> a+ printme :: a -> a -> a {-# DEPRECATED solve' "use the new solve, this one is going away" #-}
src/Casadi/DM.hs view
@@ -161,6 +161,8 @@ {-# NOINLINE cor #-} repmat x (s1, s2) = unsafePerformIO (C.casadi_repmat__5 x s1 s2) {-# NOINLINE repmat #-}+ printme x y = unsafePerformIO (dm_printme x y)+ {-# NOINLINE printme #-} instance Num DM where (+) x y = unsafePerformIO (C.casadi_plus__2 x y)@@ -235,6 +237,8 @@ {-# NOINLINE gt #-} x `eq` y = unsafePerformIO (C.casadi_eq__2 x y) {-# NOINLINE eq #-}+ x `ne` y = unsafePerformIO (C.casadi_ne__2 x y)+ {-# NOINLINE ne #-} max' x y = cmax x y {-# NOINLINE max' #-} min' x y = cmin x y
src/Casadi/MX.hs view
@@ -3,7 +3,7 @@ module Casadi.MX ( MX , sym, symV, symM, gradient, jacobian, hessian- , expand+ , expand, attachAssert ) where import Data.Vector ( Vector )@@ -65,6 +65,10 @@ hessian x y z = unsafePerformIO (C.casadi_hessian__3 x y z) {-# NOINLINE hessian #-} +attachAssert :: MX -> MX -> String -> MX+attachAssert x y msg = unsafePerformIO (mx_attachAssert__1 x y msg)+{-# NOINLINE attachAssert #-}+ --sparsify :: MX -> MX --sparsify x = unsafePerformIO (C.casadi_sparsify__0__3 x) --{-# NOINLINE sparsify #-}@@ -162,6 +166,8 @@ {-# NOINLINE cor #-} repmat x (s1, s2) = unsafePerformIO (C.casadi_repmat__11 x s1 s2) {-# NOINLINE repmat #-}+ printme x y = unsafePerformIO (mx_printme x y)+ {-# NOINLINE printme #-} instance Num MX where@@ -237,6 +243,8 @@ {-# NOINLINE gt #-} x `eq` y = unsafePerformIO (C.casadi_eq__4 x y) {-# NOINLINE eq #-}+ x `ne` y = unsafePerformIO (C.casadi_ne__4 x y)+ {-# NOINLINE ne #-} max' x y = cmax x y {-# NOINLINE max' #-} min' x y = cmin x y
src/Casadi/Overloading.hs view
@@ -74,6 +74,15 @@ -- -- >>> 43 `eq` 42 :: Double -- 0.0+--+-- >>> 41 `ne` 42 :: Double+ -- 1.0+--+-- >>> 42 `ne` 42 :: Double+-- 0.0+--+-- >>> 43 `ne` 42 :: Double+-- 1.0 class Num a => SymOrd a where -- | @<=@ leq :: a -> a -> a@@ -85,6 +94,8 @@ gt :: a -> a -> a -- | @==@ eq :: a -> a -> a+ -- | @!=@+ ne :: a -> a -> a -- | max without (==) max' :: a -> a -> a -- | min without (==)@@ -96,6 +107,7 @@ x `geq` y = if x >= y then 1 else 0 x `gt` y = if x > y then 1 else 0 x `eq` y = if x == y then 1 else 0+ x `ne` y = if x /= y then 1 else 0 max' = max min' = min instance SymOrd Float where@@ -104,6 +116,7 @@ x `geq` y = if x >= y then 1 else 0 x `gt` y = if x > y then 1 else 0 x `eq` y = if x == y then 1 else 0+ x `ne` y = if x /= y then 1 else 0 max' = max min' = min
src/Casadi/SX.hs view
@@ -157,6 +157,8 @@ {-# NOINLINE cor #-} repmat x (s1, s2) = unsafePerformIO (C.casadi_repmat__2 x s1 s2) {-# NOINLINE repmat #-}+ printme x y = unsafePerformIO (sx_printme x y)+ {-# NOINLINE printme #-} instance Num SX where@@ -232,6 +234,8 @@ {-# NOINLINE gt #-} x `eq` y = unsafePerformIO (C.casadi_eq__1 x y) {-# NOINLINE eq #-}+ x `ne` y = unsafePerformIO (C.casadi_ne__1 x y)+ {-# NOINLINE ne #-} max' x y = cmax x y {-# NOINLINE max' #-} min' x y = cmin x y