value_type cannot have an explicit contructor
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start with the example in runge_kutta_dopri5.hpp and search odeint for similar scale_sum constructions using raw 1.0 values. Check how these expressions behave with an explicit value_type constructor, then verify that the affected code supports the ceres Jet type without breaking existing scalar types.
Written by the indexing model from the issue text.
Description
There are many places in odeint similar to the following (taken from runge_kutta_dopri5.hpp):
stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , dxdt_in ,
typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt*b21 ) );
Unfortunately, if value_type's constructor is marked explicit, this will fail. I ran into this trying to use a ceres a jet type for the scalars here for the purpose of automatic differentiation.
It seems like it would be more robust to use something like
const value_type one{1.0};
in these scenarios instead of the raw 1.0. And if I make that change, the ceres jet type works correctly.
I would be willing to work on a PR if this is a change the maintainers would accept.
- Dominant language
- C++
- Stars
- 55
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/odeint
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 43/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100