diff --git a/doc/concepts/symplectic_system.qbk b/doc/concepts/symplectic_system.qbk index e0785973..1271a984 100644 --- a/doc/concepts/symplectic_system.qbk +++ b/doc/concepts/symplectic_system.qbk @@ -54,7 +54,7 @@ Symplectic systems are used in symplectic steppers like `symplectic_rkn_sb3a_mcl [table [[Name] [Expression] [Type] [Semantics]] - [[Check for pair] [`boost::is_pair< System >::type`] [`boost::mpl::true_`] [Check if System is a pair]] + [[Check for pair] [`boost::is_pair< System >::type`] [`std::integral_constant`] [Check if System is a pair]] [[Calculate ['dq/dt = f(p)]] [`sys.first( p , dqdt )`] [`void`] [Calculates ['f(p)], the result is stored into `dqdt`] ] [[Calculate ['dp/dt = g(q)]] [`sys.second( q , dpdt )`] [`void`] [Calculates ['g(q)], the result is stored into `dpdt`] ] ] @@ -92,7 +92,7 @@ We call this concept ['SimpleSymplecticSystem] [table [[Name] [Expression] [Type] [Semantics]] - [[Check for pair] [`boost::is_pair< System >::type`] [`boost::mpl::false_`] [Check if System is a pair, should be evaluated to false in this case.]] + [[Check for pair] [`boost::is_pair< System >::type`] [`std::integral_constant`] [Check if System is a pair, should be evaluated to false in this case.]] [[Calculate ['dp/dt = g(q)]] [`sys( q , dpdt )`] [`void`] [Calculates ['g(q)], the result is stored into `dpdt`] ] ] diff --git a/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp b/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp index 9c3e5d57..32330d6e 100644 --- a/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp +++ b/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp @@ -20,6 +20,7 @@ #define BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED #include +#include #include #include @@ -182,7 +183,7 @@ private: // stepper for systems with function for dq/dt = f(p) and dp/dt = -f(q) template< class System , class StateIn , class StateOut > - void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , boost::mpl::true_ ) + void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , std::integral_constant ) { typedef typename odeint::unwrap_reference< System >::type system_type; typedef typename odeint::unwrap_reference< typename system_type::first_type >::type coor_deriv_func_type; @@ -236,7 +237,7 @@ private: // stepper for systems with only function dp /dt = -f(q), dq/dt = p, time not required but still expected for compatibility reasons template< class System , class StateIn , class StateOut > - void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , boost::mpl::false_ ) + void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , std::integral_constant ) { typedef typename odeint::unwrap_reference< System >::type momentum_deriv_func_type; momentum_deriv_func_type &momentum_func = system; diff --git a/include/boost/numeric/odeint/util/copy.hpp b/include/boost/numeric/odeint/util/copy.hpp index 161f1355..686257e5 100644 --- a/include/boost/numeric/odeint/util/copy.hpp +++ b/include/boost/numeric/odeint/util/copy.hpp @@ -18,6 +18,7 @@ #ifndef BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED +#include #include @@ -43,6 +44,18 @@ namespace detail { to = from; } + template< class Container1 , class Container2 > + void do_copying( const Container1 &from , Container2 &to , std::integral_constant) + { + boost::range::copy( from , boost::begin( to ) ); + } + + template< class Container1 , class Container2 > + void do_copying( const Container1 &from , Container2 &to , std::integral_constant) + { + to = from; + } + } // namespace detail diff --git a/include/boost/numeric/odeint/util/detail/is_range.hpp b/include/boost/numeric/odeint/util/detail/is_range.hpp index a1768554..ed63ba98 100644 --- a/include/boost/numeric/odeint/util/detail/is_range.hpp +++ b/include/boost/numeric/odeint/util/detail/is_range.hpp @@ -26,9 +26,9 @@ #endif #include +#include #include #include -#include #include namespace boost { @@ -56,12 +56,12 @@ struct is_range : boost::mpl::and_, range_deta ////////////////////////////////////////////////////////////////////////// template< typename iteratorT > -struct is_range< std::pair > : boost::mpl::true_ +struct is_range< std::pair > : std::integral_constant { }; template< typename iteratorT > -struct is_range< const std::pair > : boost::mpl::true_ +struct is_range< const std::pair > : std::integral_constant { }; @@ -70,12 +70,12 @@ struct is_range< const std::pair > : boost::mpl::true_ ////////////////////////////////////////////////////////////////////////// template< typename elementT, std::size_t sz > -struct is_range< elementT[sz] > : boost::mpl::true_ +struct is_range< elementT[sz] > : std::integral_constant { }; template< typename elementT, std::size_t sz > -struct is_range< const elementT[sz] > : boost::mpl::true_ +struct is_range< const elementT[sz] > : std::integral_constant { }; @@ -84,42 +84,42 @@ struct is_range< const elementT[sz] > : boost::mpl::true_ ////////////////////////////////////////////////////////////////////////// template<> -struct is_range< char* > : boost::mpl::true_ +struct is_range< char* > : std::integral_constant { }; template<> -struct is_range< wchar_t* > : boost::mpl::true_ +struct is_range< wchar_t* > : std::integral_constant { }; template<> -struct is_range< const char* > : boost::mpl::true_ +struct is_range< const char* > : std::integral_constant { }; template<> -struct is_range< const wchar_t* > : boost::mpl::true_ +struct is_range< const wchar_t* > : std::integral_constant { }; template<> -struct is_range< char* const > : boost::mpl::true_ +struct is_range< char* const > : std::integral_constant { }; template<> -struct is_range< wchar_t* const > : boost::mpl::true_ +struct is_range< wchar_t* const > : std::integral_constant { }; template<> -struct is_range< const char* const > : boost::mpl::true_ +struct is_range< const char* const > : std::integral_constant { }; template<> -struct is_range< const wchar_t* const > : boost::mpl::true_ +struct is_range< const wchar_t* const > : std::integral_constant { }; diff --git a/include/boost/numeric/odeint/util/is_pair.hpp b/include/boost/numeric/odeint/util/is_pair.hpp index 1827840f..b6519f41 100644 --- a/include/boost/numeric/odeint/util/is_pair.hpp +++ b/include/boost/numeric/odeint/util/is_pair.hpp @@ -18,22 +18,19 @@ #ifndef BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED - -#include -#include - +#include namespace boost { namespace numeric { namespace odeint { template< class T > -struct is_pair : public boost::mpl::false_ +struct is_pair : public std::integral_constant { }; template< class T1 , class T2 > -struct is_pair< std::pair< T1 , T2 > > : public boost::mpl::true_ +struct is_pair< std::pair< T1 , T2 > > : public std::integral_constant { };