[Scipy-svn] r4475 - trunk/scipy/integrate

scipy-svn at scipy.org scipy-svn at scipy.org
Tue Jun 24 07:41:25 EDT 2008


Author: cdavid
Date: 2008-06-24 06:41:19 -0500 (Tue, 24 Jun 2008)
New Revision: 4475

Modified:
   trunk/scipy/integrate/__odepack.h
   trunk/scipy/integrate/odepack.py
Log:
Do not set imxer to unitiliazed value if not set by fortran.

Modified: trunk/scipy/integrate/__odepack.h
===================================================================
--- trunk/scipy/integrate/__odepack.h	2008-06-24 10:52:35 UTC (rev 4474)
+++ trunk/scipy/integrate/__odepack.h	2008-06-24 11:41:19 UTC (rev 4475)
@@ -326,7 +326,11 @@
       *((int *)ap_nfe->data + (k-1)) = iwork[11];
       *((int *)ap_nje->data + (k-1)) = iwork[12];
       *((int *)ap_nqu->data + (k-1)) = iwork[13];
-      imxer = iwork[15];
+      if (istate == -5 || istate == -4) {
+        imxer = iwork[15];
+      } else {
+        imxer = -1;
+      }
       lenrw = iwork[16];
       leniw = iwork[17];
       *((int *)ap_mused->data + (k-1)) = iwork[18];
@@ -348,7 +352,20 @@
 
   /* Do Full output */
     if (full_output) {
-      return Py_BuildValue("N{s:N,s:N,s:N,s:N,s:N,s:N,s:N,s:N,s:i,s:i,s:i,s:N}i",PyArray_Return(ap_yout),"hu",PyArray_Return(ap_hu),"tcur",PyArray_Return(ap_tcur),"tolsf",PyArray_Return(ap_tolsf),"tsw",PyArray_Return(ap_tsw),"nst",PyArray_Return(ap_nst),"nfe",PyArray_Return(ap_nfe),"nje",PyArray_Return(ap_nje),"nqu",PyArray_Return(ap_nqu),"imxer",imxer,"lenrw",lenrw,"leniw",leniw,"mused",PyArray_Return(ap_mused),istate);
+      return Py_BuildValue("N{s:N,s:N,s:N,s:N,s:N,s:N,s:N,s:N,s:i,s:i,s:i,s:N}i",PyArray_Return(ap_yout),
+                      "hu",PyArray_Return(ap_hu),
+                      "tcur",PyArray_Return(ap_tcur),
+                      "tolsf",PyArray_Return(ap_tolsf),
+                      "tsw",PyArray_Return(ap_tsw),
+                      "nst",PyArray_Return(ap_nst),
+                      "nfe",PyArray_Return(ap_nfe),
+                      "nje",PyArray_Return(ap_nje),
+                      "nqu",PyArray_Return(ap_nqu),
+                      "imxer",imxer,
+                      "lenrw",lenrw,
+                      "leniw",leniw,
+                      "mused",PyArray_Return(ap_mused),
+                      istate);
     }
     else {
       return Py_BuildValue("Ni",PyArray_Return(ap_yout),istate);

Modified: trunk/scipy/integrate/odepack.py
===================================================================
--- trunk/scipy/integrate/odepack.py	2008-06-24 10:52:35 UTC (rev 4474)
+++ trunk/scipy/integrate/odepack.py	2008-06-24 11:41:19 UTC (rev 4475)
@@ -78,7 +78,8 @@
         'nje'    cumulative number of jacobian evaluations for each time step
         'nqu'    a vector of method orders for each successful step.
         'imxer'  index of the component of largest magnitude in the
-                 weighted local error vector (e / ewt) on an error return.
+                 weighted local error vector (e / ewt) on an error return, -1
+                 otherwise.
         'lenrw'  the length of the double work array required.
         'leniw'  the length of integer work array required.
         'mused'  a vector of method indicators for each successful time step:




More information about the Scipy-svn mailing list