I have been experimenting with the new adaptive Adams-Bashforth-Moulton stepper recently merged into odeint-v2. However, I've noticed that it doesn't play so well with floating-point value types other than double because some code in controlled_adams_bashforth_moulton.hpp, adaptive_adams_coefficients.hpp and pid_step_adjuster.hpp extract absolute values using fabs() without a namespace qualifier.
My understanding is that unqualified fabs() doesn't have overloads for types other than double (eg. http://www.cplusplus.com/reference/cmath/fabs/) — for example, at least on my platform there is already a problem at the level of using long double which clang warns will be implicitly narrowed to double. My understanding is that only std::fabs() or std::abs() have overloads for other types, and this seems to fit with the rest of odeint-v2 where std::abs() is normally used except for some parts of the vexcl interface.
This patch changes the uses of fabs() for std::abs() in just the three files mentioned at the top.
I have been experimenting with the new adaptive Adams-Bashforth-Moulton stepper recently merged into odeint-v2. However, I've noticed that it doesn't play so well with floating-point value types other than
double
because some code incontrolled_adams_bashforth_moulton.hpp
,adaptive_adams_coefficients.hpp
andpid_step_adjuster.hpp
extract absolute values usingfabs()
without a namespace qualifier.My understanding is that unqualified
fabs()
doesn't have overloads for types other than double (eg. http://www.cplusplus.com/reference/cmath/fabs/) — for example, at least on my platform there is already a problem at the level of usinglong double
which clang warns will be implicitly narrowed todouble
. My understanding is that onlystd::fabs()
orstd::abs()
have overloads for other types, and this seems to fit with the rest of odeint-v2 wherestd::abs()
is normally used except for some parts of thevexcl
interface.This patch changes the uses of
fabs()
forstd::abs()
in just the three files mentioned at the top.