octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63229] Missing self test for option OutputSel


From: Ken Marek
Subject: [Octave-bug-tracker] [bug #63229] Missing self test for option OutputSel in ode23, ode23s, ode45
Date: Wed, 16 Nov 2022 17:26:03 -0500 (EST)

Follow-up Comment #5, bug #63229 (project octave):

I agree that this is generally not the preferred form for the test, but I'm
not sure any alternatives are more appealing. The problem is that the output
of OutputSel function is not returned directly to the outputs of ode{xx}.

Other than just not having a test (the status quo), the only other way to test
the OutputSel implementation without changing the code is to have the
OutputFcn return the stop signal (stop_solve) if there is a problem. We could
then test whether the final output of ode{xx} is the expected value, and infer
an error if not. If there is an error, we know that there was a failure in the
intermediate steps (flag==""). However, the return value of stop_solve is
ignored in the flag=="init" and flag=="done" calls, so without raising an
error in OutputFcn itself, problems in those calls are not testable.

I suppose another alternative would be to change the source code to query the
value of stop_solve more more than just true/false at each OutputFcn call, but
I'm pretty sure that would break Matlab compatibility and generally cause more
problems than it fixes. Or we could pass any nonzero return values of
stop_solve down the line and put it into the output struct of ode{xx}. It
would be extra code/overhead and an undocumented feature, but probably
wouldn't break compatibility.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63229>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]