explicit_error_stepper_base.hpp 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. /*
  2. [auto_generated]
  3. boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp
  4. [begin_description]
  5. Base class for all explicit Runge Kutta stepper which are also error steppers.
  6. [end_description]
  7. Copyright 2010-2013 Karsten Ahnert
  8. Copyright 2010-2012 Mario Mulansky
  9. Copyright 2012 Christoph Koke
  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. #ifndef BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED
  15. #define BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED
  16. #include <boost/utility/enable_if.hpp>
  17. #include <boost/type_traits/is_same.hpp>
  18. #include <boost/numeric/odeint/util/bind.hpp>
  19. #include <boost/numeric/odeint/util/unwrap_reference.hpp>
  20. #include <boost/numeric/odeint/util/state_wrapper.hpp>
  21. #include <boost/numeric/odeint/util/is_resizeable.hpp>
  22. #include <boost/numeric/odeint/util/resizer.hpp>
  23. #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
  24. #include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp>
  25. namespace boost {
  26. namespace numeric {
  27. namespace odeint {
  28. /*
  29. * base class for explicit stepper and error steppers
  30. * models the stepper AND the error stepper concept
  31. *
  32. * this class provides the following do_step variants:
  33. * do_step( sys , x , t , dt )
  34. * do_step( sys , x , dxdt , t , dt )
  35. * do_step( sys , in , t , out , dt )
  36. * do_step( sys , in , dxdt , t , out , dt )
  37. * do_step( sys , x , t , dt , xerr )
  38. * do_step( sys , x , dxdt , t , dt , xerr )
  39. * do_step( sys , in , t , out , dt , xerr )
  40. * do_step( sys , in , dxdt , t , out , dt , xerr )
  41. */
  42. template<
  43. class Stepper ,
  44. unsigned short Order ,
  45. unsigned short StepperOrder ,
  46. unsigned short ErrorOrder ,
  47. class State ,
  48. class Value ,
  49. class Deriv ,
  50. class Time ,
  51. class Algebra ,
  52. class Operations ,
  53. class Resizer
  54. >
  55. class explicit_error_stepper_base : public algebra_stepper_base< Algebra , Operations >
  56. {
  57. public:
  58. typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type;
  59. typedef typename algebra_stepper_base_type::algebra_type algebra_type;
  60. typedef State state_type;
  61. typedef Value value_type;
  62. typedef Deriv deriv_type;
  63. typedef Time time_type;
  64. typedef Resizer resizer_type;
  65. typedef Stepper stepper_type;
  66. typedef explicit_error_stepper_tag stepper_category;
  67. #ifndef DOXYGEN_SKIP
  68. typedef state_wrapper< state_type > wrapped_state_type;
  69. typedef state_wrapper< deriv_type > wrapped_deriv_type;
  70. typedef explicit_error_stepper_base< Stepper , Order , StepperOrder , ErrorOrder ,
  71. State , Value , Deriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type;
  72. #endif
  73. typedef unsigned short order_type;
  74. static const order_type order_value = Order;
  75. static const order_type stepper_order_value = StepperOrder;
  76. static const order_type error_order_value = ErrorOrder;
  77. explicit_error_stepper_base( const algebra_type &algebra = algebra_type() )
  78. : algebra_stepper_base_type( algebra )
  79. { }
  80. order_type order( void ) const
  81. {
  82. return order_value;
  83. }
  84. order_type stepper_order( void ) const
  85. {
  86. return stepper_order_value;
  87. }
  88. order_type error_order( void ) const
  89. {
  90. return error_order_value;
  91. }
  92. /*
  93. * Version 1 : do_step( sys , x , t , dt )
  94. *
  95. * the two overloads are needed in order to solve the forwarding problem
  96. */
  97. template< class System , class StateInOut >
  98. void do_step( System system , StateInOut &x , time_type t , time_type dt )
  99. {
  100. do_step_v1( system , x , t , dt );
  101. }
  102. /**
  103. * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut.
  104. */
  105. template< class System , class StateInOut >
  106. void do_step( System system , const StateInOut &x , time_type t , time_type dt )
  107. {
  108. do_step_v1( system , x , t , dt );
  109. }
  110. /*
  111. * Version 2 : do_step( sys , x , dxdt , t , dt )
  112. *
  113. * this version does not solve the forwarding problem, boost.range can not be used
  114. *
  115. * the disable is needed to avoid ambiguous overloads if state_type = time_type
  116. */
  117. template< class System , class StateInOut , class DerivIn >
  118. typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type
  119. do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt )
  120. {
  121. this->stepper().do_step_impl( system , x , dxdt , t , x , dt );
  122. }
  123. /*
  124. * named Version 2: do_step_dxdt_impl( sys , in , dxdt , t , dt )
  125. *
  126. * this version is needed when this stepper is used for initializing
  127. * multistep stepper like adams-bashforth. Hence we provide an explicitely
  128. * named version that is not disabled. Meant for internal use only.
  129. */
  130. template < class System, class StateInOut, class DerivIn >
  131. void do_step_dxdt_impl( System system, StateInOut &x, const DerivIn &dxdt,
  132. time_type t, time_type dt )
  133. {
  134. this->stepper().do_step_impl( system , x , dxdt , t , x , dt );
  135. }
  136. /*
  137. * Version 3 : do_step( sys , in , t , out , dt )
  138. *
  139. * this version does not solve the forwarding problem, boost.range can not be used
  140. *
  141. * the disable is needed to avoid ambiguous overloads if state_type = time_type
  142. */
  143. template< class System , class StateIn , class StateOut >
  144. typename boost::disable_if< boost::is_same< StateIn , time_type > , void >::type
  145. do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
  146. {
  147. typename odeint::unwrap_reference< System >::type &sys = system;
  148. m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
  149. sys( in , m_dxdt.m_v ,t );
  150. this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt );
  151. }
  152. /*
  153. * Version 4 :do_step( sys , in , dxdt , t , out , dt )
  154. *
  155. * this version does not solve the forwarding problem, boost.range can not be used
  156. *
  157. * the disable is needed to avoid ambiguous overloads if state_type = time_type
  158. */
  159. template< class System , class StateIn , class DerivIn , class StateOut >
  160. typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type
  161. do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt )
  162. {
  163. this->stepper().do_step_impl( system , in , dxdt , t , out , dt );
  164. }
  165. /*
  166. * named Version 4: do_step_dxdt_impl( sys , in , dxdt , t , out, dt )
  167. *
  168. * this version is needed when this stepper is used for initializing
  169. * multistep stepper like adams-bashforth. Hence we provide an explicitely
  170. * named version that is not disabled. Meant for internal use only.
  171. */
  172. template < class System, class StateIn, class DerivIn, class StateOut >
  173. void do_step_dxdt_impl( System system, const StateIn &in,
  174. const DerivIn &dxdt, time_type t, StateOut &out,
  175. time_type dt )
  176. {
  177. this->stepper().do_step_impl( system , in , dxdt , t , out , dt );
  178. }
  179. /*
  180. * Version 5 :do_step( sys , x , t , dt , xerr )
  181. *
  182. * the two overloads are needed in order to solve the forwarding problem
  183. */
  184. template< class System , class StateInOut , class Err >
  185. void do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr )
  186. {
  187. do_step_v5( system , x , t , dt , xerr );
  188. }
  189. /**
  190. * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut.
  191. */
  192. template< class System , class StateInOut , class Err >
  193. void do_step( System system , const StateInOut &x , time_type t , time_type dt , Err &xerr )
  194. {
  195. do_step_v5( system , x , t , dt , xerr );
  196. }
  197. /*
  198. * Version 6 :do_step( sys , x , dxdt , t , dt , xerr )
  199. *
  200. * this version does not solve the forwarding problem, boost.range can not be used
  201. *
  202. * the disable is needed to avoid ambiguous overloads if state_type = time_type
  203. */
  204. template< class System , class StateInOut , class DerivIn , class Err >
  205. typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type
  206. do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt , Err &xerr )
  207. {
  208. this->stepper().do_step_impl( system , x , dxdt , t , x , dt , xerr );
  209. }
  210. /*
  211. * Version 7 : do_step( sys , in , t , out , dt , xerr )
  212. *
  213. * this version does not solve the forwarding problem, boost.range can not be used
  214. */
  215. template< class System , class StateIn , class StateOut , class Err >
  216. void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr )
  217. {
  218. typename odeint::unwrap_reference< System >::type &sys = system;
  219. m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
  220. sys( in , m_dxdt.m_v ,t );
  221. this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt , xerr );
  222. }
  223. /*
  224. * Version 8 : do_step( sys , in , dxdt , t , out , dt , xerr )
  225. *
  226. * this version does not solve the forwarding problem, boost.range can not be used
  227. */
  228. template< class System , class StateIn , class DerivIn , class StateOut , class Err >
  229. void do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , Err &xerr )
  230. {
  231. this->stepper().do_step_impl( system , in , dxdt , t , out , dt , xerr );
  232. }
  233. template< class StateIn >
  234. void adjust_size( const StateIn &x )
  235. {
  236. resize_impl( x );
  237. }
  238. private:
  239. template< class System , class StateInOut >
  240. void do_step_v1( System system , StateInOut &x , time_type t , time_type dt )
  241. {
  242. typename odeint::unwrap_reference< System >::type &sys = system;
  243. m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl<StateInOut> , detail::ref( *this ) , detail::_1 ) );
  244. sys( x , m_dxdt.m_v , t );
  245. this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt );
  246. }
  247. template< class System , class StateInOut , class Err >
  248. void do_step_v5( System system , StateInOut &x , time_type t , time_type dt , Err &xerr )
  249. {
  250. typename odeint::unwrap_reference< System >::type &sys = system;
  251. m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl<StateInOut> , detail::ref( *this ) , detail::_1 ) );
  252. sys( x , m_dxdt.m_v ,t );
  253. this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt , xerr );
  254. }
  255. template< class StateIn >
  256. bool resize_impl( const StateIn &x )
  257. {
  258. return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
  259. }
  260. stepper_type& stepper( void )
  261. {
  262. return *static_cast< stepper_type* >( this );
  263. }
  264. const stepper_type& stepper( void ) const
  265. {
  266. return *static_cast< const stepper_type* >( this );
  267. }
  268. resizer_type m_resizer;
  269. protected:
  270. wrapped_deriv_type m_dxdt;
  271. };
  272. /******** DOXYGEN *******/
  273. /**
  274. * \class explicit_error_stepper_base
  275. * \brief Base class for explicit steppers with error estimation. This class can used with
  276. * controlled steppers for step size control.
  277. *
  278. * This class serves as the base class for all explicit steppers with algebra and operations. In contrast to
  279. * explicit_stepper_base it also estimates the error and can be used in a controlled stepper to provide
  280. * step size control.
  281. *
  282. * \note This stepper provides `do_step` methods with and without error estimation. It has therefore three orders,
  283. * one for the order of a step if the error is not estimated. The other two orders are the orders of the step and
  284. * the error step if the error estimation is performed.
  285. *
  286. * explicit_error_stepper_base is used as the interface in a CRTP (currently recurring template
  287. * pattern). In order to work correctly the parent class needs to have a method
  288. * `do_step_impl( system , in , dxdt_in , t , out , dt , xerr )`.
  289. * explicit_error_stepper_base derives from algebra_stepper_base.
  290. *
  291. * explicit_error_stepper_base provides several overloaded `do_step` methods, see the list below. Only two of them
  292. * are needed to fulfill the Error Stepper concept. The other ones are for convenience and for performance. Some
  293. * of them simply update the state out-of-place, while other expect that the first derivative at `t` is passed to the
  294. * stepper.
  295. *
  296. * - `do_step( sys , x , t , dt )` - The classical `do_step` method needed to fulfill the Error Stepper concept. The
  297. * state is updated in-place. A type modelling a Boost.Range can be used for x.
  298. * - `do_step( sys , x , dxdt , t , dt )` - This method updates the state in-place, but the derivative at the point `t`
  299. * must be explicitly passed in `dxdt`.
  300. * - `do_step( sys , in , t , out , dt )` - This method updates the state out-of-place, hence the result of the step
  301. * is stored in `out`.
  302. * - `do_step( sys , in , dxdt , t , out , dt )` - This method update the state out-of-place and expects that the
  303. * derivative at the point `t` is explicitly passed in `dxdt`. It is a combination of the two `do_step` methods
  304. * above.
  305. * - `do_step( sys , x , t , dt , xerr )` - This `do_step` method is needed to fulfill the Error Stepper concept. The
  306. * state is updated in-place and an error estimate is calculated. A type modelling a Boost.Range can be used for x.
  307. * - `do_step( sys , x , dxdt , t , dt , xerr )` - This method updates the state in-place, but the derivative at the
  308. * point `t` must be passed in `dxdt`. An error estimate is calculated.
  309. * - `do_step( sys , in , t , out , dt , xerr )` - This method updates the state out-of-place and estimates the error
  310. * during the step.
  311. * - `do_step( sys , in , dxdt , t , out , dt , xerr )` - This methods updates the state out-of-place and estimates
  312. * the error during the step. Furthermore, the derivative at `t` must be passed in `dxdt`.
  313. *
  314. * \note The system is always passed as value, which might result in poor performance if it contains data. In this
  315. * case it can be used with `boost::ref` or `std::ref`, for example `stepper.do_step( boost::ref( sys ) , x , t , dt );`
  316. *
  317. * \note The time `t` is not advanced by the stepper. This has to done manually, or by the appropriate `integrate`
  318. * routines or `iterator`s.
  319. *
  320. * \tparam Stepper The stepper on which this class should work. It is used via CRTP, hence explicit_stepper_base
  321. * provides the interface for the Stepper.
  322. * \tparam Order The order of a stepper if the stepper is used without error estimation.
  323. * \tparam StepperOrder The order of a step if the stepper is used with error estimation. Usually Order and StepperOrder have
  324. * the same value.
  325. * \tparam ErrorOrder The order of the error step if the stepper is used with error estimation.
  326. * \tparam State The state type for the stepper.
  327. * \tparam Value The value type for the stepper. This should be a floating point type, like float,
  328. * double, or a multiprecision type. It must not necessary be the value_type of the State. For example
  329. * the State can be a `vector< complex< double > >` in this case the Value must be double.
  330. * The default value is double.
  331. * \tparam Deriv The type representing time derivatives of the state type. It is usually the same type as the
  332. * state type, only if used with Boost.Units both types differ.
  333. * \tparam Time The type representing the time. Usually the same type as the value type. When Boost.Units is
  334. * used, this type has usually a unit.
  335. * \tparam Algebra The algebra type which must fulfill the Algebra Concept.
  336. * \tparam Operations The type for the operations which must fulfill the Operations Concept.
  337. * \tparam Resizer The resizer policy class.
  338. */
  339. /**
  340. * \fn explicit_error_stepper_base::explicit_error_stepper_base( const algebra_type &algebra = algebra_type() )
  341. *
  342. * \brief Constructs a explicit_error_stepper_base class. This constructor can be used as a default
  343. * constructor if the algebra has a default constructor.
  344. * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
  345. */
  346. /**
  347. * \fn explicit_error_stepper_base::order( void ) const
  348. * \return Returns the order of the stepper if it used without error estimation.
  349. */
  350. /**
  351. * \fn explicit_error_stepper_base::stepper_order( void ) const
  352. * \return Returns the order of a step if the stepper is used without error estimation.
  353. */
  354. /**
  355. * \fn explicit_error_stepper_base::error_order( void ) const
  356. * \return Returns the order of an error step if the stepper is used without error estimation.
  357. */
  358. /**
  359. * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , time_type t , time_type dt )
  360. * \brief This method performs one step. It transforms the result in-place.
  361. *
  362. * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the
  363. * Simple System concept.
  364. * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
  365. * \param t The value of the time, at which the step should be performed.
  366. * \param dt The step size.
  367. */
  368. /**
  369. * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt )
  370. * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method
  371. * the derivative of x is also passed to this method. It is supposed to be used in the following way:
  372. *
  373. * \code
  374. * sys( x , dxdt , t );
  375. * stepper.do_step( sys , x , dxdt , t , dt );
  376. * \endcode
  377. *
  378. * The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this
  379. * case the method could not be distinguished from other `do_step` versions.
  380. *
  381. * \note This method does not solve the forwarding problem.
  382. *
  383. * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
  384. * Simple System concept.
  385. * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
  386. * \param dxdt The derivative of x at t.
  387. * \param t The value of the time, at which the step should be performed.
  388. * \param dt The step size.
  389. */
  390. /**
  391. * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
  392. * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
  393. * This method is disabled if StateIn and Time are the same type. In this case the method can not be distinguished from
  394. * other `do_step` variants.
  395. * \note This method does not solve the forwarding problem.
  396. *
  397. * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
  398. * Simple System concept.
  399. * \param in The state of the ODE which should be solved. in is not modified in this method
  400. * \param t The value of the time, at which the step should be performed.
  401. * \param out The result of the step is written in out.
  402. * \param dt The step size.
  403. */
  404. /**
  405. * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt )
  406. * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
  407. * Furthermore, the derivative of x at t is passed to the stepper. It is supposed to be used in the following way:
  408. *
  409. * \code
  410. * sys( in , dxdt , t );
  411. * stepper.do_step( sys , in , dxdt , t , out , dt );
  412. * \endcode
  413. *
  414. * This method is disabled if DerivIn and Time are of same type.
  415. *
  416. * \note This method does not solve the forwarding problem.
  417. *
  418. * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
  419. * Simple System concept.
  420. * \param in The state of the ODE which should be solved. in is not modified in this method
  421. * \param dxdt The derivative of x at t.
  422. * \param t The value of the time, at which the step should be performed.
  423. * \param out The result of the step is written in out.
  424. * \param dt The step size.
  425. */
  426. /**
  427. * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr )
  428. * \brief The method performs one step with the stepper passed by Stepper and estimates the error. The state of the ODE
  429. * is updated in-place.
  430. *
  431. * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
  432. * Simple System concept.
  433. * \param x The state of the ODE which should be solved. x is updated by this method.
  434. * \param t The value of the time, at which the step should be performed.
  435. * \param dt The step size.
  436. * \param xerr The estimation of the error is stored in xerr.
  437. */
  438. /**
  439. * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt , Err &xerr )
  440. * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method
  441. * the derivative of x is also passed to this method. It is supposed to be used in the following way:
  442. *
  443. * \code
  444. * sys( x , dxdt , t );
  445. * stepper.do_step( sys , x , dxdt , t , dt , xerr );
  446. * \endcode
  447. *
  448. * The result is updated in place in x. This method is disabled if Time and DerivIn are of the same type. In this
  449. * case the method could not be distinguished from other `do_step` versions.
  450. *
  451. * \note This method does not solve the forwarding problem.
  452. *
  453. * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
  454. * Simple System concept.
  455. * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
  456. * \param dxdt The derivative of x at t.
  457. * \param t The value of the time, at which the step should be performed.
  458. * \param dt The step size.
  459. * \param xerr The error estimate is stored in xerr.
  460. */
  461. /**
  462. * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr )
  463. * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
  464. * Furthermore, the error is estimated.
  465. *
  466. * \note This method does not solve the forwarding problem.
  467. *
  468. * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
  469. * Simple System concept.
  470. * \param in The state of the ODE which should be solved. in is not modified in this method
  471. * \param t The value of the time, at which the step should be performed.
  472. * \param out The result of the step is written in out.
  473. * \param dt The step size.
  474. * \param xerr The error estimate.
  475. */
  476. /**
  477. * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , Err &xerr )
  478. * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
  479. * Furthermore, the derivative of x at t is passed to the stepper and the error is estimated. It is supposed to be used in the following way:
  480. *
  481. * \code
  482. * sys( in , dxdt , t );
  483. * stepper.do_step( sys , in , dxdt , t , out , dt );
  484. * \endcode
  485. *
  486. * This method is disabled if DerivIn and Time are of same type.
  487. *
  488. * \note This method does not solve the forwarding problem.
  489. *
  490. * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the
  491. * Simple System concept.
  492. * \param in The state of the ODE which should be solved. in is not modified in this method
  493. * \param dxdt The derivative of x at t.
  494. * \param t The value of the time, at which the step should be performed.
  495. * \param out The result of the step is written in out.
  496. * \param dt The step size.
  497. * \param xerr The error estimate.
  498. */
  499. /**
  500. * \fn explicit_error_stepper_base::adjust_size( const StateIn &x )
  501. * \brief Adjust the size of all temporaries in the stepper manually.
  502. * \param x A state from which the size of the temporaries to be resized is deduced.
  503. */
  504. } // odeint
  505. } // numeric
  506. } // boost
  507. #endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED