From 71903cf575c31a15f9385659445c65fd85d22246 Mon Sep 17 00:00:00 2001 From: Dominic Steinitz Date: Mon, 19 Mar 2018 16:41:18 +0000 Subject: Even more simplification --- packages/sundials/src/helpers.c | 21 --------------------- packages/sundials/sundials.cabal | 27 +-------------------------- 2 files changed, 1 insertion(+), 47 deletions(-) (limited to 'packages') diff --git a/packages/sundials/src/helpers.c b/packages/sundials/src/helpers.c index f3fe40b..420d3be 100644 --- a/packages/sundials/src/helpers.c +++ b/packages/sundials/src/helpers.c @@ -8,12 +8,6 @@ #include /* definition of type realtype */ #include -#include "farkode.h" - -#include -#include "Main_stub.h" - - /* Check function return value... opt == 0 means SUNDIALS function allocates memory so check if returned NULL pointer @@ -49,21 +43,6 @@ int check_flag(void *flagvalue, const char *funcname, int opt) return 0; } -/* Jacobian routine to compute J(t,y) = df/dy. */ -int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, - void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) -{ - realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */ - realtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ - realtype *Jdata = SUNDenseMatrix_Data(J); - - /* Fill in Jacobian of f: set the first entry of the data array to set the (0,0) entry */ - Jdata[0] = lamda; - - return 0; /* return with success */ -} - - /* check the computed solution */ int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) { diff --git a/packages/sundials/sundials.cabal b/packages/sundials/sundials.cabal index 9b2db12..43a83d0 100644 --- a/packages/sundials/sundials.cabal +++ b/packages/sundials/sundials.cabal @@ -18,19 +18,9 @@ cabal-version: >=1.10 extra-source-files: src/helpers.c, src/helpers.h -executable ExportAndImport.dylib - main-is: ExportAndImport.hs - other-extensions: ForeignFunctionInterface - build-depends: base >=4.10 - hs-source-dirs: src - default-language: Haskell2010 - include-dirs: src - ghc-options: -O2 -shared -fPIC -dynamic - extra-libraries: HSrts-ghc8.2.2 - executable sundials main-is: Main.hs - -- other-modules: + other-modules: Types other-extensions: QuasiQuotes, TemplateHaskell, MultiWayIf, OverloadedStrings build-depends: base >=4.10 && <4.11, inline-c >=0.6 && <0.7, @@ -41,18 +31,3 @@ executable sundials default-language: Haskell2010 extra-libraries: sundials_arkode C-sources: src/helpers.c src/helpers.h - -executable hsundials.dylib - main-is: Main.hs - -- other-modules: - other-extensions: QuasiQuotes, TemplateHaskell, MultiWayIf, OverloadedStrings - build-depends: base >=4.10 && <4.11, - inline-c >=0.6 && <0.7, - vector >=0.12 && <0.13, - template-haskell >=2.12 && <2.13, - containers >=0.5 && <0.6 - hs-source-dirs: src - ghc-options: -O2 -shared -fPIC -dynamic - default-language: Haskell2010 - extra-libraries: sundials_arkode, HSrts-ghc8.2.2 - C-sources: src/helpers.c src/helpers.h -- cgit v1.2.3