summaryrefslogtreecommitdiff
path: root/packages/sundials/src/Arkode.hsc
diff options
context:
space:
mode:
authorDominic Steinitz <dominic@steinitz.org>2018-03-31 13:06:35 +0100
committerDominic Steinitz <dominic@steinitz.org>2018-03-31 13:06:35 +0100
commit3c4411e48cbcfaf8035e893ac63aa250fcc56d3e (patch)
tree0542a6ab2c68f2c9245dedf7e04d4e15e279cfd3 /packages/sundials/src/Arkode.hsc
parent5bcc77b1e115a8c8eb94a1aa1a441618bfeb0b54 (diff)
Add in the Jacobian
Diffstat (limited to 'packages/sundials/src/Arkode.hsc')
-rw-r--r--packages/sundials/src/Arkode.hsc19
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
23getContentMatrixPtr ptr = (#peek SunMatrix, content) ptr
24
25getNRows :: Ptr b -> IO CInt
26getNRows ptr = (#peek SunMatrixContent, M) ptr
27putNRows :: CInt -> Ptr b -> IO ()
28putNRows nr ptr = (#poke SunMatrixContent, M) ptr nr
29
30getNCols :: Ptr b -> IO CInt
31getNCols ptr = (#peek SunMatrixContent, N) ptr
32putNCols :: CInt -> Ptr b -> IO ()
33putNCols nc ptr = (#poke SunMatrixContent, N) ptr nc
34
35getMatrixData ptr = (#peek SunMatrixContent, data) ptr
36
18getContentPtr :: Storable a => Ptr b -> IO a 37getContentPtr :: Storable a => Ptr b -> IO a
19getContentPtr ptr = (#peek SunVector, content) ptr 38getContentPtr ptr = (#peek SunVector, content) ptr
20 39