changeset 4043:6fae69a1796e

[project @ 2002-08-15 03:36:27 by jwe]
author jwe
date Thu, 15 Aug 2002 03:36:27 +0000
parents 8bc97120fbd5
children 9678c5526190
files liboctave/ChangeLog liboctave/DASPK.cc liboctave/DASRT.cc liboctave/DASSL.cc liboctave/LSODE.cc liboctave/ODESSA.cc
diffstat 6 files changed, 108 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog	Thu Aug 15 02:30:41 2002 +0000
+++ b/liboctave/ChangeLog	Thu Aug 15 03:36:27 2002 +0000
@@ -2,6 +2,10 @@
 
 	* LSODE.cc (LSODE::error_message): Also return current T on
 	failures when that makes sense.
+	* DASSL.cc (DASSL::error_message): Likewise.
+	* DASRT.cc (DASRT::error_message): Likewise.
+	* DASPK.cc (DASPK::error_message): Likewise.
+	* ODESSA.cc (ODESSA:error_message): Likewise.
 
 	* Makefile.in (liboct-pathsearch.$(SHLEXT_VER)): Link to
 	$(LIBKPATHSEA) here.
--- a/liboctave/DASPK.cc	Thu Aug 15 02:30:41 2002 +0000
+++ b/liboctave/DASPK.cc	Thu Aug 15 03:36:27 2002 +0000
@@ -31,6 +31,8 @@
 #include <cfloat>
 #include <cmath>
 
+#include <strstream>
+
 #include "DASPK.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
