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

odeint incompatible with multiple precision types in boost v1.68? #247

Open
niggetiedt opened this issue Oct 8, 2019 · 2 comments
Open

Comments

@niggetiedt
Copy link

Hi there,

First of all, I really appreciate this library and its powerful methods.
However, I managed to compile the following code within boost version 1.67 but not with version >= 1.68. In the newer versions they included multiple precision support for complex numbers, which I would also like to use with odeint. Is it a problem of the stepper?
Thank you in advance!

#include <iostream>

#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
#include <boost/multiprecision/gmp.hpp>

using namespace std;
using namespace boost::numeric::odeint;

typedef boost::multiprecision::mpf_float_100 mpf;
typedef boost::array< mpf , 1 > state_type;

void rhs( const state_type &x , state_type &dxdt , const mpf t )
{
    dxdt[0] = ( - x[0] * sin( t ) + 2.0 * tan( t ) ) * x[0];
}

void write_out( const state_type &x , const mpf t )
{
    cout.precision(50);
    cout << t << '\t' << x[0] << endl;
}

int main()
{
    bulirsch_stoer< state_type , mpf > stepper( 1E-20 , 0 , 0 , 0 );

    state_type x;

    mpf t = mpf("0.2");
    mpf dt = mpf("0.01");
    mpf t_end = mpf("1.5");

    x[0] = 1.15;
    
    integrate_adaptive( stepper , rhs , x , t , t_end , dt , write_out );
}
@ds283
Copy link
Contributor

ds283 commented Nov 17, 2019

This is no help, but I have a similar issue with #245 with no response from the developers. It's unfortunate because In the past they have been very responsive.

@ds283
Copy link
Contributor

ds283 commented Dec 1, 2019

See #245 (comment).

Currently the workaround seems to be to revert to commit boostorg/multiprecision@3390855 in Boost::Multiprecision or earlier.

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

2 participants