I am trying to compile the following example from ODEINT library. I downloaded and installed the boost library and then add path to CodeBlocks as guided by some of threads online. However, errors still occur. I am very grateful if you can please have a look and tell me what's going on. Here is the code from the example (I just copied them down):
#include <iostream>
#include <boost/numeric/odeint.hpp>
#define tab "\t"
using namespace std;
using namespace boost::numeric::odeint;
typedef vector< double > state_type;
const double sigma = 10.0;
const double R = 28.0;
const double b = 8.0 / 3.0;
void lorenz( state_type &x , state_type &dxdt , double t )
{
dxdt[0] = sigma * ( x[1] - x[0] );
dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
dxdt[2] = x[0]*x[1] - b * x[2];
}
int main( int argc , char **argv )
{
const double dt = 0.01;
state_type x(3);
x[0] = 1.0 ;
x[1] = 0.0 ;
x[2] = 0.0;
stepper_euler< state_type > stepper;
stepper.adjust_size( x );
double t = 0.0;
for( size_t oi=0 ; oi<10000 ; ++oi,t+=dt )
{
stepper.do_step( lorenz , x , t , dt );
cout << x[0] << tab << x[1] << tab << x[2] << endl;
}
}
And here are the errors received: Build: Debug in depi (compiler: GNU GCC Compile) In function 'int main(int, char**) |error: 'stepper_euler' was not declared in this scope 31|error: expected primary-expression before '>' token error: 'stepper' was not declared in this scope| uild failed: 3 error(s), 0 warning(s) (0 minute(s), 9 second(s))