|
order_type | order (void) const |
| Returns the order of the algorithm, which is equal to the number of steps. More...
|
|
| adams_bashforth (const algebra_type &algebra=algebra_type()) |
| Constructs the adams_bashforth class. 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, 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, const 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...
|
|
const step_storage_type & | step_storage (void) const |
| Returns the storage of intermediate results. More...
|
|
step_storage_type & | step_storage (void) |
| Returns the storage of intermediate results. 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...
|
|
void | reset (void) |
| Resets the internal buffer of the stepper. More...
|
|
bool | is_initialized (void) const |
| Returns true if the stepper has been initialized. More...
|
|
const initializing_stepper_type & | initializing_stepper (void) const |
| Returns the internal initializing stepper instance. More...
|
|
initializing_stepper_type & | initializing_stepper (void) |
| Returns the internal initializing stepper instance. More...
|
|
algebra_type & | algebra () |
|
const algebra_type & | algebra () const |
|
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
class boost::numeric::odeint::adams_bashforth< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer, InitializingStepper >
The Adams-Bashforth multistep algorithm.
The Adams-Bashforth method is a multi-step 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
-
Steps | The number of steps (maximal 8). |
State | The state type. |
Value | The value type. |
Deriv | The type representing the time derivative of the state. |
Time | The time representing the independent variable - the time. |
Algebra | The algebra type. |
Operations | The operations type. |
Resizer | The resizer policy type. |
InitializingStepper | The stepper for the first two steps. |
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
typedef adams_bashforth< Steps , State , Value , Deriv , Time , Algebra , Operations , Resizer , InitializingStepper > boost::numeric::odeint::adams_bashforth< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer, InitializingStepper >::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, class InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
Constructs the adams_bashforth class.
This constructor can be used as a default constructor if the algebra has a default constructor.
- Parameters
-
algebra | A copy of algebra is made and stored. |
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
template<class StateType >
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
template<class System , class StateInOut >
void boost::numeric::odeint::adams_bashforth< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer, InitializingStepper >::do_step |
( |
System |
system, |
|
|
StateInOut & |
x, |
|
|
time_type |
t, |
|
|
time_type |
dt |
|
) |
| |
|
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, class InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
template<class System , class StateInOut >
void boost::numeric::odeint::adams_bashforth< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer, InitializingStepper >::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, class InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
template<class System , class StateIn , class StateOut >
void boost::numeric::odeint::adams_bashforth< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer, InitializingStepper >::do_step |
( |
System |
system, |
|
|
const StateIn & |
in, |
|
|
time_type |
t, |
|
|
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
-
system | The system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept. |
in | The state of the ODE which should be solved. in is not modified in this method |
t | The value of the time, at which the step should be performed. |
out | The result of the step is written in out. |
dt | The 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, class InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
template<class System , class StateIn , class StateOut >
void boost::numeric::odeint::adams_bashforth< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer, InitializingStepper >::do_step |
( |
System |
system, |
|
|
const StateIn & |
in, |
|
|
time_type |
t, |
|
|
const 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, class InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
template<class ExplicitStepper , class System , class StateIn >
void boost::numeric::odeint::adams_bashforth< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer, InitializingStepper >::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.
- Parameters
-
explicit_stepper | the stepper used to fill the buffer of previous step results |
system | The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Simple System concept. |
x | The state of the ODE which should be solved. After calling do_step the result is updated in x. |
t | The value of the time, at which the step should be performed. |
dt | The step size. |
Referenced by boost::numeric::odeint::adams_bashforth_moulton< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer >::initialize(), and boost::numeric::odeint::adams_bashforth< steps, state_type, value_type, deriv_type, time_type, algebra_type, operations_type, resizer_type >::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, class InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
template<class System , class StateIn >
void boost::numeric::odeint::adams_bashforth< Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer, InitializingStepper >::initialize |
( |
System |
system, |
|
|
StateIn & |
x, |
|
|
time_type & |
t, |
|
|
time_type |
dt |
|
) |
| |
|
inline |
Initialized the stepper.
Does Steps-1 steps with an internal instance of InitializingStepper to fill the buffer.
- Note
- The state x and time t are updated to the values after Steps-1 initial steps.
- Parameters
-
system | The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Simple System concept. |
x | The initial state of the ODE which should be solved, updated in this method. |
t | The initial value of the time, updated in this method. |
dt | The 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, class InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
Returns the internal initializing stepper instance.
- Returns
- initializing_stepper
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
Returns the internal initializing stepper instance.
- Returns
- initializing_stepper
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
Returns true if the stepper has been initialized.
- Returns
- bool true if stepper is initialized, false otherwise
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
Returns the order of the algorithm, which is equal to the number of steps.
- Returns
- order of the method.
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
Resets the internal buffer of the stepper.
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
Returns the storage of intermediate results.
- Returns
- The storage of intermediate results.
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
Returns the storage of intermediate results.
- Returns
- The storage of intermediate results.
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>
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 InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >>