diff options
Diffstat (limited to 'packages/sundials/src/Main.hs')
-rw-r--r-- | packages/sundials/src/Main.hs | 19 |
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 | |||
9 | import Data.Monoid ((<>)) | 11 | import Data.Monoid ((<>)) |
10 | import Foreign.C.Types | 12 | import Foreign.C.Types |
11 | import Foreign.Ptr (Ptr) | 13 | import Foreign.Ptr (Ptr) |
12 | import Foreign.Marshal.Array | ||
13 | import qualified Data.Vector.Storable as V | 14 | import qualified Data.Vector.Storable as V |
14 | 15 | ||
15 | import Data.Coerce (coerce) | 16 | import Data.Coerce (coerce) |
16 | import Data.Monoid ((<>)) | ||
17 | import qualified Data.Vector.Storable as V | ||
18 | import qualified Data.Vector.Storable.Mutable as VM | 17 | import qualified Data.Vector.Storable.Mutable as VM |
19 | import Foreign.C.Types | ||
20 | import Foreign.ForeignPtr (newForeignPtr_) | 18 | import Foreign.ForeignPtr (newForeignPtr_) |
21 | import Foreign.Ptr (Ptr) | ||
22 | import Foreign.Storable (Storable) | 19 | import Foreign.Storable (Storable) |
23 | import qualified Language.C.Inline as C | ||
24 | import qualified Language.C.Inline.Unsafe as CU | ||
25 | import System.IO.Unsafe (unsafePerformIO) | 20 | import System.IO.Unsafe (unsafePerformIO) |
26 | 21 | ||
27 | import qualified Language.Haskell.TH as TH | 22 | import Foreign.Storable (peekByteOff) |
28 | import qualified Language.C.Types as CT | ||
29 | import qualified Data.Map as Map | ||
30 | import Language.C.Inline.Context | ||
31 | |||
32 | import Foreign.C.String | ||
33 | import Foreign.Storable (peek, poke, peekByteOff, pokeByteOff) | ||
34 | import Data.Int | ||
35 | 23 | ||
36 | import qualified Types as T | 24 | import 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 | ||
228 | main :: IO () | ||
240 | main = do | 229 | main = 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 |