Opened 9 years ago
Closed 8 years ago
#9030 closed Feature Requests (fixed)
Should pass steppers by reference in integrate functions
Reported by: | 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 , 9 years ago
Status: | new → assigned |
---|
comment:2 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
It should already work with std::ref or boost::ref
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.