]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/numeric/odeint/stepper/generation/generation_controlled_adams_bashforth_moulton.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / numeric / odeint / stepper / generation / generation_controlled_adams_bashforth_moulton.hpp
1 /*
2 boost/numeric/odeint/stepper/detail/generation_controlled_adams_bashforth_moulton.hpp
3
4 [begin_description]
5 Spezialization of the generation functions for creation of the controlled adams bashforth moulton stepper.
6 [end_description]
7
8 Copyright 2017 Valentin Noah Hartmann
9
10 Distributed under the Boost Software License, Version 1.0.
11 (See accompanying file LICENSE_1_0.txt or
12 copy at http://www.boost.org/LICENSE_1_0.txt)
13 */
14
15 #ifndef GENERATION_CONTROLLED_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED
16 #define GENERATION_CONTROLLED_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED
17
18 #include <boost/numeric/odeint/stepper/adaptive_adams_bashforth_moulton.hpp>
19 #include <boost/numeric/odeint/stepper/controlled_adams_bashforth_moulton.hpp>
20 #include <boost/numeric/odeint/stepper/generation/make_controlled.hpp>
21
22 namespace boost {
23 namespace numeric {
24 namespace odeint {
25
26 template< size_t Steps, class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resizer >
27 struct get_controller< adaptive_adams_bashforth_moulton< Steps, State , Value , Deriv , Time , Algebra , Operations , Resizer > >
28 {
29 typedef adaptive_adams_bashforth_moulton<Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer> stepper_type;
30 typedef controlled_adams_bashforth_moulton< stepper_type > type;
31 };
32
33 // controller factory for controlled_adams_bashforth_moulton
34 template< class Stepper >
35 struct controller_factory< Stepper , controlled_adams_bashforth_moulton< Stepper > >
36 {
37 typedef Stepper stepper_type;
38 typedef controlled_adams_bashforth_moulton< stepper_type > controller_type;
39 typedef typename controller_type::step_adjuster_type step_adjuster_type;
40 typedef typename stepper_type::value_type value_type;
41 typedef typename stepper_type::value_type time_type;
42
43 controller_type operator()( value_type abs_error , value_type rel_error , const stepper_type &stepper )
44 {
45 return controller_type(step_adjuster_type(abs_error, rel_error));
46 }
47
48 controller_type operator()( value_type abs_error , value_type rel_error ,
49 time_type max_dt, const stepper_type &stepper )
50 {
51 return controller_type( step_adjuster_type(abs_error, rel_error, max_dt));
52 }
53 };
54
55 }
56 }
57 }
58
59 #endif