changeset 22903:51c9eded34ee

Fix access method to sundials 2.7.0 sparse matrix structure. * libinterp/dldfunctions/__ode15__.cc : dereference twice colptrs/rowvals to access sundials sparse matrix structures.
author Carlo de Falco <carlo.defalco@polimi.it>
date Wed, 02 Nov 2016 06:28:24 +0100
parents 284bbb0328f2
children a1f1ab76aa64
files libinterp/dldfcn/__ode15__.cc
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/dldfcn/__ode15__.cc	Tue Nov 01 06:41:29 2016 +0100
+++ b/libinterp/dldfcn/__ode15__.cc	Wed Nov 02 06:28:24 2016 +0100
@@ -397,13 +397,15 @@
       jac = (*jacspcell) (spdfdy, spdfdyp, cj);
 
     SparseSetMatToZero (Jac);
-
+    int *colptrs = *(Jac -> colptrs);
+    int *rowvals = *(Jac -> rowvals);
+    
     for (int i = 0; i < num + 1; i++)
-      *(Jac -> colptrs)[i] = jac.cidx(i);
+      colptrs[i] = jac.cidx(i);
 
     for (int i = 0; i < jac.nnz (); i++)
       {
-        *(Jac -> rowvals)[i] = jac.ridx (i);
+        rowvals[i] = jac.ridx (i);
         Jac -> data[i] = jac.data (i);
       }