Mercurial > octave
comparison libinterp/corefcn/lsode.cc @ 20892:c07bee629973
2015 Code Sprint: use ovl ().
author | Rik <rik@octave.org> |
---|---|
date | Mon, 14 Dec 2015 11:28:48 -0800 |
parents | 1142cf6abc0d |
children | 8da80da1ac37 |
comparison
equal
deleted
inserted
replaced
20891:95c0d4c07c56 | 20892:c07bee629973 |
---|---|
259 You can use the function @code{lsode_options} to set optional\n\ | 259 You can use the function @code{lsode_options} to set optional\n\ |
260 parameters for @code{lsode}.\n\ | 260 parameters for @code{lsode}.\n\ |
261 @seealso{daspk, dassl, dasrt}\n\ | 261 @seealso{daspk, dassl, dasrt}\n\ |
262 @end deftypefn") | 262 @end deftypefn") |
263 { | 263 { |
264 octave_value_list retval; | 264 octave_value_list retval (3); |
265 | 265 |
266 warned_fcn_imaginary = false; | 266 warned_fcn_imaginary = false; |
267 warned_jac_imaginary = false; | 267 warned_jac_imaginary = false; |
268 | 268 |
269 unwind_protect frame; | 269 unwind_protect frame; |
425 if (jac_name.length ()) | 425 if (jac_name.length ()) |
426 clear_function (jac_name); | 426 clear_function (jac_name); |
427 | 427 |
428 std::string msg = ode.error_message (); | 428 std::string msg = ode.error_message (); |
429 | 429 |
430 retval(2) = msg; | |
431 retval(1) = static_cast<double> (ode.integration_state ()); | |
432 | |
433 if (ode.integration_ok ()) | 430 if (ode.integration_ok ()) |
434 retval(0) = output; | 431 retval(0) = output; |
432 else if (nargout < 2) | |
433 error ("lsode: %s", msg.c_str ()); | |
435 else | 434 else |
436 { | 435 retval(0) = Matrix (); |
437 retval(0) = Matrix (); | 436 |
438 | 437 retval(1) = static_cast<double> (ode.integration_state ()); |
439 if (nargout < 2) | 438 retval(2) = msg; |
440 error ("lsode: %s", msg.c_str ()); | |
441 } | |
442 | 439 |
443 return retval; | 440 return retval; |
444 } | 441 } |
445 | 442 |
446 /* | 443 /* |