# HG changeset patch # User jwe # Date 755215071 0 # Node ID bc5e6cb785d1923701ba4e07201b357b008c2dac # Parent d2ada1d8b70caa467815c21c781653cad64150a0 [project @ 1993-12-06 21:52:57 by jwe] diff --git a/liboctave/NLEqn.h b/liboctave/NLEqn.h --- a/liboctave/NLEqn.h +++ b/liboctave/NLEqn.h @@ -62,7 +62,6 @@ Vector x; void error (const char* msg); - }; #endif diff --git a/liboctave/NLFunc.h b/liboctave/NLFunc.h --- a/liboctave/NLFunc.h +++ b/liboctave/NLFunc.h @@ -57,7 +57,6 @@ nonlinear_fcn fun; jacobian_fcn jac; - }; #endif diff --git a/scripts/general/perror.m b/scripts/general/perror.m --- 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) diff --git a/src/fsolve.cc b/src/fsolve.cc --- 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 (); } } diff --git a/src/input.cc b/src/input.cc --- 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.