Boost C++ Libraries: Ticket #13524: Parameter mismatch on make_controlled factory (incorrectly constructed controlled_runge_kutta) https://svn.boost.org/trac10/ticket/13524 <p> While constructing a <em>controlled_runge_kutta</em> (might also affect other) using the <em>make_controlled</em> factory, the constructor of <em>controlled_runge_kutta</em> gets passed the wrong parameters. The factory calls the constructor with <em>(abs_error, rel_error, stepper)</em>, instead of the actual parameters of the constructor <em>(error_checker, step_adjuster, stepper)</em>. (see <em>"boost/numeric/odeint/stepper/generation/make_controlled.hpp:44"</em> and <em>"boost/numeric/odeint/stepper/controlled_runge_kutta.hpp:247"</em>) This yields no compile error, since the respective class has the type of these paramerts as templates and the constructors of the actual expected types have all default parameters, without being explicit. This leads to the practically invisible error, where the passed values construct the types, expected by the constructor of controlled_runge_kutta, by populating the first parameter each (effectivly using these constructors as conversion constructors). </p> <p> Note: This leads to the maximal step size being set to the relative error limit and the relative error limit being set to the default value of 10<sup>-6</sup>. Since one usually sets the relative error limit to a rather low value (like the default 10<sup>-6</sup>), this causes the controller to split usually small enough steps into even smaller, thus thousands of, substeps, drastically increasing computation time. </p> <p> I was able to notice this behavior while debugging why my calculation of the controlled runge kutta uses unreasonably many substeps, while the constant step size runge kutta got a error estimated much lower then the error limit of the controller while doing the whole interval in only one step. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13524 Trac 1.4.3 J.Saffer <j.saffer@…> Mon, 16 Apr 2018 15:50:13 GMT <link>https://svn.boost.org/trac10/ticket/13524#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13524#comment:1</guid> <description> <p> I had reported this bug a while ago on Github <a class="ext-link" href="https://github.com/headmyshoulder/odeint-v2/issues/228"><span class="icon">​</span>https://github.com/headmyshoulder/odeint-v2/issues/228</a> and only now realised, that one is supposed to report them here. </p> </description> <category>Ticket</category> </item> </channel> </rss>