| Home | Libraries | People | FAQ | More

## Class template dense_output_runge_kutta<Stepper, stepper_tag>

boost::numeric::odeint::dense_output_runge_kutta<Stepper, stepper_tag> — The class representing dense-output Runge-Kutta steppers.

## Synopsis

    // In header: <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp>

    template<typename Stepper>
    class dense_output_runge_kutta<Stepper, stepper_tag> {
    public:
      // types
      typedef Stepper                             stepper_type;
      typedef stepper_type::state_type            state_type;
      typedef stepper_type::wrapped_state_type    wrapped_state_type;
      typedef stepper_type::value_type            value_type;
      typedef stepper_type::deriv_type            deriv_type;
      typedef stepper_type::wrapped_deriv_type    wrapped_deriv_type;
      typedef stepper_type::time_type             time_type;
      typedef stepper_type::algebra_type          algebra_type;
      typedef stepper_type::operations_type       operations_type;
      typedef stepper_type::resizer_type          resizer_type;
      typedef dense_output_stepper_tag            stepper_category;
      typedef dense_output_runge_kutta< Stepper > dense_output_stepper_type;

      // construct/copy/destruct
      dense_output_runge_kutta(const stepper_type & = stepper_type());

      // public member functions
      template<typename StateType>
        void initialize(const StateType &, time_type, time_type);
      template<typename System> std::pair< time_type, time_type > do_step(System);
      template<typename StateOut> void calc_state(time_type, StateOut &) const;
      template<typename StateOut>
        void calc_state(time_type, const StateOut &) const;
      template<typename StateType> void adjust_size(const StateType &);
      const state_type & current_state(void) const;
      time_type current_time(void) const;
      const state_type & previous_state(void) const;
      time_type previous_time(void) const;
      time_type current_time_step(void) const;

      // private member functions
      state_type & get_current_state(void);
      const state_type & get_current_state(void) const;
      state_type & get_old_state(void);
      const state_type & get_old_state(void) const;
      void toggle_current_state(void);
      template<typename StateIn> bool resize_impl(const StateIn &);
    };

## Description

| Note
In this stepper, the initialize method has to be called before using the do_step method.

The dense-output functionality allows to interpolate the solution between subsequent integration points using intermediate results obtained during the computation. This version works based on a normal stepper without step-size control.

### Template Parameters

1.     typename Stepper

   The stepper type of the underlying algorithm.

### `dense_output_runge_kutta` public construct/copy/destruct

1.     dense_output_runge_kutta(const stepper_type & stepper = stepper_type());

   Constructs the dense_output_runge_kutta class. An instance of the underlying stepper can be provided.

   Parameters:

   `stepper` | An instance of the underlying stepper.

### `dense_output_runge_kutta` public member functions

1.     template<typename StateType>
         void initialize(const StateType & x0, time_type t0, time_type dt0);

   Initializes the stepper. Has to be called before do_step can be used to set the initial conditions and the step size.

   Parameters:

   `dt0` | The step size.
   `t0` | The initial time, at which the step should be performed.
   `x0` | The initial state of the ODE which should be solved.

2.     template<typename System>
         std::pair< time_type, time_type > do_step(System system);

   Does one time step.

   | Note
   initialize has to be called before using this method to set the initial conditions x,t and the stepsize.

   Parameters:

   `system` | The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Simple System concept.

   Returns: | Pair with start and end time of the integration step.

3.     template<typename StateOut> void calc_state(time_type t, StateOut & x) const;

   Calculates the solution at an intermediate point.

   Parameters:

   `t` | The time at which the solution should be calculated, has to be in the current time interval.
   `x` | The output variable where the result is written into.

4.     template<typename StateOut>
         void calc_state(time_type t, const StateOut & x) const;

   Calculates the solution at an intermediate point. Solves the forwarding problem.

   Parameters:

   `t` | The time at which the solution should be calculated, has to be in the current time interval.
   `x` | The output variable where the result is written into, can be a boost range.

5.     template<typename StateType> void adjust_size(const StateType & x);

   Adjust the size of all temporaries in the stepper manually.

   Parameters:

   `x` | A state from which the size of the temporaries to be resized is deduced.

6.     const state_type & current_state(void) const;

   Returns the current state of the solution.

   Returns: | The current state of the solution x(t).

7.     time_type current_time(void) const;

   Returns the current time of the solution.

   Returns: | The current time of the solution t.

8.     const state_type & previous_state(void) const;

   Returns the last state of the solution.

   Returns: | The last state of the solution x(t-dt).

9.     time_type previous_time(void) const;

   Returns the last time of the solution.

   Returns: | The last time of the solution t-dt.

10.     time_type current_time_step(void) const;

    Returns the current time step.

    Returns: | dt.

### `dense_output_runge_kutta` private member functions

1.     state_type & get_current_state(void);

2.     const state_type & get_current_state(void) const;

3.     state_type & get_old_state(void);

4.     const state_type & get_old_state(void) const;

5.     void toggle_current_state(void);

6.     template<typename StateIn> bool resize_impl(const StateIn & x);