|
||||
File indexing completed on 2025-01-18 09:42:54
0001 /* 0002 [auto_generated] 0003 boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp 0004 0005 [begin_description] 0006 Base class for all explicit Runge Kutta stepper which are also error steppers. 0007 [end_description] 0008 0009 Copyright 2010-2013 Karsten Ahnert 0010 Copyright 2010-2012 Mario Mulansky 0011 Copyright 2012 Christoph Koke 0012 0013 Distributed under the Boost Software License, Version 1.0. 0014 (See accompanying file LICENSE_1_0.txt or 0015 copy at http://www.boost.org/LICENSE_1_0.txt) 0016 */ 0017 0018 0019 #ifndef BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED 0020 #define BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED 0021 0022 #include <boost/utility/enable_if.hpp> 0023 #include <boost/type_traits/is_same.hpp> 0024 0025 0026 #include <boost/numeric/odeint/util/bind.hpp> 0027 #include <boost/numeric/odeint/util/unwrap_reference.hpp> 0028 #include <boost/numeric/odeint/util/state_wrapper.hpp> 0029 #include <boost/numeric/odeint/util/is_resizeable.hpp> 0030 #include <boost/numeric/odeint/util/resizer.hpp> 0031 0032 #include <boost/numeric/odeint/stepper/stepper_categories.hpp> 0033 0034 #include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp> 0035 0036 namespace boost { 0037 namespace numeric { 0038 namespace odeint { 0039 0040 0041 /* 0042 * base class for explicit stepper and error steppers 0043 * models the stepper AND the error stepper concept 0044 * 0045 * this class provides the following do_step variants: 0046 * do_step( sys , x , t , dt ) 0047 * do_step( sys , x , dxdt , t , dt ) 0048 * do_step( sys , in , t , out , dt ) 0049 * do_step( sys , in , dxdt , t , out , dt ) 0050 * do_step( sys , x , t , dt , xerr ) 0051 * do_step( sys , x , dxdt , t , dt , xerr ) 0052 * do_step( sys , in , t , out , dt , xerr ) 0053 * do_step( sys , in , dxdt , t , out , dt , xerr ) 0054 */ 0055 template< 0056 class Stepper , 0057 unsigned short Order , 0058 unsigned short StepperOrder , 0059 unsigned short ErrorOrder , 0060 class State , 0061 class Value , 0062 class Deriv , 0063 class Time , 0064 class Algebra , 0065 class Operations , 0066 class Resizer 0067 > 0068 class explicit_error_stepper_base : public algebra_stepper_base< Algebra , Operations > 0069 { 0070 public: 0071 0072 typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type; 0073 typedef typename algebra_stepper_base_type::algebra_type algebra_type; 0074 0075 0076 typedef State state_type; 0077 typedef Value value_type; 0078 typedef Deriv deriv_type; 0079 typedef Time time_type; 0080 typedef Resizer resizer_type; 0081 typedef Stepper stepper_type; 0082 typedef explicit_error_stepper_tag stepper_category; 0083 #ifndef DOXYGEN_SKIP 0084 typedef state_wrapper< state_type > wrapped_state_type; 0085 typedef state_wrapper< deriv_type > wrapped_deriv_type; 0086 typedef explicit_error_stepper_base< Stepper , Order , StepperOrder , ErrorOrder , 0087 State , Value , Deriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type; 0088 #endif 0089 0090 typedef unsigned short order_type; 0091 static const order_type order_value = Order; 0092 static const order_type stepper_order_value = StepperOrder; 0093 static const order_type error_order_value = ErrorOrder; 0094 0095 0096 explicit_error_stepper_base( const algebra_type &algebra = algebra_type() ) 0097 : algebra_stepper_base_type( algebra ) 0098 { } 0099 0100 order_type order( void ) const 0101 { 0102 return order_value; 0103 } 0104 0105 order_type stepper_order( void ) const 0106 { 0107 return stepper_order_value; 0108 } 0109 0110 order_type error_order( void ) const 0111 { 0112 return error_order_value; 0113 } 0114 0115 0116 0117 /* 0118 * Version 1 : do_step( sys , x , t , dt ) 0119 * 0120 * the two overloads are needed in order to solve the forwarding problem 0121 */ 0122 template< class System , class StateInOut > 0123 void do_step( System system , StateInOut &x , time_type t , time_type dt ) 0124 { 0125 do_step_v1( system , x , t , dt ); 0126 } 0127 0128 /** 0129 * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. 0130 */ 0131 template< class System , class StateInOut > 0132 void do_step( System system , const StateInOut &x , time_type t , time_type dt ) 0133 { 0134 do_step_v1( system , x , t , dt ); 0135 } 0136 0137 0138 0139 /* 0140 * Version 2 : do_step( sys , x , dxdt , t , dt ) 0141 * 0142 * this version does not solve the forwarding problem, boost.range can not be used 0143 * 0144 * the disable is needed to avoid ambiguous overloads if state_type = time_type 0145 */ 0146 template< class System , class StateInOut , class DerivIn > 0147 typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type 0148 do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt ) 0149 { 0150 this->stepper().do_step_impl( system , x , dxdt , t , x , dt ); 0151 } 0152 0153 0154 /* 0155 * named Version 2: do_step_dxdt_impl( sys , in , dxdt , t , dt ) 0156 * 0157 * this version is needed when this stepper is used for initializing 0158 * multistep stepper like adams-bashforth. Hence we provide an explicitely 0159 * named version that is not disabled. Meant for internal use only. 0160 */ 0161 template < class System, class StateInOut, class DerivIn > 0162 void do_step_dxdt_impl( System system, StateInOut &x, const DerivIn &dxdt, 0163 time_type t, time_type dt ) 0164 { 0165 this->stepper().do_step_impl( system , x , dxdt , t , x , dt ); 0166 } 0167 0168 0169 0170 /* 0171 * Version 3 : do_step( sys , in , t , out , dt ) 0172 * 0173 * this version does not solve the forwarding problem, boost.range can not be used 0174 * 0175 * the disable is needed to avoid ambiguous overloads if state_type = time_type 0176 */ 0177 template< class System , class StateIn , class StateOut > 0178 typename boost::disable_if< boost::is_same< StateIn , time_type > , void >::type 0179 do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) 0180 { 0181 typename odeint::unwrap_reference< System >::type &sys = system; 0182 m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ); 0183 sys( in , m_dxdt.m_v ,t ); 0184 this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt ); 0185 } 0186 0187 /* 0188 * Version 4 :do_step( sys , in , dxdt , t , out , dt ) 0189 * 0190 * this version does not solve the forwarding problem, boost.range can not be used 0191 * 0192 * the disable is needed to avoid ambiguous overloads if state_type = time_type 0193 */ 0194 template< class System , class StateIn , class DerivIn , class StateOut > 0195 typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type 0196 do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) 0197 { 0198 this->stepper().do_step_impl( system , in , dxdt , t , out , dt ); 0199 } 0200 0201 /* 0202 * named Version 4: do_step_dxdt_impl( sys , in , dxdt , t , out, dt ) 0203 * 0204 * this version is needed when this stepper is used for initializing 0205 * multistep stepper like adams-bashforth. Hence we provide an explicitely 0206 * named version that is not disabled. Meant for internal use only. 0207 */ 0208 template < class System, class StateIn, class DerivIn, class StateOut > 0209 void do_step_dxdt_impl( System system, const StateIn &in, 0210 const DerivIn &dxdt, time_type t, StateOut &out, 0211 time_type dt ) 0212 { 0213 this->stepper().do_step_impl( system , in , dxdt , t , out , dt ); 0214 } 0215 0216 /* 0217 * Version 5 :do_step( sys , x , t , dt , xerr ) 0218 * 0219 * the two overloads are needed in order to solve the forwarding problem 0220 */ 0221 template< class System , class StateInOut , class Err > 0222 void do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) 0223 { 0224 do_step_v5( system , x , t , dt , xerr ); 0225 } 0226 0227 /** 0228 * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. 0229 */ 0230 template< class System , class StateInOut , class Err > 0231 void do_step( System system , const StateInOut &x , time_type t , time_type dt , Err &xerr ) 0232 { 0233 do_step_v5( system , x , t , dt , xerr ); 0234 } 0235 0236 0237 /* 0238 * Version 6 :do_step( sys , x , dxdt , t , dt , xerr ) 0239 * 0240 * this version does not solve the forwarding problem, boost.range can not be used 0241 * 0242 * the disable is needed to avoid ambiguous overloads if state_type = time_type 0243 */ 0244 template< class System , class StateInOut , class DerivIn , class Err > 0245 typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type 0246 do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt , Err &xerr ) 0247 { 0248 this->stepper().do_step_impl( system , x , dxdt , t , x , dt , xerr ); 0249 } 0250 0251 0252 /* 0253 * Version 7 : do_step( sys , in , t , out , dt , xerr ) 0254 * 0255 * this version does not solve the forwarding problem, boost.range can not be used 0256 */ 0257 template< class System , class StateIn , class StateOut , class Err > 0258 void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr ) 0259 { 0260 typename odeint::unwrap_reference< System >::type &sys = system; 0261 m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ); 0262 sys( in , m_dxdt.m_v ,t ); 0263 this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt , xerr ); 0264 } 0265 0266 0267 /* 0268 * Version 8 : do_step( sys , in , dxdt , t , out , dt , xerr ) 0269 * 0270 * this version does not solve the forwarding problem, boost.range can not be used 0271 */ 0272 template< class System , class StateIn , class DerivIn , class StateOut , class Err > 0273 void do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , Err &xerr ) 0274 { 0275 this->stepper().do_step_impl( system , in , dxdt , t , out , dt , xerr ); 0276 } 0277 0278 template< class StateIn > 0279 void adjust_size( const StateIn &x ) 0280 { 0281 resize_impl( x ); 0282 } 0283 0284 0285 0286 private: 0287 0288 template< class System , class StateInOut > 0289 void do_step_v1( System system , StateInOut &x , time_type t , time_type dt ) 0290 { 0291 typename odeint::unwrap_reference< System >::type &sys = system; 0292 m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl<StateInOut> , detail::ref( *this ) , detail::_1 ) ); 0293 sys( x , m_dxdt.m_v , t ); 0294 this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt ); 0295 } 0296 0297 template< class System , class StateInOut , class Err > 0298 void do_step_v5( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) 0299 { 0300 typename odeint::unwrap_reference< System >::type &sys = system; 0301 m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl<StateInOut> , detail::ref( *this ) , detail::_1 ) ); 0302 sys( x , m_dxdt.m_v ,t ); 0303 this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt , xerr ); 0304 } 0305 0306 template< class StateIn > 0307 bool resize_impl( const StateIn &x ) 0308 { 0309 return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); 0310 } 0311 0312 stepper_type& stepper( void ) 0313 { 0314 return *static_cast< stepper_type* >( this ); 0315 } 0316 0317 const stepper_type& stepper( void ) const 0318 { 0319 return *static_cast< const stepper_type* >( this ); 0320 } 0321 0322 0323 resizer_type m_resizer; 0324 0325 protected: 0326 0327 wrapped_deriv_type m_dxdt; 0328 }; 0329 0330 0331 0332 0333 /******** DOXYGEN *******/ 0334 0335 /** 0336 * \class explicit_error_stepper_base 0337 * \brief Base class for explicit steppers with error estimation. This class can used with 0338 * controlled steppers for step size control. 0339 * 0340 * This class serves as the base class for all explicit steppers with algebra and operations. In contrast to 0341 * explicit_stepper_base it also estimates the error and can be used in a controlled stepper to provide 0342 * step size control. 0343 * 0344 * \note This stepper provides `do_step` methods with and without error estimation. It has therefore three orders, 0345 * one for the order of a step if the error is not estimated. The other two orders are the orders of the step and 0346 * the error step if the error estimation is performed. 0347 * 0348 * explicit_error_stepper_base is used as the interface in a CRTP (currently recurring template 0349 * pattern). In order to work correctly the parent class needs to have a method 0350 * `do_step_impl( system , in , dxdt_in , t , out , dt , xerr )`. 0351 * explicit_error_stepper_base derives from algebra_stepper_base. 0352 * 0353 * explicit_error_stepper_base provides several overloaded `do_step` methods, see the list below. Only two of them 0354 * are needed to fulfill the Error Stepper concept. The other ones are for convenience and for performance. Some 0355 * of them simply update the state out-of-place, while other expect that the first derivative at `t` is passed to the 0356 * stepper. 0357 * 0358 * - `do_step( sys , x , t , dt )` - The classical `do_step` method needed to fulfill the Error Stepper concept. The 0359 * state is updated in-place. A type modelling a Boost.Range can be used for x. 0360 * - `do_step( sys , x , dxdt , t , dt )` - This method updates the state in-place, but the derivative at the point `t` 0361 * must be explicitly passed in `dxdt`. 0362 * - `do_step( sys , in , t , out , dt )` - This method updates the state out-of-place, hence the result of the step 0363 * is stored in `out`. 0364 * - `do_step( sys , in , dxdt , t , out , dt )` - This method update the state out-of-place and expects that the 0365 * derivative at the point `t` is explicitly passed in `dxdt`. It is a combination of the two `do_step` methods 0366 * above. 0367 * - `do_step( sys , x , t , dt , xerr )` - This `do_step` method is needed to fulfill the Error Stepper concept. The 0368 * state is updated in-place and an error estimate is calculated. A type modelling a Boost.Range can be used for x. 0369 * - `do_step( sys , x , dxdt , t , dt , xerr )` - This method updates the state in-place, but the derivative at the 0370 * point `t` must be passed in `dxdt`. An error estimate is calculated. 0371 * - `do_step( sys , in , t , out , dt , xerr )` - This method updates the state out-of-place and estimates the error 0372 * during the step. 0373 * - `do_step( sys , in , dxdt , t , out , dt , xerr )` - This methods updates the state out-of-place and estimates 0374 * the error during the step. Furthermore, the derivative at `t` must be passed in `dxdt`. 0375 * 0376 * \note The system is always passed as value, which might result in poor performance if it contains data. In this 0377 * case it can be used with `boost::ref` or `std::ref`, for example `stepper.do_step( boost::ref( sys ) , x , t , dt );` 0378 * 0379 * \note The time `t` is not advanced by the stepper. This has to done manually, or by the appropriate `integrate` 0380 * routines or `iterator`s. 0381 * 0382 * \tparam Stepper The stepper on which this class should work. It is used via CRTP, hence explicit_stepper_base 0383 * provides the interface for the Stepper. 0384 * \tparam Order The order of a stepper if the stepper is used without error estimation. 0385 * \tparam StepperOrder The order of a step if the stepper is used with error estimation. Usually Order and StepperOrder have 0386 * the same value. 0387 * \tparam ErrorOrder The order of the error step if the stepper is used with error estimation. 0388 * \tparam State The state type for the stepper. 0389 * \tparam Value The value type for the stepper. This should be a floating point type, like float, 0390 * double, or a multiprecision type. It must not necessary be the value_type of the State. For example 0391 * the State can be a `vector< complex< double > >` in this case the Value must be double. 0392 * The default value is double. 0393 * \tparam Deriv The type representing time derivatives of the state type. It is usually the same type as the 0394 * state type, only if used with Boost.Units both types differ. 0395 * \tparam Time The type representing the time. Usually the same type as the value type. When Boost.Units is 0396 * used, this type has usually a unit. 0397 * \tparam Algebra The algebra type which must fulfill the Algebra Concept. 0398 * \tparam Operations The type for the operations which must fulfill the Operations Concept. 0399 * \tparam Resizer The resizer policy class. 0400 */ 0401 0402 0403 /** 0404 * \fn explicit_error_stepper_base::explicit_error_stepper_base( const algebra_type &algebra = algebra_type() ) 0405 * 0406 * \brief Constructs a explicit_error_stepper_base class. This constructor can be used as a default 0407 * constructor if the algebra has a default constructor. 0408 * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. 0409 */ 0410 0411 /** 0412 * \fn explicit_error_stepper_base::order( void ) const 0413 * \return Returns the order of the stepper if it used without error estimation. 0414 */ 0415 0416 /** 0417 * \fn explicit_error_stepper_base::stepper_order( void ) const 0418 * \return Returns the order of a step if the stepper is used without error estimation. 0419 */ 0420 0421 /** 0422 * \fn explicit_error_stepper_base::error_order( void ) const 0423 * \return Returns the order of an error step if the stepper is used without error estimation. 0424 */ 0425 0426 /** 0427 * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , time_type t , time_type dt ) 0428 * \brief This method performs one step. It transforms the result in-place. 0429 * 0430 * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the 0431 * Simple System concept. 0432 * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. 0433 * \param t The value of the time, at which the step should be performed. 0434 * \param dt The step size. 0435 */ 0436 0437 /** 0438 * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt ) 0439 * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method 0440 * the derivative of x is also passed to this method. It is supposed to be used in the following way: 0441 * 0442 * \code 0443 * sys( x , dxdt , t ); 0444 * stepper.do_step( sys , x , dxdt , t , dt ); 0445 * \endcode 0446 * 0447 * The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this 0448 * case the method could not be distinguished from other `do_step` versions. 0449 * 0450 * \note This method does not solve the forwarding problem. 0451 * 0452 * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the 0453 * Simple System concept. 0454 * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. 0455 * \param dxdt The derivative of x at t. 0456 * \param t The value of the time, at which the step should be performed. 0457 * \param dt The step size. 0458 */ 0459 0460 /** 0461 * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) 0462 * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. 0463 * This method is disabled if StateIn and Time are the same type. In this case the method can not be distinguished from 0464 * other `do_step` variants. 0465 * \note This method does not solve the forwarding problem. 0466 * 0467 * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the 0468 * Simple System concept. 0469 * \param in The state of the ODE which should be solved. in is not modified in this method 0470 * \param t The value of the time, at which the step should be performed. 0471 * \param out The result of the step is written in out. 0472 * \param dt The step size. 0473 */ 0474 0475 0476 /** 0477 * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) 0478 * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. 0479 * Furthermore, the derivative of x at t is passed to the stepper. It is supposed to be used in the following way: 0480 * 0481 * \code 0482 * sys( in , dxdt , t ); 0483 * stepper.do_step( sys , in , dxdt , t , out , dt ); 0484 * \endcode 0485 * 0486 * This method is disabled if DerivIn and Time are of same type. 0487 * 0488 * \note This method does not solve the forwarding problem. 0489 * 0490 * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the 0491 * Simple System concept. 0492 * \param in The state of the ODE which should be solved. in is not modified in this method 0493 * \param dxdt The derivative of x at t. 0494 * \param t The value of the time, at which the step should be performed. 0495 * \param out The result of the step is written in out. 0496 * \param dt The step size. 0497 */ 0498 0499 /** 0500 * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) 0501 * \brief The method performs one step with the stepper passed by Stepper and estimates the error. The state of the ODE 0502 * is updated in-place. 0503 * 0504 * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the 0505 * Simple System concept. 0506 * \param x The state of the ODE which should be solved. x is updated by this method. 0507 * \param t The value of the time, at which the step should be performed. 0508 * \param dt The step size. 0509 * \param xerr The estimation of the error is stored in xerr. 0510 */ 0511 0512 /** 0513 * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt , Err &xerr ) 0514 * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method 0515 * the derivative of x is also passed to this method. It is supposed to be used in the following way: 0516 * 0517 * \code 0518 * sys( x , dxdt , t ); 0519 * stepper.do_step( sys , x , dxdt , t , dt , xerr ); 0520 * \endcode 0521 * 0522 * The result is updated in place in x. This method is disabled if Time and DerivIn are of the same type. In this 0523 * case the method could not be distinguished from other `do_step` versions. 0524 * 0525 * \note This method does not solve the forwarding problem. 0526 * 0527 * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the 0528 * Simple System concept. 0529 * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. 0530 * \param dxdt The derivative of x at t. 0531 * \param t The value of the time, at which the step should be performed. 0532 * \param dt The step size. 0533 * \param xerr The error estimate is stored in xerr. 0534 */ 0535 0536 /** 0537 * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr ) 0538 * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. 0539 * Furthermore, the error is estimated. 0540 * 0541 * \note This method does not solve the forwarding problem. 0542 * 0543 * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the 0544 * Simple System concept. 0545 * \param in The state of the ODE which should be solved. in is not modified in this method 0546 * \param t The value of the time, at which the step should be performed. 0547 * \param out The result of the step is written in out. 0548 * \param dt The step size. 0549 * \param xerr The error estimate. 0550 */ 0551 0552 0553 /** 0554 * \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 ) 0555 * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. 0556 * 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: 0557 * 0558 * \code 0559 * sys( in , dxdt , t ); 0560 * stepper.do_step( sys , in , dxdt , t , out , dt ); 0561 * \endcode 0562 * 0563 * This method is disabled if DerivIn and Time are of same type. 0564 * 0565 * \note This method does not solve the forwarding problem. 0566 * 0567 * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the 0568 * Simple System concept. 0569 * \param in The state of the ODE which should be solved. in is not modified in this method 0570 * \param dxdt The derivative of x at t. 0571 * \param t The value of the time, at which the step should be performed. 0572 * \param out The result of the step is written in out. 0573 * \param dt The step size. 0574 * \param xerr The error estimate. 0575 */ 0576 0577 0578 /** 0579 * \fn explicit_error_stepper_base::adjust_size( const StateIn &x ) 0580 * \brief Adjust the size of all temporaries in the stepper manually. 0581 * \param x A state from which the size of the temporaries to be resized is deduced. 0582 */ 0583 0584 } // odeint 0585 } // numeric 0586 } // boost 0587 0588 #endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |