Chris@16: /* Chris@16: [auto_generated] Chris@16: boost/numeric/odeint/integrate/integrate_times.hpp Chris@16: Chris@16: [begin_description] Chris@16: Integration of ODEs with observation at user defined points Chris@16: [end_description] Chris@16: Chris@101: Copyright 2011-2013 Karsten Ahnert Chris@101: Copyright 2011-2012 Mario Mulansky Chris@16: Chris@16: Distributed under the Boost Software License, Version 1.0. Chris@16: (See accompanying file LICENSE_1_0.txt or Chris@16: copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: */ Chris@16: Chris@16: Chris@16: #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED Chris@16: #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace numeric { Chris@16: namespace odeint { Chris@16: Chris@16: Chris@16: /* Chris@16: * the two overloads are needed in order to solve the forwarding problem Chris@16: */ Chris@16: template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer > Chris@16: size_t integrate_times( Chris@16: Stepper stepper , System system , State &start_state , Chris@16: TimeIterator times_start , TimeIterator times_end , Time dt , Chris@16: Observer observer ) Chris@16: { Chris@101: typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; Chris@16: return detail::integrate_times( Chris@16: stepper , system , start_state , Chris@16: times_start , times_end , dt , Chris@101: observer , stepper_category() ); Chris@16: } Chris@16: Chris@16: /** Chris@16: * \brief Solves the forwarding problem, can be called with Boost.Range as start_state. Chris@16: */ Chris@16: template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer > Chris@16: size_t integrate_times( Chris@16: Stepper stepper , System system , const State &start_state , Chris@16: TimeIterator times_start , TimeIterator times_end , Time dt , Chris@16: Observer observer ) Chris@16: { Chris@101: typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; Chris@16: return detail::integrate_times( Chris@16: stepper , system , start_state , Chris@16: times_start , times_end , dt , Chris@101: observer , stepper_category() ); Chris@16: } Chris@16: Chris@16: /** Chris@16: * \brief The same function as above, but without observer calls. Chris@16: */ Chris@16: template< class Stepper , class System , class State , class TimeRange , class Time , class Observer > Chris@16: size_t integrate_times( Chris@16: Stepper stepper , System system , State &start_state , Chris@16: const TimeRange × , Time dt , Chris@16: Observer observer ) Chris@16: { Chris@16: return integrate_times( Chris@16: stepper , system , start_state , Chris@16: boost::begin( times ) , boost::end( times ) , dt , observer ); Chris@16: } Chris@16: Chris@16: /** Chris@16: * \brief Solves the forwarding problem, can be called with Boost.Range as start_state. Chris@16: */ Chris@16: template< class Stepper , class System , class State , class TimeRange , class Time , class Observer > Chris@16: size_t integrate_times( Chris@16: Stepper stepper , System system , const State &start_state , Chris@16: const TimeRange × , Time dt , Chris@16: Observer observer ) Chris@16: { Chris@16: return integrate_times( Chris@16: stepper , system , start_state , Chris@16: boost::begin( times ) , boost::end( times ) , dt , observer ); Chris@16: } Chris@16: Chris@16: Chris@16: Chris@16: Chris@16: /********* DOXYGEN ***********/ Chris@16: Chris@16: /** Chris@16: * \fn size_t integrate_times( Stepper stepper , System system , State &start_state , TimeIterator times_start , TimeIterator times_end , Time dt , Observer observer ) Chris@16: * \brief Integrates the ODE with observer calls at given time points. Chris@16: * Chris@16: * Integrates the ODE given by system using the given stepper. This function Chris@16: * does observer calls at the subsequent time points given by the range Chris@16: * times_start, times_end. If the stepper has not step size control, the Chris@16: * step size might be reduced occasionally to ensure observer calls exactly Chris@16: * at the time points from the given sequence. If the stepper is a Chris@16: * ControlledStepper, the step size is adjusted to meet the error bounds, Chris@16: * but also might be reduced occasionally to ensure correct observer calls. Chris@16: * If a DenseOutputStepper is provided, the dense output functionality is Chris@16: * used to call the observer at the given times. The end time of the Chris@16: * integration is always *(end_time-1). Chris@16: * Chris@16: * \param stepper The stepper to be used for numerical integration. Chris@16: * \param system Function/Functor defining the rhs of the ODE. Chris@16: * \param start_state The initial condition x0. Chris@16: * \param times_start Iterator to the start time Chris@16: * \param times_end Iterator to the end time Chris@16: * \param dt The time step between observer calls, _not_ necessarily the Chris@16: * time step of the integration. Chris@16: * \param observer Function/Functor called at equidistant time intervals. Chris@16: * \return The number of steps performed. Chris@16: */ Chris@16: Chris@16: Chris@16: Chris@16: } // namespace odeint Chris@16: } // namespace numeric Chris@16: } // namespace boost Chris@16: Chris@16: Chris@16: Chris@16: #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED