Chris@16
|
1 /*
|
Chris@16
|
2 [auto_generated]
|
Chris@16
|
3 boost/numeric/odeint/integrate/integrate_times.hpp
|
Chris@16
|
4
|
Chris@16
|
5 [begin_description]
|
Chris@16
|
6 Integration of ODEs with observation at user defined points
|
Chris@16
|
7 [end_description]
|
Chris@16
|
8
|
Chris@16
|
9 Copyright 2009-2011 Karsten Ahnert
|
Chris@16
|
10 Copyright 2009-2011 Mario Mulansky
|
Chris@16
|
11
|
Chris@16
|
12 Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
13 (See accompanying file LICENSE_1_0.txt or
|
Chris@16
|
14 copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
15 */
|
Chris@16
|
16
|
Chris@16
|
17
|
Chris@16
|
18 #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED
|
Chris@16
|
19 #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED
|
Chris@16
|
20
|
Chris@16
|
21 #include <boost/type_traits/is_same.hpp>
|
Chris@16
|
22
|
Chris@16
|
23 #include <boost/range.hpp>
|
Chris@16
|
24
|
Chris@16
|
25 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
|
Chris@16
|
26 #include <boost/numeric/odeint/integrate/null_observer.hpp>
|
Chris@16
|
27 #include <boost/numeric/odeint/integrate/detail/integrate_times.hpp>
|
Chris@16
|
28
|
Chris@16
|
29 namespace boost {
|
Chris@16
|
30 namespace numeric {
|
Chris@16
|
31 namespace odeint {
|
Chris@16
|
32
|
Chris@16
|
33
|
Chris@16
|
34 /*
|
Chris@16
|
35 * the two overloads are needed in order to solve the forwarding problem
|
Chris@16
|
36 */
|
Chris@16
|
37 template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer >
|
Chris@16
|
38 size_t integrate_times(
|
Chris@16
|
39 Stepper stepper , System system , State &start_state ,
|
Chris@16
|
40 TimeIterator times_start , TimeIterator times_end , Time dt ,
|
Chris@16
|
41 Observer observer )
|
Chris@16
|
42 {
|
Chris@16
|
43 return detail::integrate_times(
|
Chris@16
|
44 stepper , system , start_state ,
|
Chris@16
|
45 times_start , times_end , dt ,
|
Chris@16
|
46 observer , typename Stepper::stepper_category() );
|
Chris@16
|
47 }
|
Chris@16
|
48
|
Chris@16
|
49 /**
|
Chris@16
|
50 * \brief Solves the forwarding problem, can be called with Boost.Range as start_state.
|
Chris@16
|
51 */
|
Chris@16
|
52 template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer >
|
Chris@16
|
53 size_t integrate_times(
|
Chris@16
|
54 Stepper stepper , System system , const State &start_state ,
|
Chris@16
|
55 TimeIterator times_start , TimeIterator times_end , Time dt ,
|
Chris@16
|
56 Observer observer )
|
Chris@16
|
57 {
|
Chris@16
|
58 return detail::integrate_times(
|
Chris@16
|
59 stepper , system , start_state ,
|
Chris@16
|
60 times_start , times_end , dt ,
|
Chris@16
|
61 observer , typename Stepper::stepper_category() );
|
Chris@16
|
62 }
|
Chris@16
|
63
|
Chris@16
|
64 /**
|
Chris@16
|
65 * \brief The same function as above, but without observer calls.
|
Chris@16
|
66 */
|
Chris@16
|
67 template< class Stepper , class System , class State , class TimeRange , class Time , class Observer >
|
Chris@16
|
68 size_t integrate_times(
|
Chris@16
|
69 Stepper stepper , System system , State &start_state ,
|
Chris@16
|
70 const TimeRange × , Time dt ,
|
Chris@16
|
71 Observer observer )
|
Chris@16
|
72 {
|
Chris@16
|
73 return integrate_times(
|
Chris@16
|
74 stepper , system , start_state ,
|
Chris@16
|
75 boost::begin( times ) , boost::end( times ) , dt , observer );
|
Chris@16
|
76 }
|
Chris@16
|
77
|
Chris@16
|
78 /**
|
Chris@16
|
79 * \brief Solves the forwarding problem, can be called with Boost.Range as start_state.
|
Chris@16
|
80 */
|
Chris@16
|
81 template< class Stepper , class System , class State , class TimeRange , class Time , class Observer >
|
Chris@16
|
82 size_t integrate_times(
|
Chris@16
|
83 Stepper stepper , System system , const State &start_state ,
|
Chris@16
|
84 const TimeRange × , Time dt ,
|
Chris@16
|
85 Observer observer )
|
Chris@16
|
86 {
|
Chris@16
|
87 return integrate_times(
|
Chris@16
|
88 stepper , system , start_state ,
|
Chris@16
|
89 boost::begin( times ) , boost::end( times ) , dt , observer );
|
Chris@16
|
90 }
|
Chris@16
|
91
|
Chris@16
|
92
|
Chris@16
|
93
|
Chris@16
|
94
|
Chris@16
|
95 /********* DOXYGEN ***********/
|
Chris@16
|
96
|
Chris@16
|
97 /**
|
Chris@16
|
98 * \fn size_t integrate_times( Stepper stepper , System system , State &start_state , TimeIterator times_start , TimeIterator times_end , Time dt , Observer observer )
|
Chris@16
|
99 * \brief Integrates the ODE with observer calls at given time points.
|
Chris@16
|
100 *
|
Chris@16
|
101 * Integrates the ODE given by system using the given stepper. This function
|
Chris@16
|
102 * does observer calls at the subsequent time points given by the range
|
Chris@16
|
103 * times_start, times_end. If the stepper has not step size control, the
|
Chris@16
|
104 * step size might be reduced occasionally to ensure observer calls exactly
|
Chris@16
|
105 * at the time points from the given sequence. If the stepper is a
|
Chris@16
|
106 * ControlledStepper, the step size is adjusted to meet the error bounds,
|
Chris@16
|
107 * but also might be reduced occasionally to ensure correct observer calls.
|
Chris@16
|
108 * If a DenseOutputStepper is provided, the dense output functionality is
|
Chris@16
|
109 * used to call the observer at the given times. The end time of the
|
Chris@16
|
110 * integration is always *(end_time-1).
|
Chris@16
|
111 *
|
Chris@16
|
112 * \param stepper The stepper to be used for numerical integration.
|
Chris@16
|
113 * \param system Function/Functor defining the rhs of the ODE.
|
Chris@16
|
114 * \param start_state The initial condition x0.
|
Chris@16
|
115 * \param times_start Iterator to the start time
|
Chris@16
|
116 * \param times_end Iterator to the end time
|
Chris@16
|
117 * \param dt The time step between observer calls, _not_ necessarily the
|
Chris@16
|
118 * time step of the integration.
|
Chris@16
|
119 * \param observer Function/Functor called at equidistant time intervals.
|
Chris@16
|
120 * \return The number of steps performed.
|
Chris@16
|
121 */
|
Chris@16
|
122
|
Chris@16
|
123
|
Chris@16
|
124
|
Chris@16
|
125 } // namespace odeint
|
Chris@16
|
126 } // namespace numeric
|
Chris@16
|
127 } // namespace boost
|
Chris@16
|
128
|
Chris@16
|
129
|
Chris@16
|
130
|
Chris@16
|
131 #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED
|