odeint/performance/lorenz.hpp
2014-10-17 11:09:24 +02:00

34 lines
737 B
C++

/*
* lorenz.hpp
*
* Copyright 2011 Mario Mulansky
* Copyright 2012 Karsten Ahnert
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or
* copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef LORENZ_HPP_
#define LORENZ_HPP_
#include <boost/array.hpp>
struct lorenz
{
template< class state_type >
void inline operator()( const state_type &x , state_type &dxdt , const double t ) const
{
const double sigma = 10.0;
const double R = 28.0;
const double b = 8.0 / 3.0;
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];
}
};
#endif /* LORENZ_HPP_ */