Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > Class Template Reference

Implementation of the modified midpoint method with a configurable number of intermediate steps. More...

#include <modified_midpoint.hpp>

Inheritance diagram for boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >:
Collaboration diagram for boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >:

Public Types

typedef explicit_stepper_base
< modified_midpoint< State,
Value, Deriv, Time, Algebra,
Operations, Resizer >
, 2, State, Value, Deriv, Time,
Algebra, Operations, Resizer > 
stepper_base_type
 
typedef
stepper_base_type::state_type 
state_type
 
typedef
stepper_base_type::wrapped_state_type 
wrapped_state_type
 
typedef
stepper_base_type::value_type 
value_type
 
typedef
stepper_base_type::deriv_type 
deriv_type
 
typedef
stepper_base_type::wrapped_deriv_type 
wrapped_deriv_type
 
typedef
stepper_base_type::time_type 
time_type
 
typedef
stepper_base_type::algebra_type 
algebra_type
 
typedef
stepper_base_type::operations_type 
operations_type
 
typedef
stepper_base_type::resizer_type 
resizer_type
 
typedef
stepper_base_type::stepper_type 
stepper_type
 
typedef explicit_stepper_base
< modified_midpoint< State,
Value, Deriv, Time, Algebra,
Operations, Resizer >, Order,
State, Value, Deriv, Time,
Algebra, Operations, Resizer > 
internal_stepper_base_type
 
typedef stepper_tag stepper_category
 
typedef algebra_stepper_base
< Algebra, Operations > 
algebra_stepper_base_type
 
typedef unsigned short order_type
 

Public Member Functions

 modified_midpoint (unsigned short steps=2, const algebra_type &algebra=algebra_type())
 
template<class System , class StateIn , class DerivIn , class StateOut >
void do_step_impl (System system, const StateIn &in, const DerivIn &dxdt, time_type t, StateOut &out, time_type dt)
 
void set_steps (unsigned short steps)
 
unsigned short steps (void) const
 
template<class StateIn >
void adjust_size (const StateIn &x)
 
order_type order (void) const
 
void do_step (System system, StateInOut &x, time_type t, time_type dt)
 This method performs one step. More...
 
void do_step (System system, const StateInOut &x, time_type t, time_type dt)
 Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. More...
 
boost::disable_if
< boost::is_same< DerivIn,
time_type >, void >::type 
do_step (System system, StateInOut &x, const DerivIn &dxdt, time_type t, time_type dt)
 The method performs one step. More...
 
void do_step (System system, const StateIn &in, time_type t, StateOut &out, time_type dt)
 The method performs one step. More...
 
void do_step (System system, const StateIn &in, const DerivIn &dxdt, time_type t, StateOut &out, time_type dt)
 The method performs one step. More...
 
algebra_typealgebra ()
 
const algebra_typealgebra () const
 

Static Public Attributes

static const order_type order_value
 

Protected Attributes

algebra_type m_algebra
 

Detailed Description

template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
class boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >

Implementation of the modified midpoint method with a configurable number of intermediate steps.

This class is used by the Bulirsch-Stoer algorithm and is not meant for direct usage.

Member Typedef Documentation

typedef algebra_stepper_base< Algebra , Operations > boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::algebra_stepper_base_type
inherited
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef stepper_base_type::algebra_type boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::algebra_type
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef stepper_base_type::deriv_type boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::deriv_type
typedef explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order , State , Value , Deriv , Time , Algebra , Operations , Resizer > boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::internal_stepper_base_type
inherited
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef stepper_base_type::operations_type boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::operations_type
typedef unsigned short boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::order_type
inherited
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef stepper_base_type::resizer_type boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::resizer_type
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef stepper_base_type::state_type boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::state_type
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef explicit_stepper_base< modified_midpoint< State , Value , Deriv , Time , Algebra , Operations , Resizer > , 2 , State , Value , Deriv , Time , Algebra , Operations , Resizer > boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::stepper_base_type
typedef stepper_tag boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::stepper_category
inherited
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef stepper_base_type::stepper_type boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::stepper_type
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef stepper_base_type::time_type boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::time_type
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef stepper_base_type::value_type boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::value_type
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef stepper_base_type::wrapped_deriv_type boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::wrapped_deriv_type
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
typedef stepper_base_type::wrapped_state_type boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::wrapped_state_type

