generation_controlled_runge_kutta.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. [auto_generated]
  3. boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp
  4. [begin_description]
  5. Specialization of the controller factory for the controlled_runge_kutta class.
  6. [end_description]
  7. Copyright 2011-2012 Karsten Ahnert
  8. Copyright 2011-2012 Mario Mulansky
  9. Distributed under the Boost Software License, Version 1.0.
  10. (See accompanying file LICENSE_1_0.txt or
  11. copy at http://www.boost.org/LICENSE_1_0.txt)
  12. */
  13. #ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED
  14. #define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED
  15. #include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
  16. #include <boost/numeric/odeint/stepper/generation/make_controlled.hpp>
  17. namespace boost {
  18. namespace numeric {
  19. namespace odeint {
  20. // controller factory for controlled_runge_kutta
  21. template< class Stepper >
  22. struct controller_factory< Stepper , controlled_runge_kutta< Stepper > >
  23. {
  24. typedef Stepper stepper_type;
  25. typedef controlled_runge_kutta< stepper_type > controller_type;
  26. typedef typename controller_type::error_checker_type error_checker_type;
  27. typedef typename controller_type::step_adjuster_type step_adjuster_type;
  28. typedef typename stepper_type::value_type value_type;
  29. typedef typename stepper_type::value_type time_type;
  30. controller_type operator()( value_type abs_error , value_type rel_error , const stepper_type &stepper )
  31. {
  32. return controller_type( error_checker_type( abs_error , rel_error ) ,
  33. step_adjuster_type() , stepper );
  34. }
  35. controller_type operator()( value_type abs_error , value_type rel_error ,
  36. time_type max_dt, const stepper_type &stepper )
  37. {
  38. return controller_type( error_checker_type( abs_error , rel_error ) ,
  39. step_adjuster_type(max_dt) , stepper );
  40. }
  41. };
  42. } // odeint
  43. } // numeric
  44. } // boost
  45. #endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED