Opened 9 years ago

Closed 8 years ago

#9030 closed Feature Requests (fixed)

Should pass steppers by reference in integrate functions

Reported by: anikin@… Owned by: karsten
Milestone: To Be Determined Component: odeint
Version: Boost 1.54.0 Severity: Showstopper
Keywords: st Cc:

Description

The integrate family of functions takes steppers by value, but steppers like the most useful runge_kutta_dopri5 may contain state which is not the best type to copy around. The worst happens if you try to use SSE-aligned vector for state type, e.g. Eigen::Array. Passing aligned struct by value cannot preserve the alignment and the program crashes. Which makes it impossible to use SSE vectorization with odeint. I think you need to change to passing steppers by reference or add odeint::unwrap_reference< Stepper > wherever steppers are passed, so that boost::ref could be used with them.

Change History (2)

comment:1 by karsten, 9 years ago

Status: newassigned

I think using odeint::unwrap_reference< Stepper > is the best solution since it does not break any code and one can pass steppers by reference.

comment:2 by karsten, 8 years ago

Resolution: fixed
Status: assignedclosed

It should already work with std::ref or boost::ref

Note: See TracTickets for help on using tickets.