Chris@16: /* Chris@16: [auto_generated] Chris@16: boost/numeric/odeint/stepper/generation/make_controlled.hpp Chris@16: Chris@16: [begin_description] Chris@16: Factory function to simplify the creation of controlled steppers from error steppers. Chris@16: [end_description] Chris@16: Chris@101: Copyright 2011-2012 Karsten Ahnert Chris@101: Copyright 2011-2012 Mario Mulansky Chris@16: Chris@16: Distributed under the Boost Software License, Version 1.0. Chris@16: (See accompanying file LICENSE_1_0.txt or Chris@16: copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: */ Chris@16: Chris@16: Chris@16: #ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_CONTROLLED_HPP_INCLUDED Chris@16: #define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_CONTROLLED_HPP_INCLUDED Chris@16: Chris@16: Chris@16: Chris@16: Chris@16: namespace boost { Chris@16: namespace numeric { Chris@16: namespace odeint { Chris@16: Chris@16: Chris@16: Chris@16: // default template for the controller Chris@16: template< class Stepper > struct get_controller { }; Chris@16: Chris@16: Chris@16: Chris@16: // default controller factory Chris@16: template< class Stepper , class Controller > Chris@16: struct controller_factory Chris@16: { Chris@16: Controller operator()( Chris@16: typename Stepper::value_type abs_error , Chris@16: typename Stepper::value_type rel_error , Chris@16: const Stepper &stepper ) Chris@16: { Chris@16: return Controller( abs_error , rel_error , stepper ); Chris@16: } Chris@16: }; Chris@16: Chris@16: Chris@16: Chris@16: Chris@16: namespace result_of Chris@16: { Chris@16: template< class Stepper > Chris@16: struct make_controlled Chris@16: { Chris@16: typedef typename get_controller< Stepper >::type type; Chris@16: }; Chris@16: } Chris@16: Chris@16: Chris@16: template< class Stepper > Chris@16: typename result_of::make_controlled< Stepper >::type make_controlled( Chris@16: typename Stepper::value_type abs_error , Chris@16: typename Stepper::value_type rel_error , Chris@16: const Stepper & stepper = Stepper() ) Chris@16: { Chris@16: typedef Stepper stepper_type; Chris@16: typedef typename result_of::make_controlled< stepper_type >::type controller_type; Chris@16: typedef controller_factory< stepper_type , controller_type > factory_type; Chris@16: factory_type factory; Chris@16: return factory( abs_error , rel_error , stepper ); Chris@16: } Chris@16: Chris@16: Chris@16: Chris@16: } // odeint Chris@16: } // numeric Chris@16: } // boost Chris@16: Chris@16: Chris@16: #endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_CONTROLLED_HPP_INCLUDED