headmyshoulder / odeint-v2

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

integrate_const returns wrong number of steps for controlled_stepper when observer is given #125

Closed Ablinne closed 10 years ago

Ablinne commented 10 years ago

The documentation states "integrate_const returns the number of steps performed during the integration.".

However, if integrate_const( stepper , system , x0 , t0 , t1 , dt , observer ) is called with a controlled_stepper, roughly (t1-t0)/dt is returned, whatever the actual number of steps is. This is obvious from boost/numeric/odeint/integrate/detail/integrate_const.hpp.

This patch fixes the problem: http://pastebin.com/nKVwmAdM

mariomulansky commented 10 years ago

thanks for finding the problem and providing a patch! I will fix that asap.