]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /* |
2 | [auto_generated] | |
3 | boost/numeric/odeint/stepper/generation/make_dense_output.hpp | |
4 | ||
5 | [begin_description] | |
6 | Factory function to simplify the creation of dense output steppers from error steppers. | |
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_MAKE_DENSE_OUTPUT_HPP_INCLUDED | |
19 | #define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_DENSE_OUTPUT_HPP_INCLUDED | |
20 | ||
21 | namespace boost { | |
22 | namespace numeric { | |
23 | namespace odeint { | |
24 | ||
25 | ||
26 | // default template for the dense output | |
27 | template< class Stepper > struct get_dense_output { }; | |
28 | ||
29 | ||
30 | ||
31 | // default dense output factory | |
32 | template< class Stepper , class DenseOutput > | |
33 | struct dense_output_factory | |
34 | { | |
35 | DenseOutput operator()( | |
36 | typename Stepper::value_type abs_error , | |
37 | typename Stepper::value_type rel_error , | |
38 | const Stepper &stepper ) | |
39 | { | |
40 | return DenseOutput( abs_error , rel_error , stepper ); | |
41 | } | |
42 | ||
43 | DenseOutput operator()( | |
44 | typename Stepper::value_type abs_error , | |
45 | typename Stepper::value_type rel_error , | |
46 | typename Stepper::time_type max_dt , | |
47 | const Stepper &stepper ) | |
48 | { | |
49 | return DenseOutput( abs_error , rel_error , max_dt , stepper ); | |
50 | } | |
51 | }; | |
52 | ||
53 | ||
54 | ||
55 | namespace result_of | |
56 | { | |
57 | template< class Stepper > | |
58 | struct make_dense_output | |
59 | { | |
60 | typedef typename get_dense_output< Stepper >::type type; | |
61 | }; | |
62 | } | |
63 | ||
64 | ||
65 | ||
66 | template< class Stepper > | |
67 | typename result_of::make_dense_output< Stepper >::type make_dense_output( | |
68 | typename Stepper::value_type abs_error , | |
69 | typename Stepper::value_type rel_error , | |
70 | const Stepper &stepper = Stepper() ) | |
71 | { | |
72 | typedef Stepper stepper_type; | |
73 | typedef typename result_of::make_dense_output< stepper_type >::type dense_output_type; | |
74 | typedef dense_output_factory< stepper_type , dense_output_type > factory_type; | |
75 | factory_type factory; | |
76 | return factory( abs_error , rel_error , stepper ); | |
77 | } | |
78 | ||
79 | ||
80 | template< class Stepper > | |
81 | typename result_of::make_dense_output< Stepper >::type make_dense_output( | |
82 | typename Stepper::value_type abs_error , | |
83 | typename Stepper::value_type rel_error , | |
84 | typename Stepper::time_type max_dt , | |
85 | const Stepper &stepper = Stepper() ) | |
86 | { | |
87 | typedef Stepper stepper_type; | |
88 | typedef typename result_of::make_dense_output< stepper_type >::type dense_output_type; | |
89 | typedef dense_output_factory< stepper_type , dense_output_type > factory_type; | |
90 | factory_type factory; | |
91 | return factory( abs_error , rel_error , max_dt, stepper ); | |
92 | } | |
93 | ||
94 | ||
95 | } // odeint | |
96 | } // numeric | |
97 | } // boost | |
98 | ||
99 | ||
100 | #endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_DENSE_OUTPUT_HPP_INCLUDED |