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::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer > Class Template Reference

The Adams-Bashforth-Moulton multistep algorithm. More...

#include <adams_bashforth_moulton.hpp>

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

Public Types

typedef State state_type
 
typedef state_wrapper< state_typewrapped_state_type
 
typedef Value value_type
 
typedef Deriv deriv_type
 
typedef state_wrapper< deriv_typewrapped_deriv_type
 
typedef Time time_type
 
typedef Algebra algebra_type
 
typedef Operations operations_type
 
typedef Resizer resizer_type
 
typedef stepper_tag stepper_category
 
typedef adams_bashforth< steps,
state_type, value_type,
deriv_type, time_type,
algebra_type, operations_type,
resizer_type
adams_bashforth_type
 
typedef adams_moulton< steps,
state_type, value_type,
deriv_type, time_type,
algebra_type, operations_type,
resizer_type
adams_moulton_type
 
typedef
adams_bashforth_moulton< steps,
state_type, value_type,
deriv_type, time_type,
algebra_type, operations_type,
resizer_type
stepper_type
 
typedef unsigned short order_type
 

Public Member Functions

 adams_bashforth_moulton (void)
 Constructs the adams_bashforth class. More...
 
 adams_bashforth_moulton (const algebra_type &algebra)
 Constructs the adams_bashforth class. More...
 
order_type order (void) const
 Returns the order of the algorithm, which is equal to the number of steps+1. More...
 
template<class System , class StateInOut >
void do_step (System system, StateInOut &x, time_type t, time_type dt)
 This method performs one step. More...
 
template<class System , class StateInOut >
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...
 
template<class System , class StateIn , class StateOut >
void do_step (System system, const StateIn &in, time_type t, const StateOut &out, time_type dt)
 The method performs one step with the stepper passed by Stepper. More...
 
template<class System , class StateIn , class StateOut >
void do_step (System system, const StateIn &in, time_type t, StateOut &out, time_type dt)
 Second version to solve the forwarding problem, can be called with Boost.Range as StateOut. More...
 
template<class StateType >
void adjust_size (const StateType &x)
 Adjust the size of all temporaries in the stepper manually. More...
 
template<class ExplicitStepper , class System , class StateIn >
void initialize (ExplicitStepper explicit_stepper, System system, StateIn &x, time_type &t, time_type dt)
 Initialized the stepper. More...
 
template<class System , class StateIn >
void initialize (System system, StateIn &x, time_type &t, time_type dt)
 Initialized the stepper. More...
 

Static Public Attributes

static const size_t steps = Steps
 
static const order_type order_value = steps
 

Detailed Description

template<size_t Steps, 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::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >

The Adams-Bashforth-Moulton multistep algorithm.

The Adams-Bashforth method is a multi-step predictor-corrector algorithm with configurable step number. The step number is specified as template parameter Steps and it then uses the result from the previous Steps steps. See also en.wikipedia.org/wiki/Linear_multistep_method. Currently, a maximum of Steps=8 is supported. The method is explicit and fulfills the Stepper concept. Step size control or continuous output are not provided.

This class derives from algebra_base and inherits its interface via CRTP (current recurring template pattern). For more details see algebra_stepper_base.

Template Parameters
StepsThe number of steps (maximal 8).
StateThe state type.
ValueThe value type.
DerivThe type representing the time derivative of the state.
TimeThe time representing the independent variable - the time.
AlgebraThe algebra type.
OperationsThe operations type.
ResizerThe resizer policy type.
InitializingStepperThe stepper for the first two steps.

Member Typedef Documentation

template<size_t Steps, 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 adams_bashforth< steps , state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type > boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::adams_bashforth_type
template<size_t Steps, 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 adams_moulton< steps , state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type > boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::adams_moulton_type
template<size_t Steps, 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 Algebra boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::algebra_type
template<size_t Steps, 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 Deriv boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::deriv_type
template<size_t Steps, 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 Operations boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::operations_type
template<size_t Steps, 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 unsigned short boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::order_type
template<size_t Steps, 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 Resizer boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::resizer_type
template<size_t Steps, 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 State boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::state_type
template<size_t Steps, 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_tag boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::stepper_category
template<size_t Steps, 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 adams_bashforth_moulton< steps , state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type > boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::stepper_type
template<size_t Steps, 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 Time boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::time_type
template<size_t Steps, 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 Value boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::value_type
template<size_t Steps, 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 state_wrapper< deriv_type > boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::wrapped_deriv_type
template<size_t Steps, 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 state_wrapper< state_type > boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::wrapped_state_type

Constructor & Destructor Documentation

template<size_t Steps, 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::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::adams_bashforth_moulton ( void  )
inline

Constructs the adams_bashforth class.

template<size_t Steps, 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::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::adams_bashforth_moulton ( const algebra_type algebra)
inline

Constructs the adams_bashforth class.

This constructor can be used as a default constructor if the algebra has a default constructor.

Parameters
algebraA copy of algebra is made and stored.

Member Function Documentation

template<size_t Steps, 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 StateType >
boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::adjust_size ( const StateType &  x)
inline
template<size_t Steps, 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 StateInOut >
boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
StateInOut &  x,
time_type  t,
time_type  dt 
)
inline

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.
template<size_t Steps, 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 StateInOut >
void boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
const StateInOut &  x,
time_type  t,
time_type  dt 
)
inline

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

template<size_t Steps, 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 StateOut >
boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
const StateIn &  in,
time_type  t,
const StateOut &  out,
time_type  dt 
)
inline

The method performs one step with the stepper passed by Stepper.

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

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.
template<size_t Steps, 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 StateOut >
void boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step ( System  system,
const StateIn &  in,
time_type  t,
StateOut &  out,
time_type  dt 
)
inline

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

template<size_t Steps, 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 ExplicitStepper , class System , class StateIn >
boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::initialize ( ExplicitStepper  explicit_stepper,
System  system,
StateIn &  x,
time_type t,
time_type  dt 
)
inline

Initialized the stepper.

Does Steps-1 steps with the explicit_stepper to fill the buffer.

Note
The state x and time t are updated to the values after Steps-1 initial steps.
Parameters
explicit_stepperthe stepper used to fill the buffer of previous step results
systemThe system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Simple System concept.
xThe initial state of the ODE which should be solved, updated after in this method.
tThe initial time, updated in this method.
dtThe step size.

References boost::numeric::odeint::adams_bashforth< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer, InitializingStepper >::initialize().

template<size_t Steps, 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 >
boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::initialize ( System  system,
StateIn &  x,
time_type t,
time_type  dt 
)
inline

Initialized the stepper.

Does Steps-1 steps using the standard initializing stepper of the underlying adams_bashforth stepper.

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.

References boost::numeric::odeint::adams_bashforth< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer, InitializingStepper >::initialize().

template<size_t Steps, 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::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::order ( void  ) const
inline

Returns the order of the algorithm, which is equal to the number of steps+1.

Returns
order of the method.

References boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::order_value.

Member Data Documentation

template<size_t Steps, 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>
const order_type boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::order_value = steps
static
template<size_t Steps, 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>
const size_t boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::steps = Steps
static

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