Constructor & Destructor Documentation

template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::modified_midpoint ( unsigned short  steps = 2,
const algebra_type algebra = algebra_type() 
)
inline

Member Function Documentation

template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
template<class StateIn >
void boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::adjust_size ( const StateIn &  x)
inline
template<class Algebra, class Operations>
algebra_type & boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::algebra ( )
inlineinherited
Returns
A reference to the algebra which is held by this class.
template<class Algebra, class Operations>
const algebra_type & boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::algebra ( ) const
inlineinherited
Returns
A const reference to the algebra which is held by this class.
void boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
StateInOut &  x,
time_type  t,
time_type  dt 
)
inlineinherited

This method performs one step.

It transforms the result in-place.

Parameters
systemThe system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Simple System concept.
xThe state of the ODE which should be solved. After calling do_step the result is updated in x.
tThe value of the time, at which the step should be performed.
dtThe step size.
void boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
const StateInOut &  x,
time_type  t,
time_type  dt 
)
inlineinherited

Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut.

boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
StateInOut &  x,
const DerivIn &  dxdt,
time_type  t,
time_type  dt 
)
inlineinherited

The method performs one step.

Additionally to the other method the derivative of x is also passed to this method. It is supposed to be used in the following way:

sys( x , dxdt , t );
stepper.do_step( sys , x , dxdt , t , dt );

The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this case the method could not be distinguished from other do_step versions.

Note
This method does not solve the forwarding problem.
Parameters
systemThe system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept.
xThe state of the ODE which should be solved. After calling do_step the result is updated in x.
dxdtThe derivative of x at t.
tThe value of the time, at which the step should be performed.
dtThe step size.
void boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
const StateIn &  in,
time_type  t,
StateOut &  out,
time_type  dt 
)
inlineinherited

The method performs one step.

The state of the ODE is updated out-of-place.

Note
This method does not solve the forwarding problem.
Parameters
systemThe system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept.
inThe state of the ODE which should be solved. in is not modified in this method
tThe value of the time, at which the step should be performed.
outThe result of the step is written in out.
dtThe step size.
void boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
const StateIn &  in,
const DerivIn &  dxdt,
time_type  t,
StateOut &  out,
time_type  dt 
)
inlineinherited

The method performs one step.

The state of the ODE is updated out-of-place. Furthermore, the derivative of x at t is passed to the stepper. It is supposed to be used in the following way:

sys( in , dxdt , t );
stepper.do_step( sys , in , dxdt , t , out , dt );
Note
This method does not solve the forwarding problem.
Parameters
systemThe system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept.
inThe state of the ODE which should be solved. in is not modified in this method
dxdtThe derivative of x at t.
tThe value of the time, at which the step should be performed.
outThe result of the step is written in out.
dtThe step size.
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
template<class System , class StateIn , class DerivIn , class StateOut >
void boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl ( System  system,
const StateIn &  in,
const DerivIn &  dxdt,
time_type  t,
StateOut &  out,
time_type  dt 
)
inline
order_type boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::order ( void  ) const
inlineinherited
Returns
Returns the order of the stepper.
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
void boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::set_steps ( unsigned short  steps)
inline
template<class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
unsigned short boost::numeric::odeint::modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer >::steps ( void  ) const
inline

Member Data Documentation

template<class Algebra, class Operations>
algebra_type boost::numeric::odeint::algebra_stepper_base< Algebra, Operations >::m_algebra
protectedinherited
const order_type boost::numeric::odeint::explicit_stepper_base< modified_midpoint< State, Value, Deriv, Time, Algebra, Operations, Resizer > , Order, State, Value, Deriv, Time, Algebra, Operations, Resizer >::order_value
staticinherited

The documentation for this class was generated from the following file: