From 63fade416ca69b2b5dcaa08d5783c416fe6b2d2f Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Wed, 8 Feb 2012 19:05:40 +0100 Subject: [PATCH] removed is_resizable from state_wrapper --- .../odeint/external/gsl/gsl_wrapper.hpp | 1 - .../odeint/stepper/adams_bashforth.hpp | 3 +- .../numeric/odeint/stepper/adams_moulton.hpp | 3 +- .../base/explicit_error_stepper_base.hpp | 2 +- ...xplicit_stepper_and_error_stepper_base.hpp | 3 +- ...it_stepper_and_error_stepper_fsal_base.hpp | 3 +- .../stepper/base/explicit_stepper_base.hpp | 2 +- .../base/symplectic_rkn_stepper_base.hpp | 4 +- .../numeric/odeint/stepper/bulirsch_stoer.hpp | 9 +- .../stepper/bulirsch_stoer_dense_out.hpp | 19 +-- .../odeint/stepper/controlled_runge_kutta.hpp | 15 +- .../stepper/dense_output_runge_kutta.hpp | 13 +- .../stepper/explicit_error_generic_rk.hpp | 5 +- .../odeint/stepper/explicit_generic_rk.hpp | 5 +- .../numeric/odeint/stepper/implicit_euler.hpp | 11 +- .../odeint/stepper/modified_midpoint.hpp | 11 +- boost/numeric/odeint/stepper/rosenbrock4.hpp | 30 ++-- .../odeint/stepper/rosenbrock4_controller.hpp | 5 +- .../stepper/rosenbrock4_dense_output.hpp | 5 +- .../odeint/stepper/runge_kutta4_classic.hpp | 9 +- .../stepper/runge_kutta_cash_karp54.hpp | 2 + .../runge_kutta_cash_karp54_classic.hpp | 13 +- .../odeint/stepper/runge_kutta_dopri5.hpp | 17 +- .../odeint/stepper/runge_kutta_fehlberg78.hpp | 2 + boost/numeric/odeint/util/state_wrapper.hpp | 23 +-- boost/numeric/odeint/util/ublas_wrapper.hpp | 21 +-- .../concepts.html | 3 +- .../concepts/controlled_stepper.html | 27 ++-- .../concepts/dense_output_stepper.html | 33 ++-- .../concepts/error_stepper.html | 27 ++-- .../concepts/implicit_system.html | 23 +-- .../concepts/observer.html | 21 +-- .../concepts/simple_symplectic_system.html | 21 +-- .../concepts/state_algebra_operations.html | 66 ++++---- .../concepts/state_wrapper.html | 21 +-- .../concepts/stepper.html | 33 ++-- .../concepts/symplectic_system.html | 21 +-- .../concepts/system.html | 21 +-- .../extend_odeint.html | 3 +- .../adapt_your_own_operations.html | 3 +- .../adapt_your_own_state_types.html | 91 ++++++----- .../extend_odeint/write_own_steppers.html | 3 +- .../getting_started.html | 3 +- .../getting_started/overview.html | 3 +- .../getting_started/short_example.html | 14 +- .../usage__compilation__headers.html | 6 +- .../odeint_in_detail.html | 3 +- .../algebras_and_operations.html | 3 +- .../generation_functions.html | 3 +- .../odeint_in_detail/integrate_functions.html | 38 ++--- .../odeint_in_detail/steppers.html | 57 +++---- .../odeint_in_detail/using_boost__range.html | 3 +- .../odeint_in_detail/using_boost__ref.html | 3 +- .../old_concepts.html | 3 +- .../old_concepts/basic_stepper.html | 3 +- .../old_concepts/compositestepper.html | 3 +- .../old_concepts/controlled_stepper.html | 3 +- .../old_concepts/dense_ouput_stepper.html | 3 +- .../old_concepts/error_stepper.html | 3 +- .../old_concepts/size_adjusting_stepper.html | 3 +- .../old_reference.html | 3 +- .../old_reference/algebras.html | 3 +- .../old_reference/integration_functions.html | 3 +- .../old_reference/operations.html | 3 +- .../old_reference/resizing.html | 3 +- .../old_reference/stepper_classes.html | 3 +- .../tutorial.html | 3 +- .../tutorial/all_examples.html | 3 +- ...haotic_systems_and_lyapunov_exponents.html | 25 ++- .../tutorial/harmonic_oscillator.html | 12 +- .../tutorial/references.html | 3 +- .../tutorial/solar_system.html | 31 ++-- .../tutorial/special_topics.html | 93 +++++------ .../tutorial/stiff_systems.html | 7 +- .../tutorial/using_cuda_and_thrust.html | 149 ++++++++---------- doc/index.html | 7 +- doc/odeint/reference.html | 3 +- libs/numeric/odeint/test/stepper_copying.cpp | 10 +- 78 files changed, 556 insertions(+), 618 deletions(-) diff --git a/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp b/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp index 8c91cdec..999b06ab 100644 --- a/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp +++ b/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp @@ -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; diff --git a/boost/numeric/odeint/stepper/adams_bashforth.hpp b/boost/numeric/odeint/stepper/adams_bashforth.hpp index 7ef6b106..f8bf953d 100644 --- a/boost/numeric/odeint/stepper/adams_bashforth.hpp +++ b/boost/numeric/odeint/stepper/adams_bashforth.hpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -290,7 +291,7 @@ private: bool resized( false ); for( size_t i=0 ; i::type() ); } return resized; } diff --git a/boost/numeric/odeint/stepper/adams_moulton.hpp b/boost/numeric/odeint/stepper/adams_moulton.hpp index ccf1df64..793f3486 100644 --- a/boost/numeric/odeint/stepper/adams_moulton.hpp +++ b/boost/numeric/odeint/stepper/adams_moulton.hpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -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::type() ); } diff --git a/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp b/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp index 45cd3b2d..89f886c2 100644 --- a/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp +++ b/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp @@ -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::type() ); } diff --git a/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp b/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp index 2b0337f7..3bd87a9b 100644 --- a/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp +++ b/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -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::type() ); } stepper_type& stepper( void ) diff --git a/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_fsal_base.hpp b/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_fsal_base.hpp index b8bf41af..7e3c1ff2 100644 --- a/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_fsal_base.hpp +++ b/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_fsal_base.hpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -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::type() ); } diff --git a/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp b/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp index 19257078..1532d8c2 100644 --- a/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp +++ b/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp @@ -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::type() ); } diff --git a/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp b/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp index 6cbbbc12..185b924e 100644 --- a/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp +++ b/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp @@ -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::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::type() ); } diff --git a/boost/numeric/odeint/stepper/bulirsch_stoer.hpp b/boost/numeric/odeint/stepper/bulirsch_stoer.hpp index abe68d78..2c7eefbe 100644 --- a/boost/numeric/odeint/stepper/bulirsch_stoer.hpp +++ b/boost/numeric/odeint/stepper/bulirsch_stoer.hpp @@ -37,6 +37,7 @@ #include #include +#include #include 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::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::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::type() ); + resized |= adjust_size_by_resizeability( m_err , x , typename is_resizeable::type() ); return resized; } diff --git a/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp b/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp index 78fc2f82..1a347e2f 100644 --- a/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp +++ b/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -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::type() ); + resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_dxdt1 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_dxdt2 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_err , x , typename is_resizeable::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::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::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::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::type() ); return resized; } diff --git a/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp b/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp index 9ab98681..3e340685 100644 --- a/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp +++ b/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -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::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::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::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::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::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::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::type() ); } diff --git a/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp b/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp index f44bef0a..3eca6ec9 100644 --- a/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp +++ b/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -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::type() ); + resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable::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::type() ); + resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_dxdt1 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_dxdt2 , x , typename is_resizeable::type() ); return resized; } diff --git a/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp b/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp index d46e9e02..cd75bb51 100644 --- a/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp +++ b/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp @@ -27,6 +27,7 @@ #include #include +#include #include @@ -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::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::type() ); } return resized; } diff --git a/boost/numeric/odeint/stepper/explicit_generic_rk.hpp b/boost/numeric/odeint/stepper/explicit_generic_rk.hpp index 1ca982cb..cc8b48a6 100644 --- a/boost/numeric/odeint/stepper/explicit_generic_rk.hpp +++ b/boost/numeric/odeint/stepper/explicit_generic_rk.hpp @@ -29,6 +29,7 @@ #include #include +#include #include 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::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::type() ); } return resized; } diff --git a/boost/numeric/odeint/stepper/implicit_euler.hpp b/boost/numeric/odeint/stepper/implicit_euler.hpp index 3158ae4e..d0e7074a 100644 --- a/boost/numeric/odeint/stepper/implicit_euler.hpp +++ b/boost/numeric/odeint/stepper/implicit_euler.hpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -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::type() ); + resized |= adjust_size_by_resizeability( m_x , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_b , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_jacobi , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_pm , x , typename is_resizeable::type() ); return resized; } diff --git a/boost/numeric/odeint/stepper/modified_midpoint.hpp b/boost/numeric/odeint/stepper/modified_midpoint.hpp index 41dcc745..dabe0746 100644 --- a/boost/numeric/odeint/stepper/modified_midpoint.hpp +++ b/boost/numeric/odeint/stepper/modified_midpoint.hpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -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::type() ); + resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable::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::type() ); + resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable::type() ); return resized; } diff --git a/boost/numeric/odeint/stepper/rosenbrock4.hpp b/boost/numeric/odeint/stepper/rosenbrock4.hpp index 0fa0fd6b..37b58b7f 100644 --- a/boost/numeric/odeint/stepper/rosenbrock4.hpp +++ b/boost/numeric/odeint/stepper/rosenbrock4.hpp @@ -30,7 +30,7 @@ #include #include -//#include +#include #include #include @@ -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::type() ); + resized |= adjust_size_by_resizeability( m_dfdt , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_dxdtnew , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_xtmp , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_g1 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_g2 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_g3 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_g4 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_g5 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_cont3 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_cont4 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_jac , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_pm , x , typename is_resizeable::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::type() ); } private: diff --git a/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp b/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp index 40cca00e..150e40b5 100644 --- a/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp +++ b/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp @@ -26,6 +26,7 @@ #include #include +#include #include @@ -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::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::type() ); } diff --git a/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp b/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp index f6302471..0a6e94fa 100644 --- a/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp +++ b/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp @@ -25,6 +25,7 @@ #include #include +#include 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::type() ); + resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable::type() ); return resized; } diff --git a/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp b/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp index 1d103790..ba1cbd35 100644 --- a/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp +++ b/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp @@ -27,6 +27,7 @@ #include #include +#include #include 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::type() ); + resized |= adjust_size_by_resizeability( m_dxm , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_dxt , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_dxh , x , typename is_resizeable::type() ); return resized; } diff --git a/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp b/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp index c9861516..dc6833a6 100644 --- a/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp +++ b/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp @@ -24,6 +24,8 @@ #include #include +#include +#include #include #include diff --git a/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp b/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp index 2e068d46..30d4159e 100644 --- a/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp +++ b/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp @@ -28,6 +28,7 @@ #include #include #include +#include #include 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::type() ); + resized |= adjust_size_by_resizeability( m_k2 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_k3 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_k4 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_k5 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_k6 , x , typename is_resizeable::type() ); return resized; } diff --git a/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp b/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp index b7724c26..cdf27c6d 100644 --- a/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp +++ b/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp @@ -28,6 +28,11 @@ #include #include +#include +#include +#include + + 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::type() ); + resized |= adjust_size_by_resizeability( m_k2 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_k3 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_k4 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_k5 , x , typename is_resizeable::type() ); + resized |= adjust_size_by_resizeability( m_k6 , x , typename is_resizeable::type() ); return resized; } diff --git a/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp b/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp index 778df40d..b3edf97e 100644 --- a/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp +++ b/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp @@ -27,6 +27,8 @@ #include +#include +#include #include diff --git a/boost/numeric/odeint/util/state_wrapper.hpp b/boost/numeric/odeint/util/state_wrapper.hpp index 4d3e28f5..3c2bfe0b 100644 --- a/boost/numeric/odeint/util/state_wrapper.hpp +++ b/boost/numeric/odeint/util/state_wrapper.hpp @@ -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; -}; - } } } diff --git a/boost/numeric/odeint/util/ublas_wrapper.hpp b/boost/numeric/odeint/util/ublas_wrapper.hpp index 7c7e044d..64833274 100644 --- a/boost/numeric/odeint/util/ublas_wrapper.hpp +++ b/boost/numeric/odeint/util/ublas_wrapper.hpp @@ -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; - } }; diff --git a/doc/boost_sandbox_numeric_odeint/concepts.html b/doc/boost_sandbox_numeric_odeint/concepts.html index 4b916cc1..0fd682f2 100644 --- a/doc/boost_sandbox_numeric_odeint/concepts.html +++ b/doc/boost_sandbox_numeric_odeint/concepts.html @@ -44,7 +44,8 @@ -