changeset 26895:a1acd11bad19

Directly include klu.h in __ode15__.cc (bug #52475). * libinterp/dldfcn/__ode15__.cc : include klu.h before sunlinsol_klu.h so that the correct include path is used. * libinterp/dldfcn/__ode15__.cc : add a FIXME comment about excess memory being allocated for sparse jacobian.
author Carlo de Falco <carlo.defalco@polimi.it>
date Wed, 13 Mar 2019 03:44:11 +0100
parents ee6300e77c92
children 9fa577cf9f4e
files libinterp/dldfcn/__ode15__.cc m4/acinclude.m4
diffstat 2 files changed, 27 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/dldfcn/__ode15__.cc	Fri Feb 15 12:35:15 2019 +0100
+++ b/libinterp/dldfcn/__ode15__.cc	Wed Mar 13 03:44:11 2019 +0100
@@ -67,6 +67,18 @@
 
 
 #  if defined (HAVE_SUNLINSOL_SUNLINSOL_KLU_H)
+#    if defined (HAVE_KLU_H)
+#      include <klu.h>
+#    endif
+#    if defined (HAVE_KLU_KLU_H)
+#      include <klu/klu.h>
+#    endif
+#    if defined (HAVE_SUITESPARSE_KLU_H)
+#      include <suitesparse/klu.h>
+#    endif
+#    if defined (HAVE_UFPARSE_KLU_H)
+#      include <ufsparse/klu.h>
+#    endif
 #    include <sunlinsol/sunlinsol_klu.h>
 #  endif
 
@@ -355,7 +367,9 @@
     if (havejacsparse)
       {
 #if defined (HAVE_SUNDIALS_SUNLINSOL_KLU)
-
+        // FIXME : one should not allocate space for a full Jacobian
+        // when using a sparse format. Consider allocating less space
+        // then possibly using SUNSparseMatrixReallocate to increase it.
         sunJacMatrix = SUNSparseMatrix (num, num, num*num, CSC_MAT);
         if (! sunJacMatrix)
           error ("Unable to create sparse Jacobian for Sundials");
--- a/m4/acinclude.m4	Fri Feb 15 12:35:15 2019 +0100
+++ b/m4/acinclude.m4	Wed Mar 13 03:44:11 2019 +0100
@@ -2249,6 +2249,18 @@
          #if defined (HAVE_SUNDIALS_SUNDIALS_SPARSE_H)
          #include <sundials/sundials_sparse.h>
          #endif
+         #if defined (HAVE_KLU_H)
+         #include <klu.h>
+         #endif
+         #if defined (HAVE_KLU_KLU_H)
+         #include <klu/klu.h>
+         #endif
+         #if defined (HAVE_SUITESPARSE_KLU_H)
+         #include <suitesparse/klu.h>
+         #endif
+         #if defined (HAVE_UFPARSE_KLU_H)
+         #include <ufsparse/klu.h>
+         #endif
          #if defined (HAVE_SUNLINSOL_SUNLINSOL_KLU_H)
          #include <sunlinsol/sunlinsol_klu.h>
          #endif