diff options
Diffstat (limited to 'packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs')
-rw-r--r-- | packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs b/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs index 8b713c6..a8d418b 100644 --- a/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs +++ b/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs | |||
@@ -1,5 +1,3 @@ | |||
1 | {-# OPTIONS_GHC -Wall #-} | ||
2 | |||
3 | {-# LANGUAGE QuasiQuotes #-} | 1 | {-# LANGUAGE QuasiQuotes #-} |
4 | {-# LANGUAGE TemplateHaskell #-} | 2 | {-# LANGUAGE TemplateHaskell #-} |
5 | {-# LANGUAGE MultiWayIf #-} | 3 | {-# LANGUAGE MultiWayIf #-} |
@@ -141,9 +139,9 @@ import Numeric.LinearAlgebra.HMatrix (Vector, Matrix, toList, (><), | |||
141 | subMatrix, rows, cols, toLists, | 139 | subMatrix, rows, cols, toLists, |
142 | size, subVector) | 140 | size, subVector) |
143 | 141 | ||
144 | import qualified Types as T | 142 | import qualified Numeric.Sundials.CLangToHaskellTypes as T |
145 | import Arkode | 143 | import Numeric.Sundials.Arkode |
146 | import qualified Arkode as B | 144 | import qualified Numeric.Sundials.Arkode as B |
147 | import qualified Numeric.Sundials.ODEOpts as SO | 145 | import qualified Numeric.Sundials.ODEOpts as SO |
148 | 146 | ||
149 | 147 | ||
@@ -160,7 +158,7 @@ C.include "<arkode/arkode_direct.h>" -- access to ARKDls interface | |||
160 | C.include "<sundials/sundials_types.h>" -- definition of type realtype | 158 | C.include "<sundials/sundials_types.h>" -- definition of type realtype |
161 | C.include "<sundials/sundials_math.h>" | 159 | C.include "<sundials/sundials_math.h>" |
162 | C.include "../../../helpers.h" | 160 | C.include "../../../helpers.h" |
163 | C.include "Arkode_hsc.h" | 161 | C.include "Numeric/Sundials/Arkode_hsc.h" |
164 | 162 | ||
165 | 163 | ||
166 | type Jacobian = Double -> Vector Double -> Matrix Double | 164 | type Jacobian = Double -> Vector Double -> Matrix Double |
@@ -448,7 +446,7 @@ solveOdeC method initStepSize jacH (absTols, relTol) fun f0 ts = unsafePerformIO | |||
448 | diagnostics :: V.Vector CLong <- createVector 10 -- FIXME | 446 | diagnostics :: V.Vector CLong <- createVector 10 -- FIXME |
449 | diagMut <- V.thaw diagnostics | 447 | diagMut <- V.thaw diagnostics |
450 | -- We need the types that sundials expects. These are tied together | 448 | -- We need the types that sundials expects. These are tied together |
451 | -- in 'Types'. FIXME: The Haskell type is currently empty! | 449 | -- in 'CLangToHaskellTypes'. FIXME: The Haskell type is currently empty! |
452 | let funIO :: CDouble -> Ptr T.SunVector -> Ptr T.SunVector -> Ptr () -> IO CInt | 450 | let funIO :: CDouble -> Ptr T.SunVector -> Ptr T.SunVector -> Ptr () -> IO CInt |
453 | funIO x y f _ptr = do | 451 | funIO x y f _ptr = do |
454 | -- Convert the pointer we get from C (y) to a vector, and then | 452 | -- Convert the pointer we get from C (y) to a vector, and then |
@@ -516,7 +514,7 @@ solveOdeC method initStepSize jacH (absTols, relTol) fun f0 ts = unsafePerformIO | |||
516 | /* problem as fully implicit and set f_E to NULL and f_I to f. */ | 514 | /* problem as fully implicit and set f_E to NULL and f_I to f. */ |
517 | 515 | ||
518 | /* Here we use the C types defined in helpers.h which tie up with */ | 516 | /* Here we use the C types defined in helpers.h which tie up with */ |
519 | /* the Haskell types defined in Types */ | 517 | /* the Haskell types defined in CLangToHaskellTypes */ |
520 | if ($(int method) < MIN_DIRK_NUM) { | 518 | if ($(int method) < MIN_DIRK_NUM) { |
521 | flag = ARKodeInit(arkode_mem, $fun:(int (* funIO) (double t, SunVector y[], SunVector dydt[], void * params)), NULL, T0, y); | 519 | flag = ARKodeInit(arkode_mem, $fun:(int (* funIO) (double t, SunVector y[], SunVector dydt[], void * params)), NULL, T0, y); |
522 | if (check_flag(&flag, "ARKodeInit", 1)) return 1; | 520 | if (check_flag(&flag, "ARKodeInit", 1)) return 1; |