Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value_type cannot have an explicit contructor #57

Open
rabraker opened this issue Dec 3, 2022 · 0 comments
Open

value_type cannot have an explicit contructor #57

rabraker opened this issue Dec 3, 2022 · 0 comments

Comments

@rabraker
Copy link

rabraker commented Dec 3, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant