removed is_resizable from state_wrapper

This commit is contained in:
Mario Mulansky 2012-02-08 19:05:40 +01:00
parent 90acc757fb
commit 63fade416c
78 changed files with 556 additions and 618 deletions

View File

@ -199,7 +199,6 @@ struct state_wrapper< gsl_vector* >
typedef double value_type;
typedef gsl_vector* state_type;
typedef state_wrapper< gsl_vector* > state_wrapper_type;
typedef boost::true_type is_resizeable;
state_type m_v;

View File

@ -27,6 +27,7 @@
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
@ -290,7 +291,7 @@ private:
bool resized( false );
for( size_t i=0 ; i<steps ; ++i )
{
resized |= adjust_size_by_resizeability( m_step_storage[i] , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_step_storage[i] , x , typename is_resizeable<deriv_type>::type() );
}
return resized;
}

View File

@ -27,6 +27,7 @@
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
@ -169,7 +170,7 @@ private:
template< class StateIn >
bool resize_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_dxdt , x , typename wrapped_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
}

View File

@ -155,7 +155,7 @@ private:
template< class StateIn >
bool resize_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_dxdt , x , typename wrapped_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
}

View File

@ -23,6 +23,7 @@
#include <boost/bind.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
@ -244,7 +245,7 @@ private:
template< class StateIn >
bool resize_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_dxdt , x , typename wrapped_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
}
stepper_type& stepper( void )

View File

@ -23,6 +23,7 @@
#include <boost/bind.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/odeint/util/copy.hpp>
@ -283,7 +284,7 @@ private:
template< class StateIn >
bool resize_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_dxdt , x , typename wrapped_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
}

View File

@ -159,7 +159,7 @@ private:
template< class StateIn >
bool resize_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_dxdt , x , typename wrapped_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
}

View File

@ -277,13 +277,13 @@ private:
template< class StateIn >
bool resize_dqdt( const StateIn &x )
{
return adjust_size_by_resizeability( m_dqdt , x , typename wrapped_coor_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dqdt , x , typename is_resizeable<coor_deriv_type>::type() );
}
template< class StateIn >
bool resize_dpdt( const StateIn &x )
{
return adjust_size_by_resizeability( m_dpdt , x , typename wrapped_momentum_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dpdt , x , typename is_resizeable<momentum_deriv_type>::type() );
}

View File

@ -37,6 +37,7 @@
#include <boost/numeric/odeint/stepper/detail/macros.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
namespace boost {
@ -341,13 +342,13 @@ private:
template< class StateIn >
bool resize_m_dxdt( const StateIn &x )
{
return adjust_size_by_resizeability( m_dxdt , x , typename wrapped_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
}
template< class StateIn >
bool resize_m_xnew( const StateIn &x )
{
return adjust_size_by_resizeability( m_xnew , x , typename wrapped_state_type::is_resizeable() );
return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() );
}
template< class StateIn >
@ -355,8 +356,8 @@ private:
{
bool resized( false );
for( size_t i = 0 ; i < m_k_max ; ++i )
resized |= adjust_size_by_resizeability( m_table[i] , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_err , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_table[i] , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_err , x , typename is_resizeable<state_type>::type() );
return resized;
}

View File

@ -36,6 +36,7 @@
#include <boost/numeric/odeint/stepper/detail/macros.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/type_traits.hpp>
@ -762,22 +763,22 @@ private:
{
bool resized( false );
resized |= adjust_size_by_resizeability( m_x1 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x2 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxdt1 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxdt2 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_err , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_dxdt1 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_dxdt2 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_err , x , typename is_resizeable<state_type>::type() );
for( size_t i = 0 ; i < m_k_max ; ++i )
resized |= adjust_size_by_resizeability( m_table[i] , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_table[i] , x , typename is_resizeable<state_type>::type() );
for( size_t i = 0 ; i < m_k_max+1 ; ++i )
resized |= adjust_size_by_resizeability( m_mp_states[i] , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_mp_states[i] , x , typename is_resizeable<state_type>::type() );
for( size_t i = 0 ; i < m_k_max+1 ; ++i )
for( size_t j = 0 ; j < m_derivs[i].size() ; ++j )
resized |= adjust_size_by_resizeability( m_derivs[i][j] , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_derivs[i][j] , x , typename is_resizeable<deriv_type>::type() );
for( size_t i = 0 ; i < 2*m_k_max+1 ; ++i )
for( size_t j = 0 ; j < m_diffs[i].size() ; ++j )
resized |= adjust_size_by_resizeability( m_diffs[i][j] , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_diffs[i][j] , x , typename is_resizeable<deriv_type>::type() );
return resized;
}

View File

@ -27,6 +27,7 @@
#include <boost/numeric/odeint/util/copy.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
@ -295,19 +296,19 @@ private:
template< class StateIn >
bool resize_m_xerr_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_xerr , x , typename wrapped_state_type::is_resizeable() );
return adjust_size_by_resizeability( m_xerr , x , typename is_resizeable<state_type>::type() );
}
template< class StateIn >
bool resize_m_dxdt_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_dxdt , x , typename wrapped_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
}
template< class StateIn >
bool resize_m_xnew_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_xnew , x , typename wrapped_state_type::is_resizeable() );
return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() );
}
@ -506,25 +507,25 @@ private:
template< class StateIn >
bool resize_m_xerr_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_xerr , x , typename wrapped_state_type::is_resizeable() );
return adjust_size_by_resizeability( m_xerr , x , typename is_resizeable<state_type>::type() );
}
template< class StateIn >
bool resize_m_dxdt_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_dxdt , x , typename wrapped_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
}
template< class StateIn >
bool resize_m_dxdt_new_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_dxdtnew , x , typename wrapped_deriv_type::is_resizeable() );
return adjust_size_by_resizeability( m_dxdtnew , x , typename is_resizeable<deriv_type>::type() );
}
template< class StateIn >
bool resize_m_xnew_impl( const StateIn &x )
{
return adjust_size_by_resizeability( m_xnew , x , typename wrapped_state_type::is_resizeable() );
return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() );
}

View File

@ -29,6 +29,7 @@
#include <boost/numeric/odeint/util/copy.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
@ -183,8 +184,8 @@ private:
bool resize_impl( const StateIn &x )
{
bool resized = false;
resized |= adjust_size_by_resizeability( m_x1 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x2 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() );
return resized;
}
@ -346,10 +347,10 @@ public:
bool resize( const StateIn &x )
{
bool resized = false;
resized |= adjust_size_by_resizeability( m_x1 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x2 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxdt1 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxdt2 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_dxdt1 , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_dxdt2 , x , typename is_resizeable<deriv_type>::type() );
return resized;
}

View File

@ -27,6 +27,7 @@
#include <boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
@ -143,10 +144,10 @@ private:
bool resize_impl( const StateIn &x )
{
bool resized( false );
resized |= adjust_size_by_resizeability( m_x_tmp , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() );
for( size_t i = 0 ; i < StageCount-1 ; ++i )
{
resized |= adjust_size_by_resizeability( m_F[i] , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_F[i] , x , typename is_resizeable<deriv_type>::type() );
}
return resized;
}

View File

@ -29,6 +29,7 @@
#include <boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
namespace mpl = boost::mpl;
@ -180,10 +181,10 @@ private:
bool resize_impl( const StateIn &x )
{
bool resized( false );
resized |= adjust_size_by_resizeability( m_x_tmp , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() );
for( size_t i = 0 ; i < StageCount-1 ; ++i )
{
resized |= adjust_size_by_resizeability( m_F[i] , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_F[i] , x , typename is_resizeable<deriv_type>::type() );
}
return resized;
}

View File

@ -27,6 +27,7 @@
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/util/ublas_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/ublas/vector.hpp>
@ -131,11 +132,11 @@ private:
bool resize_impl( const StateIn &x )
{
bool resized = false;
resized |= adjust_size_by_resizeability( m_dxdt , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_b , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_jacobi , x , typename wrapped_matrix_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_pm , x , typename wrapped_pmatrix_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_x , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_b , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_jacobi , x , typename is_resizeable<matrix_type>::type() );
resized |= adjust_size_by_resizeability( m_pm , x , typename is_resizeable<pmatrix_type>::type() );
return resized;
}

View File

