summaryrefslogtreecommitdiff
path: root/packages/sundials/src/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sundials/src/Main.hs')
-rw-r--r--packages/sundials/src/Main.hs19
1 files changed, 4 insertions, 15 deletions
diff --git a/packages/sundials/src/Main.hs b/packages/sundials/src/Main.hs
index ab5b153..b3ebcb3 100644
--- a/packages/sundials/src/Main.hs
+++ b/packages/sundials/src/Main.hs
@@ -1,3 +1,5 @@
1{-# OPTIONS_GHC -Wall #-}
2
1{-# LANGUAGE QuasiQuotes #-} 3{-# LANGUAGE QuasiQuotes #-}
2{-# LANGUAGE TemplateHaskell #-} 4{-# LANGUAGE TemplateHaskell #-}
3{-# LANGUAGE MultiWayIf #-} 5{-# LANGUAGE MultiWayIf #-}
@@ -9,29 +11,15 @@ import qualified Language.C.Inline.Unsafe as CU
9import Data.Monoid ((<>)) 11import Data.Monoid ((<>))
10import Foreign.C.Types 12import Foreign.C.Types
11import Foreign.Ptr (Ptr) 13import Foreign.Ptr (Ptr)
12import Foreign.Marshal.Array
13import qualified Data.Vector.Storable as V 14import qualified Data.Vector.Storable as V
14 15
15import Data.Coerce (coerce) 16import Data.Coerce (coerce)
16import Data.Monoid ((<>))
17import qualified Data.Vector.Storable as V
18import qualified Data.Vector.Storable.Mutable as VM 17import qualified Data.Vector.Storable.Mutable as VM
19import Foreign.C.Types
20import Foreign.ForeignPtr (newForeignPtr_) 18import Foreign.ForeignPtr (newForeignPtr_)
21import Foreign.Ptr (Ptr)
22import Foreign.Storable (Storable) 19import Foreign.Storable (Storable)
23import qualified Language.C.Inline as C
24import qualified Language.C.Inline.Unsafe as CU
25import System.IO.Unsafe (unsafePerformIO) 20import System.IO.Unsafe (unsafePerformIO)
26 21
27import qualified Language.Haskell.TH as TH 22import Foreign.Storable (peekByteOff)
28import qualified Language.C.Types as CT
29import qualified Data.Map as Map
30import Language.C.Inline.Context
31
32import Foreign.C.String
33import Foreign.Storable (peek, poke, peekByteOff, pokeByteOff)
34import Data.Int
35 23
36import qualified Types as T 24import qualified Types as T
37 25
@@ -237,6 +225,7 @@ solveOdeC fun f0 = unsafePerformIO $ do
237 } |] 225 } |]
238 return res 226 return res
239 227
228main :: IO ()
240main = do 229main = do
241 let res = solveOdeC (coerce stiffish) (V.fromList [1.0]) 230 let res = solveOdeC (coerce stiffish) (V.fromList [1.0])
242 putStrLn $ show res 231 putStrLn $ show res