Mercurial > hg > octave-terminal
changeset 4132:87eb044020ae
[project @ 2002-10-29 21:21:45 by jwe]
author | jwe |
---|---|
date | Tue, 29 Oct 2002 21:21:45 +0000 |
parents | 597fbc55ea40 |
children | 402d7b86a0a2 |
files | liboctave/ChangeLog liboctave/NLEqn.cc src/ChangeLog src/DLD-FUNCTIONS/fsolve.cc |
diffstat | 4 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2002-10-29 John W. Eaton <jwe@bevo.che.wisc.edu> + + * NLEqn.cc (NLEqn::solve): Return current estimate of solution + instead of empty vector if user termninates iteration. + 2002-10-28 John W. Eaton <jwe@bevo.che.wisc.edu> * lo-utils.cc (read_inf_nan_na, octave_read_double,
--- a/liboctave/NLEqn.cc +++ b/liboctave/NLEqn.cc @@ -187,9 +187,6 @@ (*current_liboctave_error_handler) ("unrecoverable error in hybrd1"); } - if (info < 0) - retval.resize (0); - return retval; }
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2002-10-29 John W. Eaton <jwe@bevo.che.wisc.edu> + * DLD-FUNCTIONS/fsolve.cc (Ffsolve): Always return solution. + Don't barf on nargout == 3. + * pt-idx.h (tree_index_expression::dyn_field): New data member. * pt-idx.cc (tree_index_expression::tree_index_expression (tree_expression*, tree_expression*, int, int)): New constructor.
--- a/src/DLD-FUNCTIONS/fsolve.cc +++ b/src/DLD-FUNCTIONS/fsolve.cc @@ -185,10 +185,10 @@ if (error_state) FSOLVE_ABORT1 ("expecting vector as second argument"); - if (nargin > 2) + if (nargin > 3) warning ("fsolve: ignoring extra arguments"); - if (nargout > 2) + if (nargout > 3) warning ("fsolve: can't compute path output yet"); NLFunc nleqn_fcn (fsolve_user_function); @@ -205,15 +205,10 @@ retval(2) = msg; retval(1) = static_cast<double> (hybrd_info_to_fsolve_info (info)); - if (nleqn.solution_ok ()) - retval(0) = soln; - else - { - retval(0) = Matrix (); + retval(0) = soln; - if (nargout < 2) - error ("fsolve: %s", msg.c_str ()); - } + if (! nleqn.solution_ok () && nargout < 2) + error ("fsolve: %s", msg.c_str ()); } } else