@@ -517,6 +519,12 @@
 {
   std::string retval;
 
+  std::ostrstream buf;
+  buf << t << ends;
+  const char *t = buf.str ();
+  std::string t_curr = t;
+  delete [] t;
+
   switch (istate)
     {
     case 1:
@@ -536,7 +544,8 @@
       break;
 
     case -1:
-      retval = "a large amount of work has been expended";
+      retval = std::string ("a large amount of work has been expended (t =")
+	+ t_curr + ")";
       break;
 
     case -2:
@@ -544,32 +553,39 @@
       break;
 
     case -3:
-      retval = "error weight became zero during problem.\
-  (solution component i vanished, and atol or atol(i) == 0)";
+      retval = std::string ("error weight became zero during problem. (t = ")
+	+ t_curr
+	+ "; solution component i vanished, and atol or atol(i) == 0)";
       break;
 
     case -6:
-      retval = "repeated error test failures on the last attempted step";
+      retval = std::string ("repeated error test failures on the last attempted step (t = ")
+	+ t_curr + ")";
       break;
 
     case -7:
-      retval = "the corrector could not converge";
+      retval = std::string ("the corrector could not converge (t = ")
+	+ t_curr + ")";
       break;
 
     case -8:
-      retval = "the matrix of partial derivatives is singular";
+      retval = std::string ("the matrix of partial derivatives is singular (t = ")
+	+ t_curr + ")";
       break;
 
     case -9:
-      retval = "the corrector could not converge (repeated test failures)";
+      retval = std::string ("the corrector could not converge (t = ")
+	+ t_curr + "; repeated test failures)";
       break;
 
     case -10:
-      retval = "corrector could not converge because IRES was -1";
+      retval = std::string ("corrector could not converge because IRES was -1 (t = ")
+	+ t_curr + ")";
       break;
 
     case -11:
-      retval = "return requested in user-supplied function";
+      retval = std::string ("return requested in user-supplied function (t = ")
+	+ t_curr + ")";
       break;
 
     case -12:
@@ -577,11 +593,13 @@
       break;
 
     case -13:
-      retval = "unrecoverable error encountered inside user's PSOL function";
+      retval = std::string ("unrecoverable error encountered inside user's PSOL function (t = ")
+	+ t_curr + ")";
       break;
 
     case -14:
-      retval = "the Krylov linear system solver failed to converge";
+      retval = std::string ("the Krylov linear system solver failed to converge (t = ")
+	+ t_curr + ")";
       break;
 
     case -33:
--- a/liboctave/DASRT.cc	Thu Aug 15 02:30:41 2002 +0000
+++ b/liboctave/DASRT.cc	Thu Aug 15 03:36:27 2002 +0000
@@ -28,8 +28,7 @@
 #include <config.h>
 #endif
 
-#include <iostream.h>
-#include <fstream.h>
+#include <strstream.h>
 
 #include <cstdlib>
 #include <cfloat>
@@ -581,6 +580,12 @@
 {
   std::string retval;
 
+  std::ostrstream buf;
+  buf << t << ends;
+  const char *t = buf.str ();
+  std::string t_curr = t;
+  delete [] t;
+
   switch (istate)
     {
     case 1:
@@ -600,7 +605,8 @@
       break;
 
     case -1:
-      retval = "a large amount of work has been expended";
+      retval = std::string ("a large amount of work has been expended (t =")
+	+ t_curr + ")";
       break;
 
     case -2:
@@ -608,32 +614,39 @@
       break;
 
     case -3:
-      retval = "error weight became zero during problem.\
-  (solution component i vanished, and atol or atol(i) == 0)";
+      retval = std::string ("error weight became zero during problem. (t = ")
+	+ t_curr
+	+ "; solution component i vanished, and atol or atol(i) == 0)";
       break;
 
     case -6:
-      retval = "repeated error test failures on the last attempted step";
+      retval = std::string ("repeated error test failures on the last attempted step (t = ")
+	+ t_curr + ")";
       break;
 
     case -7:
-      retval = "the corrector could not converge";
+      retval = std::string ("the corrector could not converge (t = ")
+	+ t_curr + ")";
       break;
 
     case -8:
-      retval = "the matrix of partial derivatives is singular";
+      retval = std::string ("the matrix of partial derivatives is singular (t = ")
+	+ t_curr + ")";
       break;
 
     case -9:
-      retval = "the corrector could not converge (repeated test failures)";
+      retval = std::string ("the corrector could not converge (t = ")
+	+ t_curr + "; repeated test failures)";
       break;
 
     case -10:
-      retval = "corrector could not converge because IRES was -1";
+      retval = std::string ("corrector could not converge because IRES was -1 (t = ")
+	+ t_curr + ")";
       break;
 
     case -11:
-      retval = "return requested in user-supplied function";
+      retval = std::string ("return requested in user-supplied function (t = ")
+	+ t_curr + ")";
       break;
 
     case -12:
--- a/liboctave/DASSL.cc	Thu Aug 15 02:30:41 2002 +0000
+++ b/liboctave/DASSL.cc	Thu Aug 15 03:36:27 2002 +0000
@@ -31,6 +31,8 @@
 #include <cfloat>
 #include <cmath>
 
+#include <strstream>
+
 #include "DASSL.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
@@ -481,6 +483,12 @@
 {
   std::string retval;
 
+  std::ostrstream buf;
+  buf << t << ends;
+  const char *t = buf.str ();
+  std::string t_curr = t;
+  delete [] t;
+
   switch (istate)
     {
     case 1:
@@ -496,7 +504,8 @@
       break;
 
     case -1:
-      retval = "a large amount of work has been expended";
+      retval = std::string ("a large amount of work has been expended (t =")
+	+ t_curr + ")";
       break;
 
     case -2:
@@ -504,32 +513,39 @@
       break;
 
     case -3:
-      retval = "error weight became zero during problem.\
-  (solution component i vanished, and atol or atol(i) == 0)";
+      retval = std::string ("error weight became zero during problem. (t = ")
+	+ t_curr
+	+ "; solution component i vanished, and atol or atol(i) == 0)";
       break;
 
     case -6:
-      retval = "repeated error test failures on the last attempted step";
+      retval = std::string ("repeated error test failures on the last attempted step (t = ")
+	+ t_curr + ")";
       break;
 
     case -7:
-      retval = "the corrector could not converge";
+      retval = std::string ("the corrector could not converge (t = ")
+	+ t_curr + ")";
       break;
 
     case -8:
-      retval = "the matrix of partial derivatives is singular";
+      retval = std::string ("the matrix of partial derivatives is singular (t = ")
+	+ t_curr + ")";
       break;
 
     case -9:
-      retval = "the corrector could not converge (repeated test failures)";
+      retval = std::string ("the corrector could not converge (t = ")
+	+ t_curr + "; repeated test failures)";
       break;
 
     case -10:
-      retval = "corrector could not converge because IRES was -1";
+      retval = std::string ("corrector could not converge because IRES was -1 (t = ")
+	+ t_curr + ")";
       break;
 
     case -11:
-      retval = "return requested in user-supplied function";
+      retval = std::string ("return requested in user-supplied function (t = ")
+	+ t_curr + ")";
       break;
 
     case -12:
--- a/liboctave/LSODE.cc	Thu Aug 15 02:30:41 2002 +0000
+++ b/liboctave/LSODE.cc	Thu Aug 15 03:36:27 2002 +0000
@@ -31,7 +31,6 @@
 #include <cfloat>
 #include <cmath>
 
-#include <iostream>
 #include <strstream>
 
 #include "LSODE.h"
@@ -302,7 +301,7 @@
   std::ostrstream buf;
   buf << t << ends;
   const char *t = buf.str ();
-  std::string curr_t = t;
+  std::string t_curr = t;
   delete [] t;
 
   switch (istate)
@@ -321,7 +320,7 @@
 	  
     case -1:
       retval = std::string ("excess work on this call (t = ")
-	+ curr_t + "; perhaps wrong integration method)";
+	+ t_curr + "; perhaps wrong integration method)";
       break;
 
     case -2:
@@ -334,24 +333,24 @@
 
     case -4:
       retval = std::string ("repeated error test failures (t = ")
-	+ curr_t + "check all inputs)";
+	+ t_curr + "check all inputs)";
       break;
 
     case -5:
       retval = std::string ("repeated convergence failures (t = ")
-	+ curr_t
+	+ t_curr
 	+ "perhaps bad jacobian supplied or wrong choice of integration method or tolerances)";
       break;
 
     case -6:
       retval = std::string ("error weight became zero during problem. (t = ")
-	+ curr_t
+	+ t_curr
 	+ "; solution component i vanished, and atol or atol(i) == 0)";
       break;
 
     case -13:
       retval = "return requested in user-supplied function (t = "
-	+ curr_t + ")";
+	+ t_curr + ")";
       break;
 
     default:
--- a/liboctave/ODESSA.cc	Thu Aug 15 02:30:41 2002 +0000
+++ b/liboctave/ODESSA.cc	Thu Aug 15 03:36:27 2002 +0000
@@ -28,12 +28,12 @@
 #include <config.h>
 #endif
 
-#include <iostream.h>
-
 #include <cstdlib>
 #include <cfloat>
 #include <cmath>
 
+#include <strstream>
+
 // For instantiating the Array<Matrix> object.
 #include "Array.h"
 #include "Array.cc"
@@ -457,6 +457,12 @@
 {
   std::string retval;
 
+  std::ostrstream buf;
+  buf << t << ends;
+  const char *t = buf.str ();
+  std::string t_curr = t;
+  delete [] t;
+
   switch (istate)
     {
     case 1:
@@ -472,7 +478,8 @@
       break;
           
     case -1:
-      retval = "excess work on this call (perhaps wrong integration method)";
+      retval = std::string ("excess work on this call (t = ")
+	+ t_curr + "; perhaps wrong integration method)";
       break;
 
     case -2:
@@ -484,21 +491,25 @@
       break;
 
     case -4:
-      retval = "repeated error test failures (check all inputs)";
+      retval = std::string ("repeated error test failures (t = ")
+	+ t_curr + "check all inputs)";
       break;
 
     case -5:
-      retval = "repeated convergence failures (perhaps bad jacobian\
- supplied or wrong choice of integration method or tolerances)";
+      retval = std::string ("repeated convergence failures (t = ")
+	+ t_curr
+	+ "perhaps bad jacobian supplied or wrong choice of integration method or tolerances)";
       break;
 
     case -6:
-      retval = "Error weight became zero during problem.\
-  (solution component i vanished, and atol or atol(i) == 0)";
+      retval = std::string ("error weight became zero during problem. (t = ")
+	+ t_curr
+	+ "; solution component i vanished, and atol or atol(i) == 0)";
       break;
 
     case -13:
-      retval = "return requested in user-supplied function";
+      retval = "return requested in user-supplied function (t = "
+	+ t_curr + ")";
       break;
 
     default: