headmyshoulder / odeint-v2

odeint - solving ordinary differential equations in c++ v2
http://headmyshoulder.github.com/odeint-v2/
Other
337 stars 102 forks source link

the harmonic_oscillator_units.cpp example hangs #168

Closed slayoo closed 9 years ago

slayoo commented 9 years ago

Hello,

After compilation of the harmonic_oscillator_units.cpp example with either clang++ (3.6.0) or g++ (4.8.3) the program hangs producing no more output besides "0 s 1 m 0 m s^-1".

Changing the timestem from 0.1_si::seconds to 0.2_si::seconds helps.

Reported by Konrad Bugaj.

HTH, Sylwester & Konrad

mariomulansky commented 9 years ago

Hi, thanks for reporting. I've traced the problem down to some wrong checks deep inside odeint. I think I managed to fix the problem, which only appeared with boost::units as their numerical_limits::epsilon() values are 0. With the usual double/float this could not have happened.

Let me know if you still find problems.