headmyshoulder / odeint-v2

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

Performance improvement for Bulirsch-Stoer-Stepper #186

Closed mmlanger closed 8 years ago

mmlanger commented 8 years ago

Implements the change suggested in Issue #185.

mariomulansky commented 8 years ago

If I'm not mistaken, the algorithm actually needs 1/facmin. One could save another division if instead of facmin directly the inverse 1/facmin is computed and saved in the facmin_table.

mmlanger commented 8 years ago

calc_h_opt uses facmin and 1/facmin, so both have to be known, we would have to table-ize both... The stepper doesn't seem to be micro optimized in that way and I don't think it would make much sense since the general algorithm is more computation heavy.

mariomulansky commented 8 years ago

Ah ok, right. I overlooked the appearance of facmin. Indeed, if both facmin and 1/facmin are used there is no need for further optimization here.

mariomulansky commented 8 years ago

Thanks a lot for this improvement!