[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #59477] __ode15__.cc does not consider the num
From: |
Hg200 |
Subject: |
[Octave-bug-tracker] [bug #59477] __ode15__.cc does not consider the number of arguments in the event function |
Date: |
Wed, 18 Nov 2020 17:23:19 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0 |
Follow-up Comment #3, bug #59477 (project octave):
Thank you very much for the feedback. Your solution works very well. I like it
because it is less code-invasive than making the change in the C code. The
question about the runtime is a bit difficult to answer because it depends on
how often the event function is called (i.e. how many steps have to be
calculated) compared to the initialization overhead. To get some numbers I
made a tic / toc measurement over five consecutive program calls. The used
programs are attached. I have also attached the changes I made in
___ode15___.cc for the measurement. This should be what you suggest in comment
#2.
ode15s()
--------
i.) 2 to 3 wrapper in ode15s.m (odf15s-events-diff.txt)
6.31828+6.35755+6.25858+6.40452+6.29574
ii.) Adjust number of event function parameters in ___ode15___.cc
(events-c-solution-diff.txt)
5.80774+5.84905+5.73096+5.90781+6.24962
Conclusion: Wrapper 7% slower than C solution.
ode15i()
--------
i.) 2 to 3 wrapper in ode15s.m (has no effect on ode15i)
5.63038+5.9534+5.66035+5.75075+5.6973
ii.) Adjust number of event function parameters in ___ode15___.cc
(events-c-solution-diff.txt)
5.53875+5.62682+5.56293+5.62556+5.66299
Conclusion: Wrapper 2% slower than C solution (wrapper should not add overhead
in ode15i).
In my opinion both solutions are ok. Assuming that the measurement is ok, I
tend a little bit more to the simplicity at the expense of the runtime.
(file #50297, file #50298, file #50299)
_______________________________________________________
Additional Item Attachment:
File name: events-c-solution-diff.txt Size:9 KB
<https://file.savannah.gnu.org/file/events-c-solution-diff.txt?file_id=50297>
File name: ode15i_runtime.m Size:1 KB
<https://file.savannah.gnu.org/file/ode15i_runtime.m?file_id=50298>
File name: ode15s_runtime.m Size:0 KB
<https://file.savannah.gnu.org/file/ode15s_runtime.m?file_id=50299>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59477>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/