diff options
Diffstat (limited to 'packages/sundials/src/Arkode.hsc')
-rw-r--r-- | packages/sundials/src/Arkode.hsc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/sundials/src/Arkode.hsc b/packages/sundials/src/Arkode.hsc index ae2b40f..83d1127 100644 --- a/packages/sundials/src/Arkode.hsc +++ b/packages/sundials/src/Arkode.hsc | |||
@@ -4,7 +4,6 @@ module Arkode where | |||
4 | 4 | ||
5 | import Foreign | 5 | import Foreign |
6 | import Foreign.C.Types | 6 | import Foreign.C.Types |
7 | import Foreign.C.String | ||
8 | 7 | ||
9 | 8 | ||
10 | #include <stdio.h> | 9 | #include <stdio.h> |
@@ -14,12 +13,14 @@ import Foreign.C.String | |||
14 | #include <sunmatrix/sunmatrix_dense.h> | 13 | #include <sunmatrix/sunmatrix_dense.h> |
15 | #include <arkode/arkode.h> | 14 | #include <arkode/arkode.h> |
16 | 15 | ||
16 | |||
17 | #def typedef struct _generic_N_Vector SunVector; | 17 | #def typedef struct _generic_N_Vector SunVector; |
18 | #def typedef struct _N_VectorContent_Serial SunContent; | 18 | #def typedef struct _N_VectorContent_Serial SunContent; |
19 | 19 | ||
20 | #def typedef struct _generic_SUNMatrix SunMatrix; | 20 | #def typedef struct _generic_SUNMatrix SunMatrix; |
21 | #def typedef struct _SUNMatrixContent_Dense SunMatrixContent; | 21 | #def typedef struct _SUNMatrixContent_Dense SunMatrixContent; |
22 | 22 | ||
23 | getContentMatrixPtr :: Storable a => Ptr b -> IO a | ||
23 | getContentMatrixPtr ptr = (#peek SunMatrix, content) ptr | 24 | getContentMatrixPtr ptr = (#peek SunMatrix, content) ptr |
24 | 25 | ||
25 | getNRows :: Ptr b -> IO CInt | 26 | getNRows :: Ptr b -> IO CInt |
@@ -32,6 +33,7 @@ getNCols ptr = (#peek SunMatrixContent, N) ptr | |||
32 | putNCols :: CInt -> Ptr b -> IO () | 33 | putNCols :: CInt -> Ptr b -> IO () |
33 | putNCols nc ptr = (#poke SunMatrixContent, N) ptr nc | 34 | putNCols nc ptr = (#poke SunMatrixContent, N) ptr nc |
34 | 35 | ||
36 | getMatrixData :: Storable a => Ptr b -> IO a | ||
35 | getMatrixData ptr = (#peek SunMatrixContent, data) ptr | 37 | getMatrixData ptr = (#peek SunMatrixContent, data) ptr |
36 | 38 | ||
37 | getContentPtr :: Storable a => Ptr b -> IO a | 39 | getContentPtr :: Storable a => Ptr b -> IO a |