diff options
author | Dominic Steinitz <dominic@steinitz.org> | 2018-03-31 13:06:35 +0100 |
---|---|---|
committer | Dominic Steinitz <dominic@steinitz.org> | 2018-03-31 13:06:35 +0100 |
commit | 3c4411e48cbcfaf8035e893ac63aa250fcc56d3e (patch) | |
tree | 0542a6ab2c68f2c9245dedf7e04d4e15e279cfd3 /packages/sundials/src/Arkode.hsc | |
parent | 5bcc77b1e115a8c8eb94a1aa1a441618bfeb0b54 (diff) |
Add in the Jacobian
Diffstat (limited to 'packages/sundials/src/Arkode.hsc')
-rw-r--r-- | packages/sundials/src/Arkode.hsc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/sundials/src/Arkode.hsc b/packages/sundials/src/Arkode.hsc index 59e701e..ae2b40f 100644 --- a/packages/sundials/src/Arkode.hsc +++ b/packages/sundials/src/Arkode.hsc | |||
@@ -9,12 +9,31 @@ import Foreign.C.String | |||
9 | 9 | ||
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #include <sundials/sundials_nvector.h> | 11 | #include <sundials/sundials_nvector.h> |
12 | #include <sundials/sundials_matrix.h> | ||
12 | #include <nvector/nvector_serial.h> | 13 | #include <nvector/nvector_serial.h> |
14 | #include <sunmatrix/sunmatrix_dense.h> | ||
13 | #include <arkode/arkode.h> | 15 | #include <arkode/arkode.h> |
14 | 16 | ||
15 | #def typedef struct _generic_N_Vector SunVector; | 17 | #def typedef struct _generic_N_Vector SunVector; |
16 | #def typedef struct _N_VectorContent_Serial SunContent; | 18 | #def typedef struct _N_VectorContent_Serial SunContent; |
17 | 19 | ||
20 | #def typedef struct _generic_SUNMatrix SunMatrix; | ||
21 | #def typedef struct _SUNMatrixContent_Dense SunMatrixContent; | ||
22 | |||
23 | getContentMatrixPtr ptr = (#peek SunMatrix, content) ptr | ||
24 | |||
25 | getNRows :: Ptr b -> IO CInt | ||
26 | getNRows ptr = (#peek SunMatrixContent, M) ptr | ||
27 | putNRows :: CInt -> Ptr b -> IO () | ||
28 | putNRows nr ptr = (#poke SunMatrixContent, M) ptr nr | ||
29 | |||
30 | getNCols :: Ptr b -> IO CInt | ||
31 | getNCols ptr = (#peek SunMatrixContent, N) ptr | ||
32 | putNCols :: CInt -> Ptr b -> IO () | ||
33 | putNCols nc ptr = (#poke SunMatrixContent, N) ptr nc | ||
34 | |||
35 | getMatrixData ptr = (#peek SunMatrixContent, data) ptr | ||
36 | |||
18 | getContentPtr :: Storable a => Ptr b -> IO a | 37 | getContentPtr :: Storable a => Ptr b -> IO a |
19 | getContentPtr ptr = (#peek SunVector, content) ptr | 38 | getContentPtr ptr = (#peek SunVector, content) ptr |
20 | 39 | ||