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