@ -22,6 +22,7 @@
#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/stepper/detail/macros.hpp>
@ -119,9 +120,9 @@ private:
bool resize_impl( const StateIn &x )
{
bool resized( false );
resized |= adjust_size_by_resizeability( m_x0 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x1 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxdt , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x0 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
return resized;
}
@ -242,8 +243,8 @@ public :
bool resize( const StateIn &x )
{
bool resized( false );
resized |= adjust_size_by_resizeability( m_x0 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x1 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x0 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
return resized;
}

View File

@ -30,7 +30,7 @@
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/util/ublas_wrapper.hpp>
//#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/numeric/ublas/vector.hpp>
@ -269,26 +269,26 @@ protected:
bool resize_impl( const StateIn &x )
{
bool resized = false;
resized |= adjust_size_by_resizeability( m_dxdt , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dfdt , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxdtnew , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_xtmp , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_g1 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_g2 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_g3 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_g4 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_g5 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_cont3 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_cont4 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_jac , x , typename wrapped_matrix_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_pm , x , typename wrapped_pmatrix_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_dfdt , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_dxdtnew , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_xtmp , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_g1 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_g2 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_g3 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_g4 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_g5 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_cont3 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_cont4 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_jac , x , typename is_resizeable<matrix_type>::type() );
resized |= adjust_size_by_resizeability( m_pm , x , typename is_resizeable<pmatrix_type>::type() );
return resized;
}
template< class StateIn >
bool resize_x_err( const StateIn &x )
{
return adjust_size_by_resizeability( m_x_err , x , typename wrapped_state_type::is_resizeable() );
return adjust_size_by_resizeability( m_x_err , x , typename is_resizeable<state_type>::type() );
}
private:

View File

@ -26,6 +26,7 @@
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/util/copy.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
@ -174,13 +175,13 @@ private:
template< class StateIn >
bool resize_m_xerr( const StateIn &x )
{
return adjust_size_by_resizeability( m_xerr , x , typename wrapped_state_type::is_resizeable() );
return adjust_size_by_resizeability( m_xerr , x , typename is_resizeable<state_type>::type() );
}
template< class StateIn >
bool resize_m_xnew( const StateIn &x )
{
return adjust_size_by_resizeability( m_xnew , x , typename wrapped_state_type::is_resizeable() );
return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() );
}

View File

@ -25,6 +25,7 @@
#include <boost/bind.hpp>
#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
namespace boost {
namespace numeric {
@ -177,8 +178,8 @@ private:
bool resize_impl( const StateIn &x )
{
bool resized = false;
resized |= adjust_size_by_resizeability( m_x1 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x2 , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() );
return resized;
}

View File

@ -27,6 +27,7 @@
#include <boost/numeric/odeint/stepper/detail/macros.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
namespace boost {
@ -117,10 +118,10 @@ private:
bool resize_impl( const StateIn &x )
{
bool resized = false;
resized |= adjust_size_by_resizeability( m_x_tmp , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxm , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxt , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_dxh , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_dxm , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_dxt , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_dxh , x , typename is_resizeable<deriv_type>::type() );
return resized;
}

View File

@ -24,6 +24,8 @@
#include <boost/numeric/odeint/algebra/range_algebra.hpp>
#include <boost/numeric/odeint/algebra/default_operations.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
#include <boost/array.hpp>

View File

@ -28,6 +28,7 @@
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/stepper/detail/macros.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
namespace boost {
@ -166,12 +167,12 @@ private:
bool resize_impl( const StateIn &x )
{
bool resized = false;
resized |= adjust_size_by_resizeability( m_x_tmp , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_k2 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_k3 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_k4 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_k5 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_k6 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_k2 , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_k3 , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_k4 , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_k5 , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_k6 , x , typename is_resizeable<deriv_type>::type() );
return resized;
}

View File

@ -28,6 +28,11 @@
#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
#include <boost/numeric/odeint/stepper/detail/macros.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>
namespace boost {
namespace numeric {
namespace odeint {
@ -238,12 +243,12 @@ private:
bool resize_impl( const StateIn &x )
{
bool resized = false;
resized |= adjust_size_by_resizeability( m_x_tmp , x , typename wrapped_state_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_k2 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_k3 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_k4 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_k5 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_k6 , x , typename wrapped_deriv_type::is_resizeable() );
resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() );
resized |= adjust_size_by_resizeability( m_k2 , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_k3 , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_k4 , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_k5 , x , typename is_resizeable<deriv_type>::type() );
resized |= adjust_size_by_resizeability( m_k6 , x , typename is_resizeable<deriv_type>::type() );
return resized;
}

View File

@ -27,6 +27,8 @@
#include <boost/array.hpp>
#include <boost/numeric/odeint/util/state_wrapper.hpp>
#include <boost/numeric/odeint/util/is_resizeable.hpp>
#include <boost/numeric/odeint/util/resizer.hpp>

View File

@ -32,34 +32,15 @@ namespace numeric {
namespace odeint {
template< class V , bool resizeable = is_resizeable< V >::value >
struct state_wrapper;
//two standard implementations, with and without resizing depending on is_resizeable< StateType >
template< class V >
struct state_wrapper< V , true > // with resizing
struct state_wrapper
{
typedef state_wrapper< V , true > state_wrapper_type;
typedef boost::true_type is_resizeable;
typedef state_wrapper< V > state_wrapper_type;
V m_v;
};
template< class V >
struct state_wrapper< V , false > // without resizing
{
typedef state_wrapper< V , false > state_wrapper_type;
typedef boost::false_type is_resizeable;
V m_v;
};
}
}
}

View File

@ -140,35 +140,16 @@ struct resize_impl< boost::numeric::ublas::vector< T_V , A_V > , boost::numeric:
template< class T , class A >
struct state_wrapper< boost::numeric::ublas::permutation_matrix< T , A > , true > // with resizing
struct state_wrapper< boost::numeric::ublas::permutation_matrix< T , A > > // with resizing
{
typedef boost::numeric::ublas::permutation_matrix< T , A > state_type;
typedef state_wrapper< state_type > state_wrapper_type;
//typedef typename V::value_type value_type;
typedef boost::true_type is_resizeable;
state_type m_v;
state_wrapper() : m_v( 1 ) // permutation matrix constructor requires a size, choose 1 as default
{ }
template< class T_V , class A_V >
bool same_size( const boost::numeric::ublas::vector< T_V , A_V > &x )
{
return boost::numeric::odeint::same_size_impl< state_type , boost::numeric::ublas::vector< T_V , A_V > >::same_size( m_v , x );
}
template< class T_V , class A_V >
bool resize( const boost::numeric::ublas::vector< T_V , A_V > &x )
{
//standard resizing done like for std::vector
if( !same_size( x ) )
{
boost::numeric::odeint::resize_impl< state_type , boost::numeric::ublas::vector< T_V , A_V > >::resize( m_v , x );
return true;
} else
return false;
}
};

View File

@ -44,7 +44,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -25,9 +25,9 @@
to be used within <a class="link" href="../odeint_in_detail/integrate_functions.html" title="Integrate functions">integrate
functions</a>.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.description"></a><h5>
<a name="id632403"></a>
<a class="link" href="controlled_stepper.html#boost_sandbox_numeric_odeint.concepts.controlled_stepper.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.description"></a></span><a class="link" href="controlled_stepper.html#boost_sandbox_numeric_odeint.concepts.controlled_stepper.description">Description</a>
</h5>
<p>
A controlled stepper following this Controlled Stepper concept provides the
@ -36,9 +36,9 @@
with a given step-size <span class="emphasis"><em>dt</em></span>. Depending on an error estimate
of the solution the step might be rejected and a smaller step-size is suggested.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.notation"></a><h5>
<a name="id632444"></a>
<a class="link" href="controlled_stepper.html#boost_sandbox_numeric_odeint.concepts.controlled_stepper.notation">Notation</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.notation"></a></span><a class="link" href="controlled_stepper.html#boost_sandbox_numeric_odeint.concepts.controlled_stepper.notation">Notation</a>
</h5>
<div class="variablelist">
<p class="title"><b></b></p>
@ -77,9 +77,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.valid_expressions"></a><h5>
<a name="id632697"></a>
<a class="link" href="controlled_stepper.html#boost_sandbox_numeric_odeint.concepts.controlled_stepper.valid_expressions">Valid
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.valid_expressions"></a></span><a class="link" href="controlled_stepper.html#boost_sandbox_numeric_odeint.concepts.controlled_stepper.valid_expressions">Valid
Expressions</a>
</h5>
<div class="informaltable"><table class="table">
@ -178,9 +178,9 @@
</tr>
</tbody>
</table></div>
<a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.models"></a><h5>
<a name="id633109"></a>
<a class="link" href="controlled_stepper.html#boost_sandbox_numeric_odeint.concepts.controlled_stepper.models">Models</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.h3"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper.models"></a></span><a class="link" href="controlled_stepper.html#boost_sandbox_numeric_odeint.concepts.controlled_stepper.models">Models</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
@ -202,7 +202,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -25,9 +25,9 @@
to be used within <a class="link" href="../odeint_in_detail/integrate_functions.html" title="Integrate functions">integrate
functions</a>.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.description"></a><h5>
<a name="id633195"></a>
<a class="link" href="dense_output_stepper.html#boost_sandbox_numeric_odeint.concepts.dense_output_stepper.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.description"></a></span><a class="link" href="dense_output_stepper.html#boost_sandbox_numeric_odeint.concepts.dense_output_stepper.description">Description</a>
</h5>
<p>
A dense ouput stepper following this Dense Output Stepper concept provides
@ -37,9 +37,9 @@
to calculate the state <span class="emphasis"><em>x(t')</em></span> at any point <span class="emphasis"><em>t
&lt;= t' &lt;= t+dt</em></span>.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.associated_types"></a><h5>
<a name="id633246"></a>
<a class="link" href="dense_output_stepper.html#boost_sandbox_numeric_odeint.concepts.dense_output_stepper.associated_types">Associated
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.associated_types"></a></span><a class="link" href="dense_output_stepper.html#boost_sandbox_numeric_odeint.concepts.dense_output_stepper.associated_types">Associated
types</a>
</h5>
<div class="variablelist">
@ -55,9 +55,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.notation"></a><h5>
<a name="id633340"></a>
<a class="link" href="dense_output_stepper.html#boost_sandbox_numeric_odeint.concepts.dense_output_stepper.notation">Notation</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.notation"></a></span><a class="link" href="dense_output_stepper.html#boost_sandbox_numeric_odeint.concepts.dense_output_stepper.notation">Notation</a>
</h5>
<div class="variablelist">
<p class="title"><b></b></p>
@ -92,9 +92,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.valid_expressions"></a><h5>
<a name="id633597"></a>
<a class="link" href="dense_output_stepper.html#boost_sandbox_numeric_odeint.concepts.dense_output_stepper.valid_expressions">Valid
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.h3"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.valid_expressions"></a></span><a class="link" href="dense_output_stepper.html#boost_sandbox_numeric_odeint.concepts.dense_output_stepper.valid_expressions">Valid
Expressions</a>
</h5>
<div class="informaltable"><table class="table">
@ -284,9 +284,9 @@
</tr>
</tbody>
</table></div>
<a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.models"></a><h5>
<a name="id634411"></a>
<a class="link" href="dense_output_stepper.html#boost_sandbox_numeric_odeint.concepts.dense_output_stepper.models">Models</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.h4"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.dense_output_stepper.models"></a></span><a class="link" href="dense_output_stepper.html#boost_sandbox_numeric_odeint.concepts.dense_output_stepper.models">Models</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
@ -300,7 +300,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -24,9 +24,9 @@
This concepts specifies the interface an error stepper has to fulfill to
be used within a ControlledErrorStepper.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.error_stepper.description"></a><h5>
<a name="id631552"></a>
<a class="link" href="error_stepper.html#boost_sandbox_numeric_odeint.concepts.error_stepper.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.error_stepper.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.error_stepper.description"></a></span><a class="link" href="error_stepper.html#boost_sandbox_numeric_odeint.concepts.error_stepper.description">Description</a>
</h5>
<p>
An error stepper following this Error Stepper concept is capable of doing
@ -40,9 +40,9 @@
Symplectic System</a> or <a class="link" href="implicit_system.html" title="Implicit System">Implicit
System</a>.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.error_stepper.notation"></a><h5>
<a name="id631623"></a>
<a class="link" href="error_stepper.html#boost_sandbox_numeric_odeint.concepts.error_stepper.notation">Notation</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.error_stepper.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.error_stepper.notation"></a></span><a class="link" href="error_stepper.html#boost_sandbox_numeric_odeint.concepts.error_stepper.notation">Notation</a>
</h5>
<div class="variablelist">
<p class="title"><b></b></p>
@ -90,9 +90,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.error_stepper.valid_expressions"></a><h5>
<a name="id631940"></a>
<a class="link" href="error_stepper.html#boost_sandbox_numeric_odeint.concepts.error_stepper.valid_expressions">Valid
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.error_stepper.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.error_stepper.valid_expressions"></a></span><a class="link" href="error_stepper.html#boost_sandbox_numeric_odeint.concepts.error_stepper.valid_expressions">Valid
Expressions</a>
</h5>
<div class="informaltable"><table class="table">
@ -187,9 +187,9 @@
</tr>
</tbody>
</table></div>
<a name="boost_sandbox_numeric_odeint.concepts.error_stepper.models"></a><h5>
<a name="id632331"></a>
<a class="link" href="error_stepper.html#boost_sandbox_numeric_odeint.concepts.error_stepper.models">Models</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.error_stepper.h3"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.error_stepper.models"></a></span><a class="link" href="error_stepper.html#boost_sandbox_numeric_odeint.concepts.error_stepper.models">Models</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
@ -205,7 +205,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -20,22 +20,22 @@
<a name="boost_sandbox_numeric_odeint.concepts.implicit_system"></a><a class="link" href="implicit_system.html" title="Implicit System">Implicit
System</a>
</h3></div></div></div>
<a name="boost_sandbox_numeric_odeint.concepts.implicit_system.description"></a><h5>
<a name="id629727"></a>
<a class="link" href="implicit_system.html#boost_sandbox_numeric_odeint.concepts.implicit_system.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.implicit_system.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.implicit_system.description"></a></span><a class="link" href="implicit_system.html#boost_sandbox_numeric_odeint.concepts.implicit_system.description">Description</a>
</h5>
<p>
This concept describes how to define a ODE that can be solved by an implicit
routine. Implicit routines need not only the function <span class="emphasis"><em>f(x,t)</em></span>
but also the Jacobian /df<span class="emphasis"><em>dx = A(x,t)</em></span>. <span class="emphasis"><em>A</em></span>
but also the Jacobian <span class="emphasis"><em>df/dx = A(x,t)</em></span>. <span class="emphasis"><em>A</em></span>
is a matrix and implicit routines need to solve the linear problem <span class="emphasis"><em>Ax
= b</em></span>. In odeint this is implemented with use of <a href="http://www.boost.org/doc/libs/release/libs/numeric/ublas/index.html" target="_top">Boost.UBlas</a>,
therefore, the <span class="emphasis"><em>state_type</em></span> implicit routines is <span class="emphasis"><em>ublas::vector</em></span>
and the matrix is defined as <span class="emphasis"><em>ublas::matrix</em></span>.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.implicit_system.notation"></a><h5>
<a name="id629784"></a>
<a class="link" href="implicit_system.html#boost_sandbox_numeric_odeint.concepts.implicit_system.notation">Notation</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.implicit_system.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.implicit_system.notation"></a></span><a class="link" href="implicit_system.html#boost_sandbox_numeric_odeint.concepts.implicit_system.notation">Notation</a>
</h5>
<div class="variablelist">
<p class="title"><b></b></p>
@ -70,9 +70,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.implicit_system.valid_expressions"></a><h5>
<a name="id629991"></a>
<a class="link" href="implicit_system.html#boost_sandbox_numeric_odeint.concepts.implicit_system.valid_expressions">Valid
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.implicit_system.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.implicit_system.valid_expressions"></a></span><a class="link" href="implicit_system.html#boost_sandbox_numeric_odeint.concepts.implicit_system.valid_expressions">Valid
Expressions</a>
</h5>
<div class="informaltable"><table class="table">
@ -162,7 +162,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -19,9 +19,9 @@
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.concepts.observer"></a><a class="link" href="observer.html" title="Observer">Observer</a>
</h3></div></div></div>
<a name="boost_sandbox_numeric_odeint.concepts.observer.description"></a><h5>
<a name="id630328"></a>
<a class="link" href="observer.html#boost_sandbox_numeric_odeint.concepts.observer.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.observer.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.observer.description"></a></span><a class="link" href="observer.html#boost_sandbox_numeric_odeint.concepts.observer.description">Description</a>
</h5>
<p>
The Observer concept is used in <code class="computeroutput"><span class="identifier">integrate</span></code>
@ -32,9 +32,9 @@
or at user defined time points depending on which <code class="computeroutput"><span class="identifier">integrate</span></code>
function is used.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.observer.notation"></a><h5>
<a name="id630386"></a>
<a class="link" href="observer.html#boost_sandbox_numeric_odeint.concepts.observer.notation">Notation</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.observer.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.observer.notation"></a></span><a class="link" href="observer.html#boost_sandbox_numeric_odeint.concepts.observer.notation">Notation</a>
</h5>
<div class="variablelist">
<p class="title"><b></b></p>
@ -65,9 +65,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.observer.valid_expressions"></a><h5>
<a name="id630590"></a>
<a class="link" href="observer.html#boost_sandbox_numeric_odeint.concepts.observer.valid_expressions">Valid
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.observer.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.observer.valid_expressions"></a></span><a class="link" href="observer.html#boost_sandbox_numeric_odeint.concepts.observer.valid_expressions">Valid
Expressions</a>
</h5>
<div class="informaltable"><table class="table">
@ -128,7 +128,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -20,9 +20,9 @@
<a name="boost_sandbox_numeric_odeint.concepts.simple_symplectic_system"></a><a class="link" href="simple_symplectic_system.html" title="Simple Symplectic System">Simple
Symplectic System</a>
</h3></div></div></div>
<a name="boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.description"></a><h5>
<a name="id629269"></a>
<a class="link" href="simple_symplectic_system.html#boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.description"></a></span><a class="link" href="simple_symplectic_system.html#boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.description">Description</a>
</h5>
<p>
In most Hamiltonian systems the kinetic term is a quadratic term in the momentum
@ -44,9 +44,9 @@
equation for <span class="emphasis"><em>p'</em></span> has to be provided to the symplectic
stepper. We call this concept <span class="emphasis"><em>Simple_Symplectic_System</em></span>
</p>
<a name="boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.notation"></a><h5>
<a name="id629336"></a>
<a class="link" href="simple_symplectic_system.html#boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.notation">Notation</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.notation"></a></span><a class="link" href="simple_symplectic_system.html#boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.notation">Notation</a>
</h5>
<div class="variablelist">
<p class="title"><b></b></p>
@ -77,9 +77,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.valid_expressions"></a><h5>
<a name="id629450"></a>
<a class="link" href="simple_symplectic_system.html#boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.valid_expressions">Valid
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.valid_expressions"></a></span><a class="link" href="simple_symplectic_system.html#boost_sandbox_numeric_odeint.concepts.simple_symplectic_system.valid_expressions">Valid
Expressions</a>
</h5>
<div class="informaltable"><table class="table">
@ -166,7 +166,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -40,9 +40,9 @@
and no algebra/operations are used.
</p></td></tr>
</table></div>
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.description"></a><h5>
<a name="id634550"></a>
<a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.description"></a></span><a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.description">Description</a>
</h5>
<p>
The <code class="computeroutput"><span class="identifier">State</span></code>, <code class="computeroutput"><span class="identifier">Algebra</span></code> and <code class="computeroutput"><span class="identifier">Operations</span></code>
@ -82,9 +82,9 @@
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations"></a><a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations" title="Operations">Operations</a>
</h4></div></div></div>
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations.notation"></a><h6>
<a name="id634893"></a>
<a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations.notation">Notation</a>
<h6>
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations.notation"></a></span><a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations.notation">Notation</a>
</h6>
<div class="variablelist">
<p class="title"><b></b></p>
@ -111,7 +111,7 @@
Type that represents a general scale_sum operation, <code class="literal"><span class="emphasis"><em>N</em></span></code>
should be replaced by a number from 1 to 14.
</p></dd>
<dt><span class="term"><code class="literal">scale_sum<span class="emphasis"><em>N</em></span></code></span></dt>
<dt><span class="term"><code class="literal">scale_sum/N/</code></span></dt>
<dd><p>
Object of type <code class="literal">ScaleSum<span class="emphasis"><em>N</em></span></code>,
<code class="literal"><span class="emphasis"><em>N</em></span></code> should be replaced by a
@ -142,9 +142,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations.valid_expressions"></a><h6>
<a name="id635265"></a>
<a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations.valid_expressions">Valid
<h6>
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations.valid_expressions"></a></span><a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.operations.valid_expressions">Valid
Expressions</a>
</h6>
<div class="informaltable"><table class="table">
@ -258,21 +258,18 @@
</td>
<td>
<p>
<code class="literal">Operations::scale_sum<span class="emphasis"><em>N</em></span>&lt; Value1
, ... , ValueN &gt;</code>
<code class="literal">Operations::scale_sum/N/&lt; Value1 , ... , ValueN &gt;</code>
</p>
</td>
<td>
<p>
<code class="literal">ScaleSum<span class="emphasis"><em>N</em></span></code>
<code class="literal">ScaleSum/N/</code>
</p>
</td>
<td>
<p>
Get the <code class="literal">ScaleSum<span class="emphasis"><em>N</em></span></code> type
from <code class="computeroutput"><span class="identifier">Operations</span></code>,
<code class="literal"><span class="emphasis"><em>N</em></span></code> should be replaced
by a number from 1 to 14.
Get the <code class="literal">ScaleSum/N/</code> type from <code class="computeroutput"><span class="identifier">Operations</span></code>, <code class="literal"><span class="emphasis"><em>N</em></span></code>
should be replaced by a number from 1 to 14.
</p>
</td>
</tr>
@ -284,13 +281,13 @@
</td>
<td>
<p>
<code class="literal">ScaleSum<span class="emphasis"><em>N</em></span>&lt; Value1 , ... , ValueN
&gt;( a1 , ... , aN )</code>
<code class="literal">ScaleSum/N/&lt; Value1 , ... , ValueN &gt;( a1 , ...
, aN )</code>
</p>
</td>
<td>
<p>
<code class="literal">ScaleSum<span class="emphasis"><em>N</em></span></code>
<code class="literal">ScaleSum/N/</code>
</p>
</td>
<td>
@ -310,7 +307,7 @@
</td>
<td>
<p>
<code class="literal">scale_sum<span class="emphasis"><em>N</em></span>( y , x1 , ... , xN )</code>
<code class="literal">scale_sum/N/( y , x1 , ... , xN )</code>
</p>
</td>
<td>
@ -417,9 +414,9 @@
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra"></a><a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra" title="Algebra">Algebra</a>
</h4></div></div></div>
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra.notation"></a><h6>
<a name="id636345"></a>
<a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra.notation">Notation</a>
<h6>
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra.notation"></a></span><a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra.notation">Notation</a>
</h6>
<div class="variablelist">
<p class="title"><b></b></p>
@ -432,7 +429,7 @@
<dd><p>
The algebra type
</p></dd>
<dt><span class="term"><code class="literal">Operation<span class="emphasis"><em>N</em></span></code></span></dt>
<dt><span class="term"><code class="literal">Operation/N/</code></span></dt>
<dd><p>
An <code class="literal"><span class="emphasis"><em>N</em></span></code>-ary operation type,
<code class="literal"><span class="emphasis"><em>N</em></span></code> should be a number from
@ -442,7 +439,7 @@
<dd><p>
Object of type <code class="computeroutput"><span class="identifier">Algebra</span></code>
</p></dd>
<dt><span class="term"><code class="literal">operation<span class="emphasis"><em>N</em></span></code></span></dt>
<dt><span class="term"><code class="literal">operation/N/</code></span></dt>
<dd><p>
Object of type <code class="literal">Operation/N</code>
</p></dd>
@ -455,9 +452,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra.valid_expressions"></a><h6>
<a name="id636565"></a>
<a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra.valid_expressions">Valid
<h6>
<a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra.valid_expressions"></a></span><a class="link" href="state_algebra_operations.html#boost_sandbox_numeric_odeint.concepts.state_algebra_operations.algebra.valid_expressions">Valid
Expressions</a>
</h6>
<div class="informaltable"><table class="table">
@ -557,8 +554,8 @@
</td>
<td>
<p>
<code class="literal">algebra.for_each<span class="emphasis"><em>N</em></span>( y , x1 , ...
, xN , operation<span class="emphasis"><em>N</em></span> )</code>
<code class="literal">algebra.for_each/N/( y , x1 , ... , xN , operation/N/
)</code>
</p>
</td>
<td>
@ -568,8 +565,8 @@
</td>
<td>
<p>
Calls <code class="literal">operation<span class="emphasis"><em>N</em></span>( y_i , x1_i ,
... , xN_i )</code> for each element <code class="computeroutput"><span class="identifier">y_i</span></code>
Calls <code class="literal">operation/N/( y_i , x1_i , ... , xN_i )</code>
for each element <code class="computeroutput"><span class="identifier">y_i</span></code>
of <code class="computeroutput"><span class="identifier">y</span></code> and <code class="computeroutput"><span class="identifier">x1_i</span></code> of <code class="computeroutput"><span class="identifier">x1</span></code>
and so on. <code class="literal"><span class="emphasis"><em>N</em></span></code> should be
replaced by a number between 1 and 14.
@ -817,7 +814,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -20,9 +20,9 @@
<a name="boost_sandbox_numeric_odeint.concepts.state_wrapper"></a><a class="link" href="state_wrapper.html" title="State Wrapper">State
Wrapper</a>
</h3></div></div></div>
<a name="boost_sandbox_numeric_odeint.concepts.state_wrapper.description"></a><h5>
<a name="id637985"></a>
<a class="link" href="state_wrapper.html#boost_sandbox_numeric_odeint.concepts.state_wrapper.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.state_wrapper.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.state_wrapper.description"></a></span><a class="link" href="state_wrapper.html#boost_sandbox_numeric_odeint.concepts.state_wrapper.description">Description</a>
</h5>
<p>
The <code class="computeroutput"><span class="identifier">State</span> <span class="identifier">Wrapper</span></code>
@ -30,9 +30,9 @@
intermediate results within the stepper's <code class="computeroutput"><span class="identifier">do_step</span></code>
methods.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.state_wrapper.notation"></a><h5>
<a name="id638038"></a>
<a class="link" href="state_wrapper.html#boost_sandbox_numeric_odeint.concepts.state_wrapper.notation">Notation</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.state_wrapper.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.state_wrapper.notation"></a></span><a class="link" href="state_wrapper.html#boost_sandbox_numeric_odeint.concepts.state_wrapper.notation">Notation</a>
</h5>
<div class="variablelist">
<p class="title"><b></b></p>
@ -56,9 +56,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.state_wrapper.valid_expressions"></a><h5>
<a name="id638191"></a>
<a class="link" href="state_wrapper.html#boost_sandbox_numeric_odeint.concepts.state_wrapper.valid_expressions">Valid
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.state_wrapper.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.state_wrapper.valid_expressions"></a></span><a class="link" href="state_wrapper.html#boost_sandbox_numeric_odeint.concepts.state_wrapper.valid_expressions">Valid
Expressions</a>
</h5>
<div class="informaltable"><table class="table">
@ -267,7 +267,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -24,9 +24,9 @@
be used within the <a class="link" href="../odeint_in_detail/integrate_functions.html" title="Integrate functions">integrate
functions</a>.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.stepper.description"></a><h5>
<a name="id630768"></a>
<a class="link" href="stepper.html#boost_sandbox_numeric_odeint.concepts.stepper.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.stepper.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.stepper.description"></a></span><a class="link" href="stepper.html#boost_sandbox_numeric_odeint.concepts.stepper.description">Description</a>
</h5>
<p>
The basic stepper concept. A basic stepper following this Stepper concept
@ -40,9 +40,9 @@
Symplectic System</a> or <a class="link" href="implicit_system.html" title="Implicit System">Implicit
System</a>. Note that all error steppers are also basic steppers.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.stepper.refinement_of"></a><h5>
<a name="id630836"></a>
<a class="link" href="stepper.html#boost_sandbox_numeric_odeint.concepts.stepper.refinement_of">Refinement
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.stepper.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.stepper.refinement_of"></a></span><a class="link" href="stepper.html#boost_sandbox_numeric_odeint.concepts.stepper.refinement_of">Refinement
of</a>
</h5>
<div class="itemizedlist"><ul type="disc">
@ -53,9 +53,9 @@
CopyConstructable
</li>
</ul></div>
<a name="boost_sandbox_numeric_odeint.concepts.stepper.notation"></a><h5>
<a name="id630874"></a>
<a class="link" href="stepper.html#boost_sandbox_numeric_odeint.concepts.stepper.notation">Notation</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.stepper.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.stepper.notation"></a></span><a class="link" href="stepper.html#boost_sandbox_numeric_odeint.concepts.stepper.notation">Notation</a>
</h5>
<div class="variablelist">
<p class="title"><b></b></p>
@ -95,9 +95,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.stepper.valid_expressions"></a><h5>
<a name="id631125"></a>
<a class="link" href="stepper.html#boost_sandbox_numeric_odeint.concepts.stepper.valid_expressions">Valid
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.stepper.h3"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.stepper.valid_expressions"></a></span><a class="link" href="stepper.html#boost_sandbox_numeric_odeint.concepts.stepper.valid_expressions">Valid
Expressions</a>
</h5>
<div class="informaltable"><table class="table">
@ -187,9 +187,9 @@
</tr>
</tbody>
</table></div>
<a name="boost_sandbox_numeric_odeint.concepts.stepper.models"></a><h5>
<a name="id631473"></a>
<a class="link" href="stepper.html#boost_sandbox_numeric_odeint.concepts.stepper.models">Models</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.stepper.h4"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.stepper.models"></a></span><a class="link" href="stepper.html#boost_sandbox_numeric_odeint.concepts.stepper.models">Models</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
@ -211,7 +211,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -20,9 +20,9 @@
<a name="boost_sandbox_numeric_odeint.concepts.symplectic_system"></a><a class="link" href="symplectic_system.html" title="Symplectic System">Symplectic
System</a>
</h3></div></div></div>
<a name="boost_sandbox_numeric_odeint.concepts.symplectic_system.description"></a><h5>
<a name="id628499"></a>
<a class="link" href="symplectic_system.html#boost_sandbox_numeric_odeint.concepts.symplectic_system.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.symplectic_system.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.symplectic_system.description"></a></span><a class="link" href="symplectic_system.html#boost_sandbox_numeric_odeint.concepts.symplectic_system.description">Description</a>
</h5>
<p>
This concept describes how to define a symplectic system written with generalized
@ -58,9 +58,9 @@
std::pair of functions or a functors. Symplectic systems are used in symplectic
steppers like <code class="computeroutput"><span class="identifier">symplectic_rkn_sb3a_mclachlan</span></code>.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.symplectic_system.notation"></a><h5>
<a name="id628616"></a>
<a class="link" href="symplectic_system.html#boost_sandbox_numeric_odeint.concepts.symplectic_system.notation">Notation</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.symplectic_system.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.symplectic_system.notation"></a></span><a class="link" href="symplectic_system.html#boost_sandbox_numeric_odeint.concepts.symplectic_system.notation">Notation</a>
</h5>
<div class="variablelist">
<p class="title"><b></b></p>
@ -107,9 +107,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.symplectic_system.valid_expressions"></a><h5>
<a name="id628879"></a>
<a class="link" href="symplectic_system.html#boost_sandbox_numeric_odeint.concepts.symplectic_system.valid_expressions">Valid
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.symplectic_system.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.symplectic_system.valid_expressions"></a></span><a class="link" href="symplectic_system.html#boost_sandbox_numeric_odeint.concepts.symplectic_system.valid_expressions">Valid
expressions</a>
</h5>
<div class="informaltable"><table class="table">
@ -220,7 +220,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -19,9 +19,9 @@
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.concepts.system"></a><a class="link" href="system.html" title="System">System</a>
</h3></div></div></div>
<a name="boost_sandbox_numeric_odeint.concepts.system.description"></a><h5>
<a name="id628035"></a>
<a class="link" href="system.html#boost_sandbox_numeric_odeint.concepts.system.description">Description</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.system.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.system.description"></a></span><a class="link" href="system.html#boost_sandbox_numeric_odeint.concepts.system.description">Description</a>
</h5>
<p>
The System concept models the algorithmic implementation of the rhs. of the
@ -34,9 +34,9 @@
System</a> and <a class="link" href="implicit_system.html" title="Implicit System">Implicit
System</a>.
</p>
<a name="boost_sandbox_numeric_odeint.concepts.system.notation"></a><h5>
<a name="id628081"></a>
<a class="link" href="system.html#boost_sandbox_numeric_odeint.concepts.system.notation">Notation</a>
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.system.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.system.notation"></a></span><a class="link" href="system.html#boost_sandbox_numeric_odeint.concepts.system.notation">Notation</a>
</h5>
<div class="variablelist">
<p class="title"><b></b></p>
@ -75,9 +75,9 @@
</p></dd>
</dl>
</div>
<a name="boost_sandbox_numeric_odeint.concepts.system.valid_expressions"></a><h5>
<a name="id628326"></a>
<a class="link" href="system.html#boost_sandbox_numeric_odeint.concepts.system.valid_expressions">Valid
<h5>
<a name="boost_sandbox_numeric_odeint.concepts.system.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.concepts.system.valid_expressions"></a></span><a class="link" href="system.html#boost_sandbox_numeric_odeint.concepts.system.valid_expressions">Valid
expressions</a>
</h5>
<div class="informaltable"><table class="table">
@ -138,7 +138,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -33,7 +33,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -29,7 +29,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -381,7 +381,6 @@
as resizeable as it is a dynamically sized array:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">my_vector</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span>
<span class="special">{</span>
@ -394,11 +393,11 @@
<span class="special">:</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;()</span>
<span class="special">{</span> <span class="special">}</span>
<span class="comment">// ...
</span><span class="special">};</span>
<span class="comment">// ...</span>
<span class="special">};</span>
<span class="comment">// define my_vector as reizeable</span>
<span class="comment">// define my_vector as reizeable
</span>
<span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">numeric</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">odeint</span> <span class="special">{</span>
<span class="keyword">template</span><span class="special">&lt;&gt;</span>
@ -515,7 +514,6 @@
to work with odeint. The following code shows the required template specializations:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
@ -523,15 +521,15 @@
<span class="keyword">template</span><span class="special">&lt;</span> <span class="special">&gt;</span>
<span class="keyword">struct</span> <span class="identifier">is_resizeable</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span>
<span class="special">{</span> <span class="comment">// declare resizeablility
</span> <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">true_type</span> <span class="identifier">type</span><span class="special">;</span>
<span class="special">{</span> <span class="comment">// declare resizeablility</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">true_type</span> <span class="identifier">type</span><span class="special">;</span>
<span class="keyword">const</span> <span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">value</span> <span class="special">=</span> <span class="identifier">type</span><span class="special">::</span><span class="identifier">value</span><span class="special">;</span>
<span class="special">};</span>
<span class="keyword">template</span><span class="special">&lt;</span> <span class="special">&gt;</span>
<span class="keyword">template</span><span class="special">&lt;</span> <span class="special">&gt;</span>
<span class="keyword">struct</span> <span class="identifier">same_size_impl</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&gt;</span>
<span class="special">{</span> <span class="comment">// define how to check size
</span> <span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">same_size</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">v1</span> <span class="special">,</span>
<span class="special">{</span> <span class="comment">// define how to check size</span>
<span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">same_size</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">v1</span> <span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">v2</span> <span class="special">)</span>
<span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">v1</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">v2</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span>
@ -540,15 +538,15 @@
<span class="keyword">template</span><span class="special">&lt;</span> <span class="special">&gt;</span>
<span class="keyword">struct</span> <span class="identifier">resize_impl</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&gt;</span>
<span class="special">{</span> <span class="comment">// define how to resize
</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">resize</span><span class="special">(</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">v1</span> <span class="special">,</span>
<span class="special">{</span> <span class="comment">// define how to resize</span>
<span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">resize</span><span class="special">(</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">v1</span> <span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">v2</span> <span class="special">)</span>
<span class="special">{</span>
<span class="identifier">v1</span><span class="special">.</span><span class="identifier">resize</span><span class="special">(</span> <span class="identifier">v2</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">);</span>
<span class="special">}</span>
<span class="special">};</span>
<span class="special">}</span> <span class="special">}</span> <span class="special">}</span>
<span class="special">}</span> <span class="special">}</span> <span class="special">}</span>
</pre>
<p>
</p>
@ -617,7 +615,6 @@
instances of state types:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;&gt;</span>
<span class="keyword">struct</span> <span class="identifier">state_wrapper</span><span class="special">&lt;</span> <span class="identifier">gsl_vector</span><span class="special">*</span> <span class="special">&gt;</span>
@ -654,7 +651,7 @@
This <code class="computeroutput"><span class="identifier">state_wrapper</span></code> specialization
tells odeint how gsl_vectors are created, copied and destroyed. Next
we need resizing, this is required because gsl_vectors are dynamically
sized objects:
sized objects:
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;&gt;</span>
<span class="keyword">struct</span> <span class="identifier">is_resizeable</span><span class="special">&lt;</span> <span class="identifier">gsl_vector</span><span class="special">*</span> <span class="special">&gt;</span>
@ -689,13 +686,12 @@
support iterators, so we first implement a gsl iterator:
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">/*
* defines an iterator for gsl_vector
*/</span>
<span class="keyword">class</span> <span class="identifier">gsl_vector_iterator</span>
<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">iterator_facade</span><span class="special">&lt;</span> <span class="identifier">gsl_vector_iterator</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">,</span>
<span class="keyword">class</span> <span class="identifier">gsl_vector_iterator</span>
<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">iterator_facade</span><span class="special">&lt;</span> <span class="identifier">gsl_vector_iterator</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">,</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">random_access_traversal_tag</span> <span class="special">&gt;</span>
<span class="special">{</span>
<span class="keyword">public</span> <span class="special">:</span>
@ -724,7 +720,6 @@
A similar class exists for the <code class="computeroutput"><span class="keyword">const</span></code>
version of the iterator. Then we have a function returning the end iterator
(similarily for <code class="computeroutput"><span class="keyword">const</span></code> again):
</p>
<pre class="programlisting"><span class="identifier">gsl_vector_iterator</span> <span class="identifier">end_iterator</span><span class="special">(</span> <span class="identifier">gsl_vector</span> <span class="special">*</span><span class="identifier">x</span> <span class="special">)</span>
<span class="special">{</span>
@ -737,16 +732,16 @@
</p>
<p>
Finally, the bindings for <a href="http://www.boost.org/doc/libs/release/libs/range/index.html" target="_top">Boost.Range</a>
are added:
are added:
</p>
<pre class="programlisting"><span class="comment">// template&lt;&gt;
</span><span class="keyword">inline</span> <span class="identifier">gsl_vector_iterator</span> <span class="identifier">range_begin</span><span class="special">(</span> <span class="identifier">gsl_vector</span> <span class="special">*</span><span class="identifier">x</span> <span class="special">)</span>
<pre class="programlisting"><span class="comment">// template&lt;&gt;</span>
<span class="keyword">inline</span> <span class="identifier">gsl_vector_iterator</span> <span class="identifier">range_begin</span><span class="special">(</span> <span class="identifier">gsl_vector</span> <span class="special">*</span><span class="identifier">x</span> <span class="special">)</span>
<span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">gsl_vector_iterator</span><span class="special">(</span> <span class="identifier">x</span> <span class="special">);</span>
<span class="special">}</span>
<span class="comment">// template&lt;&gt;
</span><span class="keyword">inline</span> <span class="identifier">gsl_vector_iterator</span> <span class="identifier">range_end</span><span class="special">(</span> <span class="identifier">gsl_vector</span> <span class="special">*</span><span class="identifier">x</span> <span class="special">)</span>
<span class="comment">// template&lt;&gt;</span>
<span class="keyword">inline</span> <span class="identifier">gsl_vector_iterator</span> <span class="identifier">range_end</span><span class="special">(</span> <span class="identifier">gsl_vector</span> <span class="special">*</span><span class="identifier">x</span> <span class="special">)</span>
<span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">end_iterator</span><span class="special">(</span> <span class="identifier">x</span> <span class="special">);</span>
<span class="special">}</span>
@ -1012,15 +1007,24 @@
<p>
Performs the operation <code class="computeroutput"><span class="keyword">operator</span></code>
for subsequently each element of <code class="computeroutput"><span class="identifier">state</span></code>
and returns the aggregate value. E.g. <br> <code class="computeroutput"><span class="identifier">init</span> <span class="special">=</span>
and returns the aggregate value. E.g.
</p>
<p>
<code class="computeroutput"><span class="identifier">init</span> <span class="special">=</span>
<span class="keyword">operator</span><span class="special">(</span>
<span class="identifier">init</span> <span class="special">,</span>
<span class="identifier">state</span><span class="special">[</span><span class="number">0</span><span class="special">]</span>
<span class="special">);</span></code> <br> <code class="computeroutput"><span class="identifier">init</span> <span class="special">=</span>
<span class="special">);</span></code>
</p>
<p>
<code class="computeroutput"><span class="identifier">init</span> <span class="special">=</span>
<span class="keyword">operator</span><span class="special">(</span>
<span class="identifier">init</span> <span class="special">,</span>
<span class="identifier">state</span><span class="special">[</span><span class="number">1</span><span class="special">]</span>
<span class="special">)</span></code> <br> <code class="computeroutput"><span class="special">...</span></code>
<span class="special">)</span></code>
</p>
<p>
<code class="computeroutput"><span class="special">...</span></code>
</p>
</td>
</tr>
@ -1040,7 +1044,6 @@
so all that has to be done in this case is to declare resizability:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">ublas</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
@ -1064,7 +1067,6 @@
code shows the corresponding definitions:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
@ -1097,9 +1099,8 @@
looks as follows:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">point3D</span> <span class="special">:</span>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">point3D</span> <span class="special">:</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">additive1</span><span class="special">&lt;</span> <span class="identifier">point3D</span> <span class="special">,</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">additive2</span><span class="special">&lt;</span> <span class="identifier">point3D</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">,</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiplicative2</span><span class="special">&lt;</span> <span class="identifier">point3D</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">&gt;</span>
@ -1111,7 +1112,7 @@
<span class="identifier">point3D</span><span class="special">()</span>
<span class="special">:</span> <span class="identifier">x</span><span class="special">(</span> <span class="number">0.0</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">y</span><span class="special">(</span> <span class="number">0.0</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">z</span><span class="special">(</span> <span class="number">0.0</span> <span class="special">)</span>
<span class="special">{</span> <span class="special">}</span>
<span class="identifier">point3D</span><span class="special">(</span> <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">val</span> <span class="special">)</span>
<span class="special">:</span> <span class="identifier">x</span><span class="special">(</span> <span class="identifier">val</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">y</span><span class="special">(</span> <span class="identifier">val</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">z</span><span class="special">(</span> <span class="identifier">val</span> <span class="special">)</span>
<span class="special">{</span> <span class="special">}</span>
@ -1150,10 +1151,9 @@
function calculating the element-wise absolute value for the state type:
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// only required for steppers with error control
</span><span class="identifier">point3D</span> <span class="keyword">operator</span><span class="special">/(</span> <span class="keyword">const</span> <span class="identifier">point3D</span> <span class="special">&amp;</span><span class="identifier">p1</span> <span class="special">,</span> <span class="keyword">const</span> <span class="identifier">point3D</span> <span class="special">&amp;</span><span class="identifier">p2</span> <span class="special">)</span>
<pre class="programlisting"><span class="comment">// only required for steppers with error control</span>
<span class="identifier">point3D</span> <span class="keyword">operator</span><span class="special">/(</span> <span class="keyword">const</span> <span class="identifier">point3D</span> <span class="special">&amp;</span><span class="identifier">p1</span> <span class="special">,</span> <span class="keyword">const</span> <span class="identifier">point3D</span> <span class="special">&amp;</span><span class="identifier">p2</span> <span class="special">)</span>
<span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">point3D</span><span class="special">(</span> <span class="identifier">p1</span><span class="special">.</span><span class="identifier">x</span><span class="special">/</span><span class="identifier">p2</span><span class="special">.</span><span class="identifier">x</span> <span class="special">,</span> <span class="identifier">p1</span><span class="special">.</span><span class="identifier">y</span><span class="special">/</span><span class="identifier">p2</span><span class="special">.</span><span class="identifier">y</span> <span class="special">,</span> <span class="identifier">p1</span><span class="special">.</span><span class="identifier">z</span><span class="special">/</span><span class="identifier">p1</span><span class="special">.</span><span class="identifier">z</span> <span class="special">);</span>
<span class="special">}</span>
@ -1170,11 +1170,10 @@
implementing a reduction over the state type:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">numeric</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">odeint</span> <span class="special">{</span>
<span class="comment">// specialization of vector_space_reduce, only required for steppers with error control
</span><span class="keyword">template</span><span class="special">&lt;&gt;</span>
<span class="comment">// specialization of vector_space_reduce, only required for steppers with error control</span>
<span class="keyword">template</span><span class="special">&lt;&gt;</span>
<span class="keyword">struct</span> <span class="identifier">vector_space_reduce</span><span class="special">&lt;</span> <span class="identifier">point3D</span> <span class="special">&gt;</span>
<span class="special">{</span>
<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Value</span> <span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Op</span> <span class="special">&gt;</span>
@ -1186,7 +1185,7 @@
<span class="keyword">return</span> <span class="identifier">init</span><span class="special">;</span>
<span class="special">}</span>
<span class="special">};</span>
<span class="special">}</span> <span class="special">}</span> <span class="special">}</span>
<span class="special">}</span> <span class="special">}</span> <span class="special">}</span>
</pre>
<p>
</p>
@ -1198,7 +1197,6 @@
perform the integration on a lorenz system by using the <code class="computeroutput"><span class="identifier">vector_space_algebra</span></code> again:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">sigma</span> <span class="special">=</span> <span class="number">10.0</span><span class="special">;</span>
<span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">R</span> <span class="special">=</span> <span class="number">28.0</span><span class="special">;</span>
@ -1217,11 +1215,11 @@
<span class="special">{</span>
<span class="identifier">point3D</span> <span class="identifier">x</span><span class="special">(</span> <span class="number">10.0</span> <span class="special">,</span> <span class="number">5.0</span> <span class="special">,</span> <span class="number">5.0</span> <span class="special">);</span>
<span class="comment">//typedef runge_kutta4&lt; point3D , double , point3D ,
</span> <span class="comment">// double , vector_space_algebra &gt; stepper;
</span> <span class="keyword">typedef</span> <span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">point3D</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">,</span> <span class="identifier">point3D</span> <span class="special">,</span>
<span class="comment">//typedef runge_kutta4&lt; point3D , double , point3D , </span>
<span class="comment">// double , vector_space_algebra &gt; stepper;</span>
<span class="keyword">typedef</span> <span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">point3D</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">,</span> <span class="identifier">point3D</span> <span class="special">,</span>
<span class="keyword">double</span> <span class="special">,</span> <span class="identifier">vector_space_algebra</span> <span class="special">&gt;</span> <span class="identifier">stepper</span><span class="special">;</span>
<span class="identifier">integrate_adaptive</span><span class="special">(</span> <span class="identifier">make_controlled</span><span class="special">&lt;</span><span class="identifier">stepper</span><span class="special">&gt;(</span> <span class="number">1E-8</span> <span class="special">,</span> <span class="number">1E-8</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">lorenz</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span>
<span class="identifier">integrate_adaptive</span><span class="special">(</span> <span class="identifier">make_controlled</span><span class="special">&lt;</span><span class="identifier">stepper</span><span class="special">&gt;(</span> <span class="number">1E-8</span> <span class="special">,</span> <span class="number">1E-8</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">lorenz</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span>
<span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="number">0.1</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">x</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
@ -1236,7 +1234,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -21,7 +21,8 @@
</h3></div></div></div></div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -29,7 +29,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1095,7 +1095,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -30,7 +30,6 @@
= (p,-q+&#947; p)</em></span>:
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">/* The type of container used to hold the state vector */</span>
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
@ -60,11 +59,10 @@
start:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">state_type</span> <span class="identifier">x</span><span class="special">(</span><span class="number">2</span><span class="special">);</span>
<span class="identifier">x</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">1.0</span><span class="special">;</span> <span class="comment">// start at x=1.0, p=0.0
</span><span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
<span class="identifier">x</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">1.0</span><span class="special">;</span> <span class="comment">// start at x=1.0, p=0.0</span>
<span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
</pre>
<p>
</p>
@ -75,7 +73,6 @@
stepper (5th order) and uses adaptive stepsize.
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">size_t</span> <span class="identifier">steps</span> <span class="special">=</span> <span class="identifier">integrate</span><span class="special">(</span> <span class="identifier">harmonic_oscillator</span> <span class="special">,</span>
<span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="number">0.1</span> <span class="special">);</span>
@ -96,7 +93,6 @@
rhs must then be implemented as a functor having defined the ()-operator:
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">/* The rhs of x' = f(x) defined as a class */</span>
<span class="keyword">class</span> <span class="identifier">harm_osc</span> <span class="special">{</span>
@ -119,7 +115,6 @@
which can be used via
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">harm_osc</span> <span class="identifier">ho</span><span class="special">(</span><span class="number">0.15</span><span class="special">);</span>
<span class="identifier">steps</span> <span class="special">=</span> <span class="identifier">integrate</span><span class="special">(</span> <span class="identifier">ho</span> <span class="special">,</span>
@ -134,7 +129,6 @@
to provide a reasonable observer. An example is
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">push_back_state_and_time</span>
<span class="special">{</span>
@ -158,7 +152,6 @@
pass this container to the integration function:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">state_type</span><span class="special">&gt;</span> <span class="identifier">x_vec</span><span class="special">;</span>
<span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">times</span><span class="special">;</span>
@ -186,7 +179,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -25,13 +25,12 @@
library. It can be include by
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">numeric</span><span class="special">/</span><span class="identifier">odeint</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<p>
which includes all headers in the library. All functions and classes from
odeint live in the namespace
odeint live in the namespace
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">odeint</span><span class="special">;</span>
</pre>
@ -40,7 +39,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -36,7 +36,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -26,7 +26,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -202,7 +202,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -35,9 +35,9 @@
Output Stepper</a>. Depending on the abilities of the stepper, the integrate
functions make use of step-size control or dense output.
</p>
<a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.equidistant_observer_calls"></a><h5>
<a name="id616050"></a>
<a class="link" href="integrate_functions.html#boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.equidistant_observer_calls">Equidistant
<h5>
<a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.h0"></a>
<span><a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.equidistant_observer_calls"></a></span><a class="link" href="integrate_functions.html#boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.equidistant_observer_calls">Equidistant
observer calls</a>
</h5>
<p>
@ -101,16 +101,16 @@
is considerably larger than typical step sizes used by the stepper.
</li>
<li>
If <code class="computeroutput"><span class="identifier">stepper</span></code> is a __dense_out_stepper
If <code class="computeroutput"><span class="identifier">stepper</span></code> is a __dense_outout_stepper
then <code class="computeroutput"><span class="identifier">dt</span></code> is the initial
step size. The actual step size will be adjusted during integration due
to error control. If an observer is provided dense output is used to
calculate <span class="emphasis"><em>x(t)</em></span> at <span class="emphasis"><em>t = t<sub>0</sub> + n dt</em></span>.
</li>
</ul></div>
<a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.observer_calls_at_each_step"></a><h5>
<a name="id616586"></a>
<a class="link" href="integrate_functions.html#boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.observer_calls_at_each_step">Observer
<h5>
<a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.h1"></a>
<span><a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.observer_calls_at_each_step"></a></span><a class="link" href="integrate_functions.html#boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.observer_calls_at_each_step">Observer
calls at each step</a>
</h5>
<p>
@ -170,15 +170,16 @@
the first step at <code class="computeroutput"><span class="identifier">t0</span></code>).
</li>
<li>
If stepper is a __dense_out_stepper then <code class="computeroutput"><span class="identifier">dt</span></code>
If stepper is a <a class="link" href="../concepts/dense_output_stepper.html" title="Dense Output Stepper">Dense
Output Stepper</a> then <code class="computeroutput"><span class="identifier">dt</span></code>
is the initial step size and <code class="computeroutput"><span class="identifier">integrate_adaptive</span></code>
behaves just like for <a class="link" href="../concepts/controlled_stepper.html" title="Controlled Stepper">Controlled
Stepper</a> above. No dense output is used.
</li>
</ul></div>
<a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.observer_calls_at_given_time_points"></a><h5>
<a name="id617084"></a>
<a class="link" href="integrate_functions.html#boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.observer_calls_at_given_time_points">Observer
<h5>
<a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.h2"></a>
<span><a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.observer_calls_at_given_time_points"></a></span><a class="link" href="integrate_functions.html#boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.observer_calls_at_given_time_points">Observer
calls at given time points</a>
</h5>
<p>
@ -251,9 +252,9 @@
at the time points from the sequence.
</li>
</ul></div>
<a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.integrate_a_given_number_of_steps"></a><h5>
<a name="id617684"></a>
<a class="link" href="integrate_functions.html#boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.integrate_a_given_number_of_steps">Integrate
<h5>
<a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.h3"></a>
<span><a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.integrate_a_given_number_of_steps"></a></span><a class="link" href="integrate_functions.html#boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.integrate_a_given_number_of_steps">Integrate
a given number of steps</a>
</h5>
<p>
@ -308,9 +309,9 @@
This function returns the end time <code class="computeroutput"><span class="identifier">t0</span>
<span class="special">+</span> <span class="identifier">n</span><span class="special">*</span><span class="identifier">dt</span></code>.
</p>
<a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.convenience_integrate_function"></a><h5>
<a name="id618121"></a>
<a class="link" href="integrate_functions.html#boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.convenience_integrate_function">Convenience
<h5>
<a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.h4"></a>
<span><a name="boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.convenience_integrate_function"></a></span><a class="link" href="integrate_functions.html#boost_sandbox_numeric_odeint.odeint_in_detail.integrate_functions.convenience_integrate_function">Convenience
integrate function</a>
</h5>
<p>
@ -344,7 +345,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -130,15 +130,14 @@
is the Runge Kutta stepper of fourth order:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">runge_kutta4</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="identifier">rk</span><span class="special">;</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// In-place transformation of inout
</span><span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// Ok
</span><span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// Out-of-place transformation
</span><span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">dxdtin</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// In-place tranformation of inout
</span><span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">dxdtin</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// Out-of-place transformation
</span></pre>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// In-place transformation of inout</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// Ok</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// Out-of-place transformation</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">dxdtin</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// In-place tranformation of inout</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">dxdtin</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// Out-of-place transformation</span>
</pre>
<p>
</p>
<p>
@ -175,21 +174,20 @@
how the FSAL steppers can be used is
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="identifier">rk</span><span class="special">;</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// DONT do this, sys1 is assumed
</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// DONT do this, sys1 is assumed</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">in2</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">in3</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// DONT do this, in2 is assumed
</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">in3</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// DONT do this, in2 is assumed</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">dxdtinout</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">dxdtinout</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// Ok, internal derivative is not used, dxdtinout is updated
</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">dxdtinout</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// Ok, internal derivative is not used, dxdtinout is updated</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys1</span> <span class="special">,</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">dxdtin</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dxdtout</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">dxdtin</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dxdtout</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// Ok, internal derivative is not used
</span></pre>
<span class="identifier">rk</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys2</span> <span class="special">,</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">dxdtin</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">out</span> <span class="special">,</span> <span class="identifier">dxdtout</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// Ok, internal derivative is not used</span>
</pre>
<p>
</p>
<div class="caution"><table border="0" summary="Caution">
@ -241,7 +239,6 @@
again simple C-functions of functors. An example is the harmonic oscillator:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">,</span> <span class="number">1</span> <span class="special">&gt;</span> <span class="identifier">vector_type</span><span class="special">;</span>
@ -263,7 +260,6 @@
example for the harmonic oscillator is now:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">vector_type</span> <span class="special">,</span> <span class="identifier">vector_type</span> <span class="special">&gt;</span> <span class="identifier">x</span><span class="special">;</span>
<span class="identifier">x</span><span class="special">.</span><span class="identifier">first</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">1.0</span><span class="special">;</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">second</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
@ -277,7 +273,6 @@
two public method:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">harm_osc</span>
<span class="special">{</span>
@ -295,7 +290,6 @@
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">harm_osc</span> <span class="identifier">h</span><span class="special">;</span>
<span class="identifier">rkn</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">make_pair</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span><span class="special">(</span> <span class="special">&amp;</span><span class="identifier">harm_osc</span><span class="special">::</span><span class="identifier">f1</span> <span class="special">,</span> <span class="identifier">h</span> <span class="special">,</span> <span class="identifier">_1</span> <span class="special">,</span> <span class="identifier">_2</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span><span class="special">(</span> <span class="special">&amp;</span><span class="identifier">harm_osc</span><span class="special">::</span><span class="identifier">f2</span> <span class="special">,</span> <span class="identifier">h</span> <span class="special">,</span> <span class="identifier">_1</span> <span class="special">,</span> <span class="identifier">_2</span> <span class="special">)</span> <span class="special">)</span> <span class="special">,</span>
@ -315,7 +309,6 @@
can be written as
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">vector_type</span> <span class="special">,</span> <span class="identifier">vector_type</span> <span class="special">&gt;</span> <span class="identifier">x</span><span class="special">;</span>
<span class="identifier">x</span><span class="special">.</span><span class="identifier">first</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">1.0</span><span class="special">;</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">second</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
@ -339,7 +332,6 @@
takes q and p without combining them into a pair:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">rkn</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">harm_osc_f1</span> <span class="special">,</span> <span class="identifier">make_pair</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="identifier">q</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="identifier">p</span> <span class="special">)</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="identifier">rkn</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">harm_osc_f1</span> <span class="special">,</span> <span class="identifier">q</span> <span class="special">,</span> <span class="identifier">p</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
@ -405,7 +397,6 @@
steps is instantiated and initialized;
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">adams_bashforth_moulton</span><span class="special">&lt;</span> <span class="number">5</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="identifier">abm</span><span class="special">;</span>
<span class="identifier">abm</span><span class="special">.</span><span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
@ -423,7 +414,6 @@
state of the Adams-Bashforth-Stepper:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">abm</span><span class="special">.</span><span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">runge_kutta_fehlberg78</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;()</span> <span class="special">,</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
</pre>
@ -686,7 +676,6 @@
An example is
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">dense_output_runge_kutta</span><span class="special">&lt;</span> <span class="identifier">controlled_runge_kutta</span><span class="special">&lt;</span> <span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">dense</span><span class="special">;</span>
<span class="identifier">dense</span><span class="special">.</span><span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">in</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
@ -712,7 +701,6 @@
exist:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">make_dense_output</span><span class="special">&lt;</span> <span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">dense2</span> <span class="special">=</span> <span class="identifier">make_dense_output</span><span class="special">(</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;()</span> <span class="special">);</span>
</pre>
@ -730,7 +718,6 @@
for easy use with the integrate functions:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">make_dense_output</span><span class="special">(</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;()</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">inout</span> <span class="special">,</span> <span class="identifier">t_start</span> <span class="special">,</span> <span class="identifier">t_end</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
</pre>
@ -799,15 +786,14 @@
4 internal derivatives of the solution at times <code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">-</span><span class="identifier">dt</span><span class="special">,</span><span class="identifier">t</span><span class="special">-</span><span class="number">2d</span><span class="identifier">t</span><span class="special">,</span><span class="identifier">t</span><span class="special">-</span><span class="number">3d</span><span class="identifier">t</span><span class="special">,</span><span class="identifier">t</span><span class="special">-</span><span class="number">4d</span><span class="identifier">t</span><span class="special">)</span></code>.
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">adams_bashforth_moulton</span><span class="special">&lt;</span> <span class="number">4</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="identifier">stepper</span><span class="special">;</span>
<span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// make one step with the classical Runge-Kutta stepper and initialize the first internal state at time t-4dt
</span><span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// make one step with the classical Runge-Kutta stepper and initialize the first internal state at time t-3dt
</span><span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// make one step with the classical Runge-Kutta stepper and initialize the first internal state at time t-2dt
</span><span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// make one step with the classical Runge-Kutta stepper and initialize the first internal state at time t-dt
</span><span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// make one step with Adam-Bashforth-Moulton, the internal array of states is now rotated
</span></pre>
<span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// make one step with the classical Runge-Kutta stepper and initialize the first internal state at time t-4dt</span>
<span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// make one step with the classical Runge-Kutta stepper and initialize the first internal state at time t-3dt</span>
<span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// make one step with the classical Runge-Kutta stepper and initialize the first internal state at time t-2dt</span>
<span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// make one step with the classical Runge-Kutta stepper and initialize the first internal state at time t-dt</span>
<span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span> <span class="comment">// make one step with Adam-Bashforth-Moulton, the internal array of states is now rotated</span>
</pre>
<p>
</p>
<p>
@ -1900,7 +1886,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -21,7 +21,8 @@
</h3></div></div></div></div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -21,7 +21,8 @@
</h3></div></div></div></div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -41,7 +41,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -294,7 +294,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -20,7 +20,8 @@
</h3></div></div></div></div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -223,7 +223,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -21,7 +21,8 @@
</h3></div></div></div></div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -232,7 +232,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -21,7 +21,8 @@
</h3></div></div></div></div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -31,7 +31,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -20,7 +20,8 @@
</h3></div></div></div></div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -37,7 +37,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -20,7 +20,8 @@
</h3></div></div></div></div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -19,7 +19,8 @@
</h3></div></div></div></div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -191,7 +191,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -39,7 +39,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -236,7 +236,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -61,7 +61,6 @@
The implementation of the Lorenz system is
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">sigma</span> <span class="special">=</span> <span class="number">10.0</span><span class="special">;</span>
<span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">R</span> <span class="special">=</span> <span class="number">28.0</span><span class="special">;</span>
@ -84,7 +83,6 @@
the perturbation could look like:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="number">3</span><span class="special">;</span>
<span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">num_of_lyap</span> <span class="special">=</span> <span class="number">3</span><span class="special">;</span>
@ -116,7 +114,6 @@
inside a functor with templatized arguments:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">lorenz</span>
<span class="special">{</span>
@ -138,11 +135,11 @@
</pre>
<p>
This works fine and <code class="computeroutput"><span class="identifier">lorenz_with_lyap</span></code>
can be used for example via
can be used for example via
</p>
<pre class="programlisting"><span class="identifier">state_type</span> <span class="identifier">x</span><span class="special">;</span>
<span class="comment">// initialize x
</span><span class="identifier">explicit_rk4</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="identifier">rk4</span><span class="special">;</span>
<span class="comment">// initialize x</span>
<span class="identifier">explicit_rk4</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="identifier">rk4</span><span class="special">;</span>
<span class="identifier">integrate_n_steps</span><span class="special">(</span> <span class="identifier">rk4</span> <span class="special">,</span> <span class="identifier">lorenz_with_lyap</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">0.01</span> <span class="special">,</span> <span class="number">1000</span> <span class="special">);</span>
</pre>
<p>
@ -154,11 +151,10 @@
current state lies on the attractor, hence it would look like
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">state_type</span> <span class="identifier">x</span><span class="special">;</span>
<span class="comment">// initialize x
</span><span class="identifier">explicit_rk4</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="identifier">rk4</span><span class="special">;</span>
<span class="comment">// initialize x</span>
<span class="identifier">explicit_rk4</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="identifier">rk4</span><span class="special">;</span>
<span class="identifier">integrate_n_steps</span><span class="special">(</span> <span class="identifier">rk4</span> <span class="special">,</span> <span class="identifier">lorenz</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">0.01</span> <span class="special">,</span> <span class="number">1000</span> <span class="special">);</span>
</pre>
<p>
@ -170,7 +166,6 @@
by pointer to the state and an appropriate length, something similar to
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">lorenz</span><span class="special">(</span> <span class="keyword">double</span><span class="special">*</span> <span class="identifier">x</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">*</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="keyword">double</span> <span class="identifier">t</span><span class="special">,</span> <span class="keyword">void</span><span class="special">*</span> <span class="identifier">params</span> <span class="special">)</span>
<span class="special">{</span>
@ -188,7 +183,6 @@
the system has to by changed:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">lorenz</span>
<span class="special">{</span>
@ -211,10 +205,9 @@
with an suited range:
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// perform 10000 transient steps
</span><span class="identifier">integrate_n_steps</span><span class="special">(</span> <span class="identifier">rk4</span> <span class="special">,</span> <span class="identifier">lorenz</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">n</span> <span class="special">)</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">,</span> <span class="number">10000</span> <span class="special">);</span>
<pre class="programlisting"><span class="comment">// perform 10000 transient steps</span>
<span class="identifier">integrate_n_steps</span><span class="special">(</span> <span class="identifier">rk4</span> <span class="special">,</span> <span class="identifier">lorenz</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">n</span> <span class="special">)</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">,</span> <span class="number">10000</span> <span class="special">);</span>
</pre>
<p>
</p>
@ -242,7 +235,6 @@
</li>
</ol></div>
<p>
</p>
<pre class="programlisting"><span class="identifier">fill</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()+</span><span class="identifier">n</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">);</span>
<span class="keyword">for</span><span class="special">(</span> <span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span> <span class="special">;</span> <span class="identifier">i</span><span class="special">&lt;</span><span class="identifier">num_of_lyap</span> <span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span> <span class="identifier">x</span><span class="special">[</span><span class="identifier">n</span><span class="special">+</span><span class="identifier">n</span><span class="special">*</span><span class="identifier">i</span><span class="special">+</span><span class="identifier">i</span><span class="special">]</span> <span class="special">=</span> <span class="number">1.0</span><span class="special">;</span>
@ -273,7 +265,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -52,7 +52,6 @@
to just define a function, e.g:
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">/* The type of container used to hold the state vector */</span>
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
@ -79,7 +78,6 @@
parameter structure as above:
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">/* The rhs of x' = f(x) defined as a class */</span>
<span class="keyword">class</span> <span class="identifier">harm_osc</span> <span class="special">{</span>
@ -1138,7 +1136,6 @@
<span class="special">)</span></code> function from odeint:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">runge_kutta4</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="identifier">stepper</span><span class="special">;</span>
<span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">stepper</span> <span class="special">,</span> <span class="identifier">harmonic_oscillator</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="number">0.01</span> <span class="special">);</span>
@ -1155,7 +1152,6 @@
method which can used directly. So, you write down the above example as
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">dt</span> <span class="special">=</span> <span class="number">0.01</span><span class="special">;</span>
<span class="keyword">for</span><span class="special">(</span> <span class="keyword">double</span> <span class="identifier">t</span><span class="special">=</span><span class="number">0.0</span> <span class="special">;</span> <span class="identifier">t</span><span class="special">&lt;</span><span class="number">10.0</span> <span class="special">;</span> <span class="identifier">t</span><span class="special">+=</span> <span class="identifier">dt</span> <span class="special">)</span>
@ -1179,7 +1175,6 @@
with 4th order error estimation and coefficients introduced by Cash-Karp.
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">runge_kutta_cash_karp54</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">&gt;</span> <span class="identifier">error_stepper_type</span><span class="special">;</span>
</pre>
@ -1192,7 +1187,6 @@
stepper exists which can be used via
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">controlled_runge_kutta</span><span class="special">&lt;</span> <span class="identifier">error_stepper_type</span> <span class="special">&gt;</span> <span class="identifier">controlled_stepper_type</span><span class="special">;</span>
<span class="identifier">controlled_stepper_type</span> <span class="identifier">controlled_stepper</span><span class="special">;</span>
@ -1219,7 +1213,6 @@
by using <code class="computeroutput"><span class="identifier">make_controlled</span></code>:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">integrate_adaptive</span><span class="special">(</span> <span class="identifier">make_controlled</span><span class="special">&lt;</span> <span class="identifier">error_stepper_type</span> <span class="special">&gt;(</span> <span class="number">1.0e-10</span> <span class="special">,</span> <span class="number">1.0e-6</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">harmonic_oscillator</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="number">0.01</span> <span class="special">);</span>
</pre>
@ -1235,7 +1228,6 @@
is
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">integrate_adaptive</span><span class="special">(</span> <span class="identifier">make_controlled</span><span class="special">(</span> <span class="number">1.0e-10</span> <span class="special">,</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="identifier">error_stepper_type</span><span class="special">()</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">harmonic_oscillator</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="number">0.01</span> <span class="special">);</span>
</pre>
@ -1251,7 +1243,6 @@
with all parameters is therefore
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">abs_err</span> <span class="special">=</span> <span class="number">1.0e-10</span> <span class="special">,</span> <span class="identifier">rel_err</span> <span class="special">=</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="identifier">a_x</span> <span class="special">=</span> <span class="number">1.0</span> <span class="special">,</span> <span class="identifier">a_dxdt</span> <span class="special">=</span> <span class="number">1.0</span><span class="special">;</span>
<span class="identifier">controlled_stepper_type</span> <span class="identifier">controlled_stepper</span><span class="special">(</span> <span class="identifier">default_error_checker</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;(</span> <span class="identifier">abs_err</span> <span class="special">,</span> <span class="identifier">rel_err</span> <span class="special">,</span> <span class="identifier">a_x</span> <span class="special">,</span> <span class="identifier">a_dxdt</span> <span class="special">)</span> <span class="special">);</span>
@ -1453,7 +1444,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -74,7 +74,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -98,7 +98,6 @@
space as well as the velocity. Therefore, we use the operators from <a href="http://www.boost.org/doc/libs/release/doc/html/operators.html" target="_top">Boost.Operators</a>:
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">/*the point type */</span>
<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T</span> <span class="special">,</span> <span class="identifier">size_t</span> <span class="identifier">Dim</span> <span class="special">&gt;</span>
@ -114,20 +113,20 @@
<span class="keyword">typedef</span> <span class="identifier">T</span> <span class="identifier">value_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">point</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">dim</span> <span class="special">&gt;</span> <span class="identifier">point_type</span><span class="special">;</span>
<span class="comment">// ...
</span> <span class="comment">// constructors
</span>
<span class="comment">// ...
</span> <span class="comment">// operators
</span>
<span class="comment">// ...</span>
<span class="comment">// constructors</span>
<span class="comment">// ...</span>
<span class="comment">// operators</span>
<span class="keyword">private</span><span class="special">:</span>
<span class="identifier">T</span> <span class="identifier">m_val</span><span class="special">[</span><span class="identifier">dim</span><span class="special">];</span>
<span class="special">};</span>
<span class="comment">//...
</span> <span class="comment">// more operators
</span> </pre>
<span class="comment">//...</span>
<span class="comment">// more operators</span>
</pre>
<p>
</p>
<p>
@ -136,10 +135,9 @@
type we use <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">tr1</span><span class="special">::</span><span class="identifier">array</span></code>
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// we simulate 5 planets and the sun
</span><span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="number">6</span><span class="special">;</span>
<pre class="programlisting"><span class="comment">// we simulate 5 planets and the sun</span>
<span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="number">6</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">point</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">,</span> <span class="number">3</span> <span class="special">&gt;</span> <span class="identifier">point_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span> <span class="identifier">point_type</span> <span class="special">,</span> <span class="identifier">n</span> <span class="special">&gt;</span> <span class="identifier">container_type</span><span class="special">;</span>
@ -159,7 +157,6 @@
As system function we have to provide <span class="emphasis"><em>f(p)</em></span> and <span class="emphasis"><em>f(q)</em></span>:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">gravitational_constant</span> <span class="special">=</span> <span class="number">2.95912208286e-4</span><span class="special">;</span>
@ -179,7 +176,6 @@
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">solar_system_momentum</span>
<span class="special">{</span>
@ -221,7 +217,6 @@
apply here:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">symplectic_rkn_sb3a_mclachlan</span><span class="special">&lt;</span> <span class="identifier">container_type</span> <span class="special">&gt;</span> <span class="identifier">stepper_type</span><span class="special">;</span>
<span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">dt</span> <span class="special">=</span> <span class="number">100.0</span><span class="special">;</span>
@ -246,7 +241,6 @@
The reference wrapper is also passed, but this is not a problem at all:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">streaming_observer</span>
<span class="special">{</span>
@ -273,7 +267,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -63,7 +63,6 @@
code is very simple
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span> <span class="identifier">complex</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="special">,</span> <span class="number">1</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
@ -89,7 +88,6 @@
function. In this cast the Stuart-Landau oscillator looks like
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">eta</span> <span class="special">=</span> <span class="number">1.0</span><span class="special">;</span>
<span class="keyword">double</span> <span class="identifier">alpha</span> <span class="special">=</span> <span class="number">1.0</span><span class="special">;</span>
@ -111,7 +109,6 @@
Integration is also very easy:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">state_type</span> <span class="identifier">x</span> <span class="special">=</span> <span class="special">{{</span> <span class="identifier">complex</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;(</span> <span class="number">1.0</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">)</span> <span class="special">}};</span>
@ -156,7 +153,6 @@
components. Here, is how this function looks like
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">vector</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">container_type</span><span class="special">;</span>
@ -166,8 +162,8 @@
<span class="identifier">fpu</span><span class="special">(</span> <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">beta</span> <span class="special">=</span> <span class="number">1.0</span> <span class="special">)</span> <span class="special">:</span> <span class="identifier">m_beta</span><span class="special">(</span> <span class="identifier">beta</span> <span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
<span class="comment">// system function defining the ODE
</span> <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">q</span> <span class="special">,</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">dpdt</span> <span class="special">)</span> <span class="keyword">const</span>
<span class="comment">// system function defining the ODE</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">q</span> <span class="special">,</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">dpdt</span> <span class="special">)</span> <span class="keyword">const</span>
<span class="special">{</span>
<span class="identifier">size_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span>
<span class="keyword">double</span> <span class="identifier">tmp</span> <span class="special">=</span> <span class="identifier">q</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">-</span> <span class="number">0.0</span><span class="special">;</span>
@ -185,17 +181,17 @@
<span class="identifier">dpdt</span><span class="special">[</span><span class="identifier">n</span><span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">+=</span> <span class="identifier">tmp2</span><span class="special">;</span>
<span class="special">}</span>
<span class="comment">// calculates the energy of the system
</span> <span class="keyword">double</span> <span class="identifier">energy</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">q</span> <span class="special">,</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">p</span> <span class="special">)</span> <span class="keyword">const</span>
<span class="comment">// calculates the energy of the system</span>
<span class="keyword">double</span> <span class="identifier">energy</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">q</span> <span class="special">,</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">p</span> <span class="special">)</span> <span class="keyword">const</span>
<span class="special">{</span>
<span class="comment">// ...
</span> <span class="special">}</span>
<span class="comment">// ...</span>
<span class="special">}</span>
<span class="comment">// calculates the local energy of the system
</span> <span class="keyword">void</span> <span class="identifier">local_energy</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">q</span> <span class="special">,</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">p</span> <span class="special">,</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">e</span> <span class="special">)</span> <span class="keyword">const</span>
<span class="comment">// calculates the local energy of the system</span>
<span class="keyword">void</span> <span class="identifier">local_energy</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">q</span> <span class="special">,</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">p</span> <span class="special">,</span> <span class="identifier">container_type</span> <span class="special">&amp;</span><span class="identifier">e</span> <span class="special">)</span> <span class="keyword">const</span>
<span class="special">{</span>
<span class="comment">// ...
</span> <span class="special">}</span>
<span class="comment">// ...</span>
<span class="special">}</span>
<span class="special">};</span>
</pre>
<p>
@ -208,7 +204,6 @@
All this can be easily done with the following piece of code:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="number">64</span><span class="special">;</span>
<span class="identifier">container_type</span> <span class="identifier">q</span><span class="special">(</span> <span class="identifier">n</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">p</span><span class="special">(</span> <span class="identifier">n</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">);</span>
@ -235,7 +230,6 @@
The observer is more or less trivial
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">streaming_observer</span>
<span class="special">{</span>
@ -304,7 +298,6 @@
also need to store the individual frequencies of each oscillator.
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">vector</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">container_type</span><span class="special">;</span>
@ -367,7 +360,6 @@
and we record <span class="emphasis"><em>Z</em></span> for different values of <span class="emphasis"><em>&#949;</em></span>.
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">statistics_observer</span>
<span class="special">{</span>
@ -400,7 +392,6 @@
2</em></span>.
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="number">16384</span><span class="special">;</span>
<span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">dt</span> <span class="special">=</span> <span class="number">0.1</span><span class="special">;</span>
@ -411,8 +402,8 @@
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_real</span><span class="special">&lt;&gt;</span> <span class="identifier">unif</span><span class="special">(</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">2.0</span> <span class="special">*</span> <span class="identifier">M_PI</span> <span class="special">);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&amp;,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_real</span><span class="special">&lt;&gt;</span> <span class="special">&gt;</span> <span class="identifier">gen</span><span class="special">(</span> <span class="identifier">rng</span> <span class="special">,</span> <span class="identifier">unif</span> <span class="special">);</span>
<span class="comment">// gamma = 1, the phase transition occurs at epsilon = 2
</span><span class="identifier">phase_ensemble</span> <span class="identifier">ensemble</span><span class="special">(</span> <span class="identifier">n</span> <span class="special">,</span> <span class="number">1.0</span> <span class="special">);</span>
<span class="comment">// gamma = 1, the phase transition occurs at epsilon = 2</span>
<span class="identifier">phase_ensemble</span> <span class="identifier">ensemble</span><span class="special">(</span> <span class="identifier">n</span> <span class="special">,</span> <span class="number">1.0</span> <span class="special">);</span>
<span class="identifier">statistics_observer</span> <span class="identifier">obs</span><span class="special">;</span>
<span class="keyword">for</span><span class="special">(</span> <span class="keyword">double</span> <span class="identifier">epsilon</span> <span class="special">=</span> <span class="number">0.0</span> <span class="special">;</span> <span class="identifier">epsilon</span> <span class="special">&lt;</span> <span class="number">5.0</span> <span class="special">;</span> <span class="identifier">epsilon</span> <span class="special">+=</span> <span class="number">0.1</span> <span class="special">)</span>
@ -420,14 +411,14 @@
<span class="identifier">ensemble</span><span class="special">.</span><span class="identifier">set_epsilon</span><span class="special">(</span> <span class="identifier">epsilon</span> <span class="special">);</span>
<span class="identifier">obs</span><span class="special">.</span><span class="identifier">reset</span><span class="special">();</span>
<span class="comment">// start with random initial conditions
</span> <span class="identifier">generate</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">gen</span> <span class="special">);</span>
<span class="comment">// start with random initial conditions</span>
<span class="identifier">generate</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">gen</span> <span class="special">);</span>
<span class="comment">// calculate some transients steps
</span> <span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">runge_kutta4</span><span class="special">&lt;</span> <span class="identifier">container_type</span> <span class="special">&gt;()</span> <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="identifier">ensemble</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="comment">// calculate some transients steps</span>
<span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">runge_kutta4</span><span class="special">&lt;</span> <span class="identifier">container_type</span> <span class="special">&gt;()</span> <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="identifier">ensemble</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="comment">// integrate and compute the statistics
</span> <span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">runge_kutta4</span><span class="special">&lt;</span> <span class="identifier">container_type</span> <span class="special">&gt;()</span> <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="identifier">ensemble</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">100.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="identifier">obs</span> <span class="special">)</span> <span class="special">);</span>
<span class="comment">// integrate and compute the statistics</span>
<span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">runge_kutta4</span><span class="special">&lt;</span> <span class="identifier">container_type</span> <span class="special">&gt;()</span> <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="identifier">ensemble</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">100.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="identifier">obs</span> <span class="special">)</span> <span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">epsilon</span> <span class="special">&lt;&lt;</span> <span class="string">"\t"</span> <span class="special">&lt;&lt;</span> <span class="identifier">obs</span><span class="special">.</span><span class="identifier">get_K_mean</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
@ -458,7 +449,6 @@
all quantities
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">numeric</span><span class="special">/</span><span class="identifier">odeint</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">numeric</span><span class="special">/</span><span class="identifier">odeint</span><span class="special">/</span><span class="identifier">algebra</span><span class="special">/</span><span class="identifier">fusion_algebra</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
@ -496,7 +486,6 @@
equivalent to the example in the first section of this tutorial
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">oscillator</span>
<span class="special">{</span>
@ -520,7 +509,6 @@
Furthermore, the basic calculations are now performed by the <code class="computeroutput"><span class="identifier">fusion_algebra</span></code> which must also be given.
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">,</span> <span class="identifier">deriv_type</span> <span class="special">,</span> <span class="identifier">time_type</span> <span class="special">,</span> <span class="identifier">fusion_algebra</span> <span class="special">&gt;</span> <span class="identifier">stepper_type</span><span class="special">;</span>
@ -535,7 +523,6 @@
the observer is defined a bit different
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">streaming_observer</span>
<span class="special">{</span>
@ -607,7 +594,6 @@
The definition of the system is
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">ublas</span><span class="special">::</span><span class="identifier">matrix</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
@ -701,7 +687,6 @@
Here is a simple example:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">mpf_class</span> <span class="identifier">value_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="number">3</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
@ -726,7 +711,6 @@
which can be used
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">precision</span> <span class="special">=</span> <span class="number">1024</span><span class="special">;</span>
<span class="identifier">mpf_set_default_prec</span><span class="special">(</span> <span class="identifier">precision</span> <span class="special">);</span>
@ -788,7 +772,6 @@
is kept which should be changed whenever the states' size change.
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">vector</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">coord_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">coord_type</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
@ -804,8 +787,8 @@
<span class="special">:</span> <span class="identifier">m_max_N</span><span class="special">(</span> <span class="identifier">max_N</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">m_beta</span><span class="special">(</span> <span class="identifier">beta</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">m_pot_start_index</span><span class="special">(</span> <span class="identifier">pot_start_index</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">m_pot</span><span class="special">(</span> <span class="identifier">max_N</span> <span class="special">)</span>
<span class="special">{</span>
<span class="identifier">srand</span><span class="special">(</span> <span class="identifier">time</span><span class="special">(</span> <span class="identifier">NULL</span> <span class="special">)</span> <span class="special">);</span>
<span class="comment">// fill random potential with iid values from [0,1]
</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span> <span class="identifier">rng</span><span class="special">;</span>
<span class="comment">// fill random potential with iid values from [0,1]</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span> <span class="identifier">rng</span><span class="special">;</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_real</span><span class="special">&lt;&gt;</span> <span class="identifier">unif</span><span class="special">(</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">1.0</span> <span class="special">);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&amp;,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_real</span><span class="special">&lt;&gt;</span> <span class="special">&gt;</span> <span class="identifier">gen</span><span class="special">(</span> <span class="identifier">rng</span> <span class="special">,</span> <span class="identifier">unif</span> <span class="special">);</span>
<span class="identifier">generate</span><span class="special">(</span> <span class="identifier">m_pot</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">m_pot</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">gen</span> <span class="special">);</span>
@ -813,9 +796,9 @@
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="keyword">const</span> <span class="identifier">coord_type</span> <span class="special">&amp;</span><span class="identifier">q</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">&amp;</span><span class="identifier">dpdt</span> <span class="special">)</span>
<span class="special">{</span>
<span class="comment">// calculate dpdt = -dH/dq of this hamiltonian system
</span> <span class="comment">// dp_i/dt = - V_i * q_i^3 - beta*(q_i - q_{i-1})^3 + beta*(q_{i+1} - q_i)^3
</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">N</span> <span class="special">=</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span>
<span class="comment">// calculate dpdt = -dH/dq of this hamiltonian system</span>
<span class="comment">// dp_i/dt = - V_i * q_i^3 - beta*(q_i - q_{i-1})^3 + beta*(q_{i+1} - q_i)^3</span>
<span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">N</span> <span class="special">=</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span>
<span class="keyword">double</span> <span class="identifier">diff</span> <span class="special">=</span> <span class="identifier">q</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">-</span> <span class="identifier">q</span><span class="special">[</span><span class="identifier">N</span><span class="special">-</span><span class="number">1</span><span class="special">];</span>
<span class="keyword">for</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span> <span class="special">;</span> <span class="identifier">i</span><span class="special">&lt;</span><span class="identifier">N</span> <span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
<span class="special">{</span>
@ -828,8 +811,8 @@
<span class="keyword">void</span> <span class="identifier">energy_distribution</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">coord_type</span> <span class="special">&amp;</span><span class="identifier">q</span> <span class="special">,</span> <span class="keyword">const</span> <span class="identifier">coord_type</span> <span class="special">&amp;</span><span class="identifier">p</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">&amp;</span><span class="identifier">energies</span> <span class="special">)</span>
<span class="special">{</span>
<span class="comment">// computes the energy per lattice site normalized by total energy
</span> <span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">N</span> <span class="special">=</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span>
<span class="comment">// computes the energy per lattice site normalized by total energy</span>
<span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">N</span> <span class="special">=</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span>
<span class="keyword">double</span> <span class="identifier">en</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
<span class="keyword">for</span><span class="special">(</span> <span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span> <span class="special">;</span> <span class="identifier">i</span><span class="special">&lt;</span><span class="identifier">N</span> <span class="special">;</span> <span class="identifier">i</span><span class="special">++</span> <span class="special">)</span>
<span class="special">{</span>
@ -848,8 +831,8 @@
<span class="keyword">double</span> <span class="identifier">energy</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">coord_type</span> <span class="special">&amp;</span><span class="identifier">q</span> <span class="special">,</span> <span class="keyword">const</span> <span class="identifier">coord_type</span> <span class="special">&amp;</span><span class="identifier">p</span> <span class="special">)</span>
<span class="special">{</span>
<span class="comment">// calculates the total energy of the excitation
</span> <span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">N</span> <span class="special">=</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span>
<span class="comment">// calculates the total energy of the excitation</span>
<span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">N</span> <span class="special">=</span> <span class="identifier">q</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span>
<span class="keyword">double</span> <span class="identifier">en</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
<span class="keyword">for</span><span class="special">(</span> <span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span> <span class="special">;</span> <span class="identifier">i</span><span class="special">&lt;</span><span class="identifier">N</span> <span class="special">;</span> <span class="identifier">i</span><span class="special">++</span> <span class="special">)</span>
<span class="special">{</span>
@ -874,25 +857,24 @@
of 60.
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">//start with 60 sites
</span><span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">N_start</span> <span class="special">=</span> <span class="number">60</span><span class="special">;</span>
<pre class="programlisting"><span class="comment">//start with 60 sites</span>
<span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">N_start</span> <span class="special">=</span> <span class="number">60</span><span class="special">;</span>
<span class="identifier">coord_type</span> <span class="identifier">q</span><span class="special">(</span> <span class="identifier">N_start</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">);</span>
<span class="identifier">q</span><span class="special">.</span><span class="identifier">reserve</span><span class="special">(</span> <span class="identifier">max_N</span> <span class="special">);</span>
<span class="identifier">coord_type</span> <span class="identifier">p</span><span class="special">(</span> <span class="identifier">N_start</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">);</span>
<span class="identifier">p</span><span class="special">.</span><span class="identifier">reserve</span><span class="special">(</span> <span class="identifier">max_N</span> <span class="special">);</span>
<span class="comment">// start with uniform momentum distribution over 20 sites
</span><span class="identifier">fill</span><span class="special">(</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()+</span><span class="number">20</span> <span class="special">,</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">end</span><span class="special">()-</span><span class="number">20</span> <span class="special">,</span> <span class="number">1.0</span><span class="special">/</span><span class="identifier">sqrt</span><span class="special">(</span><span class="number">20</span><span class="special">)</span> <span class="special">);</span>
<span class="comment">// start with uniform momentum distribution over 20 sites</span>
<span class="identifier">fill</span><span class="special">(</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()+</span><span class="number">20</span> <span class="special">,</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">end</span><span class="special">()-</span><span class="number">20</span> <span class="special">,</span> <span class="number">1.0</span><span class="special">/</span><span class="identifier">sqrt</span><span class="special">(</span><span class="number">20</span><span class="special">)</span> <span class="special">);</span>
<span class="identifier">coord_type</span> <span class="identifier">distr</span><span class="special">(</span> <span class="identifier">N_start</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">);</span>
<span class="identifier">distr</span><span class="special">.</span><span class="identifier">reserve</span><span class="special">(</span> <span class="identifier">max_N</span> <span class="special">);</span>
<span class="comment">// create the system
</span><span class="identifier">compacton_lattice</span> <span class="identifier">lattice</span><span class="special">(</span> <span class="identifier">max_N</span> <span class="special">,</span> <span class="identifier">beta</span> <span class="special">,</span> <span class="special">(</span><span class="identifier">max_N</span><span class="special">-</span><span class="identifier">N_start</span><span class="special">)/</span><span class="number">2</span> <span class="special">);</span>
<span class="comment">// create the system</span>
<span class="identifier">compacton_lattice</span> <span class="identifier">lattice</span><span class="special">(</span> <span class="identifier">max_N</span> <span class="special">,</span> <span class="identifier">beta</span> <span class="special">,</span> <span class="special">(</span><span class="identifier">max_N</span><span class="special">-</span><span class="identifier">N_start</span><span class="special">)/</span><span class="number">2</span> <span class="special">);</span>
<span class="comment">//create the stepper, note that we use an always_resizer because state size might change during steps
</span><span class="keyword">typedef</span> <span class="identifier">symplectic_rkn_sb3a_mclachlan</span><span class="special">&lt;</span> <span class="identifier">coord_type</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">,</span>
<span class="comment">//create the stepper, note that we use an always_resizer because state size might change during steps</span>
<span class="keyword">typedef</span> <span class="identifier">symplectic_rkn_sb3a_mclachlan</span><span class="special">&lt;</span> <span class="identifier">coord_type</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">,</span> <span class="keyword">double</span> <span class="special">,</span>
<span class="identifier">range_algebra</span> <span class="special">,</span> <span class="identifier">default_operations</span> <span class="special">,</span> <span class="identifier">always_resizer</span> <span class="special">&gt;</span> <span class="identifier">hamiltonian_stepper</span><span class="special">;</span>
<span class="identifier">hamiltonian_stepper</span> <span class="identifier">stepper</span><span class="special">;</span>
<span class="identifier">hamiltonian_stepper</span><span class="special">::</span><span class="identifier">state_type</span> <span class="identifier">state</span> <span class="special">=</span> <span class="identifier">make_pair</span><span class="special">(</span> <span class="identifier">q</span> <span class="special">,</span> <span class="identifier">p</span> <span class="special">);</span>
@ -910,7 +892,6 @@
the start index of the potential changes in this case.
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">t</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
<span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">dt</span> <span class="special">=</span> <span class="number">0.1</span><span class="special">;</span>
@ -943,7 +924,6 @@
, <code class="computeroutput"><span class="identifier">p</span></code> and <code class="computeroutput"><span class="identifier">distr</span></code>.
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">do_resize</span><span class="special">(</span> <span class="identifier">coord_type</span> <span class="special">&amp;</span><span class="identifier">q</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">&amp;</span><span class="identifier">p</span> <span class="special">,</span> <span class="identifier">coord_type</span> <span class="special">&amp;</span><span class="identifier">distr</span> <span class="special">,</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">N</span> <span class="special">)</span>
<span class="special">{</span>
@ -961,7 +941,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -45,7 +45,6 @@
is needed. Here is the definition of the above example
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">ublas</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">vector_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">ublas</span><span class="special">::</span><span class="identifier">matrix</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">matrix_type</span><span class="special">;</span>
@ -82,7 +81,6 @@
just templatize the <code class="computeroutput"><span class="keyword">operator</span><span class="special">()</span></code>:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">ublas</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">vector_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">ublas</span><span class="special">::</span><span class="identifier">matrix</span><span class="special">&lt;</span> <span class="keyword">double</span> <span class="special">&gt;</span> <span class="identifier">matrix_type</span><span class="special">;</span>
@ -118,7 +116,6 @@
all the other stepper:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">vector_type</span> <span class="identifier">x</span><span class="special">(</span> <span class="number">3</span> <span class="special">,</span> <span class="number">1.0</span> <span class="special">);</span>
@ -135,7 +132,6 @@
5 method with step size control and dense output yields 1531 steps.
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">vector_type</span> <span class="identifier">x2</span><span class="special">(</span> <span class="number">3</span> <span class="special">,</span> <span class="number">1.0</span> <span class="special">);</span>
@ -155,7 +151,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -87,15 +87,14 @@
website.
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">//change this to float if your device does not support double computation
</span><span class="keyword">typedef</span> <span class="keyword">double</span> <span class="identifier">value_type</span><span class="special">;</span>
<pre class="programlisting"><span class="comment">//change this to float if your device does not support double computation</span>
<span class="keyword">typedef</span> <span class="keyword">double</span> <span class="identifier">value_type</span><span class="special">;</span>
<span class="comment">//change this to host_vector&lt; ... &gt; of you want to run on CPU
</span><span class="keyword">typedef</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">device_vector</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
<span class="comment">// typedef thrust::host_vector&lt; value_type &gt; state_type;
</span></pre>
<span class="comment">//change this to host_vector&lt; ... &gt; of you want to run on CPU</span>
<span class="keyword">typedef</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">device_vector</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
<span class="comment">// typedef thrust::host_vector&lt; value_type &gt; state_type;</span>
</pre>
<p>
</p>
<p>
@ -103,7 +102,7 @@
a calculation on the GPU you usually have to call a global function like
<code class="computeroutput"><span class="identifier">thrust</span><span class="special">::</span><span class="identifier">for_each</span></code>, <code class="computeroutput"><span class="identifier">thrust</span><span class="special">::</span><span class="identifier">reduce</span></code>,
... with an appropriate local functor which performs the basic operation.
An example is
An example is
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">add_two</span>
<span class="special">{</span>
@ -115,8 +114,8 @@
<span class="special">}</span>
<span class="special">};</span>
<span class="comment">// ...
</span>
<span class="comment">// ...</span>
<span class="identifier">thrust</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">add_two</span><span class="special">()</span> <span class="special">);</span>
</pre>
<p>
@ -138,7 +137,6 @@
The mean field is calculated in a class <code class="computeroutput"><span class="identifier">mean_field_calculator</span></code>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">mean_field_calculator</span>
<span class="special">{</span>
@ -192,7 +190,6 @@
GPU as well as on the CPU. The line
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">value_type</span> <span class="identifier">sin_sum</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">reduce</span><span class="special">(</span>
<span class="identifier">thrust</span><span class="special">::</span><span class="identifier">make_transform_iterator</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">sin_functor</span><span class="special">()</span> <span class="special">)</span> <span class="special">,</span>
@ -208,7 +205,6 @@
The system function is defined via
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">phase_oscillator_ensemble</span>
<span class="special">{</span>
@ -230,8 +226,8 @@
<span class="special">}</span>
<span class="special">};</span>
<span class="comment">// ...
</span>
<span class="comment">// ...</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()</span> <span class="special">(</span> <span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">x</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">dt</span> <span class="special">)</span> <span class="keyword">const</span>
<span class="special">{</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">mean_field</span> <span class="special">=</span> <span class="identifier">mean_field_calculator</span><span class="special">::</span><span class="identifier">get_mean</span><span class="special">(</span> <span class="identifier">x</span> <span class="special">);</span>
@ -243,8 +239,8 @@
<span class="special">);</span>
<span class="special">}</span>
<span class="comment">// ...
</span><span class="special">};</span>
<span class="comment">// ...</span>
<span class="special">};</span>
</pre>
<p>
</p>
@ -264,7 +260,6 @@
thrust algebra:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">runge_kutta4</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">thrust_algebra</span> <span class="special">,</span> <span class="identifier">thrust_operations</span> <span class="special">&gt;</span> <span class="identifier">stepper_type</span><span class="special">;</span>
</pre>
@ -274,7 +269,6 @@
Of course, you can also use a controlled or dense output stepper, e.g.
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">thrust_algebra</span> <span class="special">,</span> <span class="identifier">thrust_operations</span> <span class="special">&gt;</span> <span class="identifier">stepper_type</span><span class="special">;</span>
</pre>
@ -285,14 +279,12 @@
an instance of the rhs class and using an integration function:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">phase_oscillator_ensemble</span> <span class="identifier">ensemble</span><span class="special">(</span> <span class="identifier">N</span> <span class="special">,</span> <span class="number">1.0</span> <span class="special">);</span>
</pre>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">size_t</span> <span class="identifier">steps1</span> <span class="special">=</span> <span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">make_controlled</span><span class="special">(</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="identifier">stepper_type</span><span class="special">()</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="identifier">ensemble</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="identifier">t_transients</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
</pre>
@ -334,14 +326,13 @@
in front. The full system class is:
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">//change this to host_vector&lt; ... &gt; of you want to run on CPU
</span><span class="keyword">typedef</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">device_vector</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
<pre class="programlisting"><span class="comment">//change this to host_vector&lt; ... &gt; of you want to run on CPU</span>
<span class="keyword">typedef</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">device_vector</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">state_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">device_vector</span><span class="special">&lt;</span> <span class="identifier">size_t</span> <span class="special">&gt;</span> <span class="identifier">index_vector_type</span><span class="special">;</span>
<span class="comment">//typedef thrust::host_vector&lt; value_type &gt; state_type;
</span><span class="comment">//typedef thrust::host_vector&lt; size_t &gt; index_vector_type;
</span>
<span class="comment">//typedef thrust::host_vector&lt; value_type &gt; state_type;</span>
<span class="comment">//typedef thrust::host_vector&lt; size_t &gt; index_vector_type;</span>
<span class="keyword">class</span> <span class="identifier">phase_oscillators</span>
<span class="special">{</span>
@ -351,29 +342,29 @@
<span class="special">{</span>
<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Tuple</span> <span class="special">&gt;</span>
<span class="identifier">__host__</span> <span class="identifier">__device__</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">Tuple</span> <span class="identifier">t</span> <span class="special">)</span> <span class="comment">// this functor works on tuples of values
</span> <span class="special">{</span>
<span class="comment">// first, unpack the tuple into value, neighbors and omega
</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">phi</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;(</span><span class="identifier">t</span><span class="special">);</span>
<span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">phi_left</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">1</span><span class="special">&gt;(</span><span class="identifier">t</span><span class="special">);</span> <span class="comment">// left neighbor
</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">phi_right</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;(</span><span class="identifier">t</span><span class="special">);</span> <span class="comment">// right neighbor
</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">omega</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">3</span><span class="special">&gt;(</span><span class="identifier">t</span><span class="special">);</span>
<span class="comment">// the dynamical equation
</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">4</span><span class="special">&gt;(</span><span class="identifier">t</span><span class="special">)</span> <span class="special">=</span> <span class="identifier">omega</span> <span class="special">+</span> <span class="identifier">sin</span><span class="special">(</span> <span class="identifier">phi_right</span> <span class="special">-</span> <span class="identifier">phi</span> <span class="special">)</span> <span class="special">+</span> <span class="identifier">sin</span><span class="special">(</span> <span class="identifier">phi</span> <span class="special">-</span> <span class="identifier">phi_left</span> <span class="special">);</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">Tuple</span> <span class="identifier">t</span> <span class="special">)</span> <span class="comment">// this functor works on tuples of values</span>
<span class="special">{</span>
<span class="comment">// first, unpack the tuple into value, neighbors and omega</span>
<span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">phi</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;(</span><span class="identifier">t</span><span class="special">);</span>
<span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">phi_left</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">1</span><span class="special">&gt;(</span><span class="identifier">t</span><span class="special">);</span> <span class="comment">// left neighbor</span>
<span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">phi_right</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;(</span><span class="identifier">t</span><span class="special">);</span> <span class="comment">// right neighbor</span>
<span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">omega</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">3</span><span class="special">&gt;(</span><span class="identifier">t</span><span class="special">);</span>
<span class="comment">// the dynamical equation</span>
<span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">4</span><span class="special">&gt;(</span><span class="identifier">t</span><span class="special">)</span> <span class="special">=</span> <span class="identifier">omega</span> <span class="special">+</span> <span class="identifier">sin</span><span class="special">(</span> <span class="identifier">phi_right</span> <span class="special">-</span> <span class="identifier">phi</span> <span class="special">)</span> <span class="special">+</span> <span class="identifier">sin</span><span class="special">(</span> <span class="identifier">phi</span> <span class="special">-</span> <span class="identifier">phi_left</span> <span class="special">);</span>
<span class="special">}</span>
<span class="special">};</span>
<span class="identifier">phase_oscillators</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">omega</span> <span class="special">)</span>
<span class="special">:</span> <span class="identifier">m_omega</span><span class="special">(</span> <span class="identifier">omega</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">m_N</span><span class="special">(</span> <span class="identifier">omega</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">m_prev</span><span class="special">(</span> <span class="identifier">omega</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">m_next</span><span class="special">(</span> <span class="identifier">omega</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">)</span>
<span class="special">{</span>
<span class="comment">// build indices pointing to left and right neighbours
</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">counting_iterator</span><span class="special">&lt;</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">c</span><span class="special">(</span> <span class="number">0</span> <span class="special">);</span>
<span class="comment">// build indices pointing to left and right neighbours</span>
<span class="identifier">thrust</span><span class="special">::</span><span class="identifier">counting_iterator</span><span class="special">&lt;</span><span class="identifier">size_t</span><span class="special">&gt;</span> <span class="identifier">c</span><span class="special">(</span> <span class="number">0</span> <span class="special">);</span>
<span class="identifier">thrust</span><span class="special">::</span><span class="identifier">copy</span><span class="special">(</span> <span class="identifier">c</span> <span class="special">,</span> <span class="identifier">c</span><span class="special">+</span><span class="identifier">m_N</span><span class="special">-</span><span class="number">1</span> <span class="special">,</span> <span class="identifier">m_prev</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()+</span><span class="number">1</span> <span class="special">);</span>
<span class="identifier">m_prev</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="comment">// m_prev = { 0 , 0 , 1 , 2 , 3 , ... , N-1 }
</span>
<span class="identifier">m_prev</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="comment">// m_prev = { 0 , 0 , 1 , 2 , 3 , ... , N-1 }</span>
<span class="identifier">thrust</span><span class="special">::</span><span class="identifier">copy</span><span class="special">(</span> <span class="identifier">c</span><span class="special">+</span><span class="number">1</span> <span class="special">,</span> <span class="identifier">c</span><span class="special">+</span><span class="identifier">m_N</span> <span class="special">,</span> <span class="identifier">m_next</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">);</span>
<span class="identifier">m_next</span><span class="special">[</span><span class="identifier">m_N</span><span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">m_N</span><span class="special">-</span><span class="number">1</span><span class="special">;</span> <span class="comment">// m_next = { 1 , 2 , 3 , ... , N-1 , N-1 }
</span> <span class="special">}</span>
<span class="identifier">m_next</span><span class="special">[</span><span class="identifier">m_N</span><span class="special">-</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">m_N</span><span class="special">-</span><span class="number">1</span><span class="special">;</span> <span class="comment">// m_next = { 1 , 2 , 3 , ... , N-1 , N-1 }</span>
<span class="special">}</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()</span> <span class="special">(</span> <span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">x</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">dt</span> <span class="special">)</span>
<span class="special">{</span>
@ -423,34 +414,28 @@
current state, hence the phase of each oscillator.
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// create random number generators
</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span> <span class="identifier">rng</span><span class="special">;</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_real</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">unif</span><span class="special">(</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">2.0</span> <span class="special">*</span> <span class="identifier">pi</span> <span class="special">);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&amp;,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_real</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">gen</span><span class="special">(</span> <span class="identifier">rng</span> <span class="special">,</span> <span class="identifier">unif</span> <span class="special">);</span>
<span class="comment">// create initial conditions and omegas on host:
</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">x_host</span><span class="special">(</span> <span class="identifier">N</span> <span class="special">);</span>
<pre class="programlisting"><span class="comment">// create initial conditions and omegas on host:</span>
<span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">x_host</span><span class="special">(</span> <span class="identifier">N</span> <span class="special">);</span>
<span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">omega_host</span><span class="special">(</span> <span class="identifier">N</span> <span class="special">);</span>
<span class="keyword">for</span><span class="special">(</span> <span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span> <span class="special">;</span> <span class="identifier">i</span><span class="special">&lt;</span><span class="identifier">N</span> <span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
<span class="special">{</span>
<span class="identifier">x_host</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">gen</span><span class="special">();</span>
<span class="identifier">omega_host</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special">=</span> <span class="special">(</span> <span class="identifier">N</span> <span class="special">-</span> <span class="identifier">i</span> <span class="special">)</span> <span class="special">*</span> <span class="identifier">epsilon</span><span class="special">;</span> <span class="comment">// decreasing frequencies
</span><span class="special">}</span>
<span class="identifier">x_host</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special">=</span> <span class="number">2.0</span> <span class="special">*</span> <span class="identifier">pi</span> <span class="special">*</span> <span class="identifier">drand48</span><span class="special">();</span>
<span class="identifier">omega_host</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special">=</span> <span class="special">(</span> <span class="identifier">N</span> <span class="special">-</span> <span class="identifier">i</span> <span class="special">)</span> <span class="special">*</span> <span class="identifier">epsilon</span><span class="special">;</span> <span class="comment">// decreasing frequencies</span>
<span class="special">}</span>
<span class="comment">// copy to device
</span><span class="identifier">state_type</span> <span class="identifier">x</span> <span class="special">=</span> <span class="identifier">x_host</span><span class="special">;</span>
<span class="comment">// copy to device</span>
<span class="identifier">state_type</span> <span class="identifier">x</span> <span class="special">=</span> <span class="identifier">x_host</span><span class="special">;</span>
<span class="identifier">state_type</span> <span class="identifier">omega</span> <span class="special">=</span> <span class="identifier">omega_host</span><span class="special">;</span>
<span class="comment">// create stepper
</span><span class="identifier">runge_kutta4</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">thrust_algebra</span> <span class="special">,</span> <span class="identifier">thrust_operations</span> <span class="special">&gt;</span> <span class="identifier">stepper</span><span class="special">;</span>
<span class="comment">// create stepper</span>
<span class="identifier">runge_kutta4</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">thrust_algebra</span> <span class="special">,</span> <span class="identifier">thrust_operations</span> <span class="special">&gt;</span> <span class="identifier">stepper</span><span class="special">;</span>
<span class="comment">// create phase oscillator system function
</span><span class="identifier">phase_oscillators</span> <span class="identifier">sys</span><span class="special">(</span> <span class="identifier">omega</span> <span class="special">);</span>
<span class="comment">// create phase oscillator system function</span>
<span class="identifier">phase_oscillators</span> <span class="identifier">sys</span><span class="special">(</span> <span class="identifier">omega</span> <span class="special">);</span>
<span class="comment">// integrate
</span><span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">stepper</span> <span class="special">,</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="comment">// integrate</span>
<span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">stepper</span> <span class="special">,</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="identifier">thrust</span><span class="special">::</span><span class="identifier">copy</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream_iterator</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">,</span> <span class="string">"\n"</span> <span class="special">)</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
@ -491,13 +476,8 @@
<span class="special">&gt;</span></code>.
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span> <span class="identifier">rng</span><span class="special">;</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_real</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">unif</span><span class="special">(</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">1.0</span> <span class="special">);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">variate_generator</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mt19937</span><span class="special">&amp;,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uniform_real</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">gen</span><span class="special">(</span> <span class="identifier">rng</span> <span class="special">,</span> <span class="identifier">unif</span> <span class="special">);</span>
<span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">beta_host</span><span class="special">(</span> <span class="identifier">N</span> <span class="special">);</span>
<pre class="programlisting"><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">beta_host</span><span class="special">(</span> <span class="identifier">N</span> <span class="special">);</span>
<span class="keyword">const</span> <span class="identifier">value_type</span> <span class="identifier">beta_min</span> <span class="special">=</span> <span class="number">0.0</span> <span class="special">,</span> <span class="identifier">beta_max</span> <span class="special">=</span> <span class="number">56.0</span><span class="special">;</span>
<span class="keyword">for</span><span class="special">(</span> <span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span> <span class="special">;</span> <span class="identifier">i</span><span class="special">&lt;</span><span class="identifier">N</span> <span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
<span class="identifier">beta_host</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">beta_min</span> <span class="special">+</span> <span class="identifier">value_type</span><span class="special">(</span> <span class="identifier">i</span> <span class="special">)</span> <span class="special">*</span> <span class="special">(</span> <span class="identifier">beta_max</span> <span class="special">-</span> <span class="identifier">beta_min</span> <span class="special">)</span> <span class="special">/</span> <span class="identifier">value_type</span><span class="special">(</span> <span class="identifier">N</span> <span class="special">-</span> <span class="number">1</span> <span class="special">);</span>
@ -513,7 +493,6 @@
calculates one particular realization of the Lorenz ensemble
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">lorenz_system</span>
<span class="special">{</span>
@ -523,8 +502,8 @@
<span class="identifier">__host__</span> <span class="identifier">__device__</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">T</span> <span class="identifier">t</span> <span class="special">)</span> <span class="keyword">const</span>
<span class="special">{</span>
<span class="comment">// unpack the parameter we want to vary and the Lorenz variables
</span> <span class="identifier">value_type</span> <span class="identifier">R</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span> <span class="number">3</span> <span class="special">&gt;(</span> <span class="identifier">t</span> <span class="special">);</span>
<span class="comment">// unpack the parameter we want to vary and the Lorenz variables</span>
<span class="identifier">value_type</span> <span class="identifier">R</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span> <span class="number">3</span> <span class="special">&gt;(</span> <span class="identifier">t</span> <span class="special">);</span>
<span class="identifier">value_type</span> <span class="identifier">x</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span> <span class="number">0</span> <span class="special">&gt;(</span> <span class="identifier">t</span> <span class="special">);</span>
<span class="identifier">value_type</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span> <span class="number">1</span> <span class="special">&gt;(</span> <span class="identifier">t</span> <span class="special">);</span>
<span class="identifier">value_type</span> <span class="identifier">z</span> <span class="special">=</span> <span class="identifier">thrust</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span> <span class="number">2</span> <span class="special">&gt;(</span> <span class="identifier">t</span> <span class="special">);</span>
@ -560,7 +539,6 @@
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">begin</span><span class="special">(</span> <span class="identifier">dxdt</span> <span class="special">)</span> <span class="special">+</span> <span class="number">3</span> <span class="special">*</span> <span class="identifier">m_N</span> <span class="special">)</span> <span class="special">)</span> <span class="special">,</span>
<span class="identifier">lorenz_functor</span><span class="special">()</span> <span class="special">);</span>
<span class="special">}</span>
<span class="identifier">size_t</span> <span class="identifier">m_N</span><span class="special">;</span>
<span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&amp;</span><span class="identifier">m_beta</span><span class="special">;</span>
<span class="special">};</span>
@ -596,7 +574,6 @@
which is used within this observer is defined
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">lyap_functor</span>
<span class="special">{</span>
@ -636,33 +613,32 @@
and written to <code class="computeroutput"><span class="identifier">stdout</span></code>.
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">state_type</span> <span class="identifier">x</span><span class="special">(</span> <span class="number">6</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">);</span>
<span class="comment">// initialize x,y,z
</span><span class="identifier">thrust</span><span class="special">::</span><span class="identifier">fill</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="number">3</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">);</span>
<span class="comment">// initialize x,y,z</span>
<span class="identifier">thrust</span><span class="special">::</span><span class="identifier">fill</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="number">3</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">);</span>
<span class="comment">// initial dx
</span><span class="identifier">thrust</span><span class="special">::</span><span class="identifier">fill</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="number">3</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="number">4</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">,</span> <span class="number">1.0</span> <span class="special">);</span>
<span class="comment">// initial dx</span>
<span class="identifier">thrust</span><span class="special">::</span><span class="identifier">fill</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="number">3</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="number">4</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">,</span> <span class="number">1.0</span> <span class="special">);</span>
<span class="comment">// initialize dy,dz
</span><span class="identifier">thrust</span><span class="special">::</span><span class="identifier">fill</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="number">4</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">);</span>
<span class="comment">// initialize dy,dz</span>
<span class="identifier">thrust</span><span class="special">::</span><span class="identifier">fill</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="number">4</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">);</span>
<span class="comment">// create error stepper, can be used with make_controlled or make_dense_output
</span><span class="keyword">typedef</span> <span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">thrust_algebra</span> <span class="special">,</span> <span class="identifier">thrust_operations</span> <span class="special">&gt;</span> <span class="identifier">stepper_type</span><span class="special">;</span>
<span class="comment">// create error stepper, can be used with make_controlled or make_dense_output</span>
<span class="keyword">typedef</span> <span class="identifier">runge_kutta_dopri5</span><span class="special">&lt;</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">,</span> <span class="identifier">value_type</span> <span class="special">,</span> <span class="identifier">thrust_algebra</span> <span class="special">,</span> <span class="identifier">thrust_operations</span> <span class="special">&gt;</span> <span class="identifier">stepper_type</span><span class="special">;</span>
<span class="identifier">lorenz_system</span> <span class="identifier">lorenz</span><span class="special">(</span> <span class="identifier">N</span> <span class="special">,</span> <span class="identifier">beta</span> <span class="special">);</span>
<span class="identifier">lorenz_perturbation_system</span> <span class="identifier">lorenz_perturbation</span><span class="special">(</span> <span class="identifier">N</span> <span class="special">,</span> <span class="identifier">beta</span> <span class="special">);</span>
<span class="identifier">lyap_observer</span> <span class="identifier">obs</span><span class="special">(</span> <span class="identifier">N</span> <span class="special">,</span> <span class="number">1</span> <span class="special">);</span>
<span class="comment">// calculate transients
</span><span class="identifier">integrate_adaptive</span><span class="special">(</span> <span class="identifier">make_controlled</span><span class="special">(</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="identifier">stepper_type</span><span class="special">()</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">lorenz</span> <span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="number">3</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">)</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="comment">// calculate transients</span>
<span class="identifier">integrate_adaptive</span><span class="special">(</span> <span class="identifier">make_controlled</span><span class="special">(</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="identifier">stepper_type</span><span class="special">()</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">lorenz</span> <span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">,</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">+</span> <span class="number">3</span> <span class="special">*</span> <span class="identifier">N</span> <span class="special">)</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
<span class="comment">// calculate the Lyapunov exponents -- the main loop
</span><span class="keyword">double</span> <span class="identifier">t</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
<span class="comment">// calculate the Lyapunov exponents -- the main loop</span>
<span class="keyword">double</span> <span class="identifier">t</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
<span class="keyword">while</span><span class="special">(</span> <span class="identifier">t</span> <span class="special">&lt;</span> <span class="number">10000.0</span> <span class="special">)</span>
<span class="special">{</span>
<span class="identifier">integrate_adaptive</span><span class="special">(</span> <span class="identifier">make_controlled</span><span class="special">(</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="number">1.0e-6</span> <span class="special">,</span> <span class="identifier">stepper_type</span><span class="special">()</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">lorenz_perturbation</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">+</span> <span class="number">1.0</span> <span class="special">,</span> <span class="number">0.1</span> <span class="special">);</span>
@ -685,7 +661,8 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -21,9 +21,10 @@
<div><div class="author"><h3 class="author">
<span class="firstname">Mario</span> <span class="surname">Mulansky</span>
</h3></div></div>
<div><p class="copyright">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky</p></div>
<div><p class="copyright">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky</p></div>
<div><div class="legalnotice">
<a name="id518662"></a><p>
<a name="odeint.legal"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
@ -133,7 +134,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: November 30, 2011 at 13:14:22 GMT</small></p></td>
<td align="left"><p><small>Last revised: February 08, 2012 at 15:38:05 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>

View File

@ -19,7 +19,8 @@
<a name="odeint.reference"></a>Reference</h2></div></div></div></div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2011 Karsten Ahnert
and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -172,12 +172,11 @@ struct copy_impl< test_array2< T , Dim > , test_array2< T , Dim > >
//provide the state_wrapper
template< class T , size_t Dim >
struct state_wrapper< test_array< T , Dim > , false >
struct state_wrapper< test_array< T , Dim > >
{
typedef state_wrapper< test_array< T , Dim > , false > state_wrapper_type;
typedef state_wrapper< test_array< T , Dim > > state_wrapper_type;
typedef test_array< T , Dim > state_type;
typedef T value_type;
typedef boost::false_type is_resizeable;
state_type m_v;
@ -212,12 +211,11 @@ struct state_wrapper< test_array< T , Dim > , false >
//provide the state_wrapper
template< class T , size_t Dim >
struct state_wrapper< test_array2< T , Dim > , false >
struct state_wrapper< test_array2< T , Dim > >
{
typedef state_wrapper< test_array2< T , Dim > , false > state_wrapper_type;
typedef state_wrapper< test_array2< T , Dim > > state_wrapper_type;
typedef test_array2< T , Dim > state_type;
typedef T value_type;
typedef boost::false_type is_resizeable;
state_type m_v;