changeset 252:bc5e6cb785d1

[project @ 1993-12-06 21:52:57 by jwe]
author jwe
date Mon, 06 Dec 1993 21:57:51 +0000
parents d2ada1d8b70c
children e208bd9ade36
files liboctave/NLEqn.h liboctave/NLFunc.h scripts/general/perror.m src/fsolve.cc src/input.cc
diffstat 5 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/NLEqn.h
+++ b/liboctave/NLEqn.h
@@ -62,7 +62,6 @@
   Vector x;
 
   void error (const char* msg);
-
 };
 
 #endif
--- a/liboctave/NLFunc.h
+++ b/liboctave/NLFunc.h
@@ -57,7 +57,6 @@
 
   nonlinear_fcn fun;
   jacobian_fcn jac;
-
 };
 
 #endif
--- a/scripts/general/perror.m
+++ b/scripts/general/perror.m
@@ -41,8 +41,10 @@
 
   if (strcmp (name, "fsolve"))
 
-    if (err == -1)
+    if (err == -2)
       printf ("input error\n");
+    elseif (err == -1)
+      printf ("error encountered in user-supplied function\n");
     elseif (err == 1)
       printf ("solution converged to requested tolerance\n");
     elseif (err == 4)
--- a/src/fsolve.cc
+++ b/src/fsolve.cc
@@ -50,6 +50,9 @@
 {
   switch (info)
     {
+    case -1:
+      info = -2;
+      break;
     case 0:
       info = -1;
       break;
@@ -103,13 +106,16 @@
       if (tmp != NULL_TREE_CONST && tmp[0].is_defined ())
 	{
 	  retval = tmp[0].to_vector ();
+
 	  delete [] tmp;
+
+	  if (retval.length () <= 0)
+	    gripe_user_supplied_eval ("fsolve");
 	}
       else
 	{
 	  delete [] tmp;
 	  gripe_user_supplied_eval ("fsolve");
-	  jump_to_top_level ();
 	}
     }
 
--- a/src/input.cc
+++ b/src/input.cc
@@ -38,6 +38,8 @@
 {
 #include "readline/readline.h"
 
+extern char *xmalloc ();
+
 /*
  * Yes, this sucks, but it avoids a conflict with another readline
  * function declared in iostream.h.