Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Boost C++ Libraries Home Libraries People FAQ More


Class template n_step_iterator

boost::numeric::odeint::n_step_iterator — ODE Iterator with constant step size. The value type of this iterator is the state type of the stepper.


// In header: <boost/numeric/odeint/iterator/n_step_iterator.hpp>

template<typename Stepper, typename System, typename State> 
class n_step_iterator {
  // construct/copy/destruct
  n_step_iterator(Stepper, System, State &, time_type, time_type, size_t);
  n_step_iterator(Stepper, System, State &);


Implements an iterator representing the solution of an ODE starting from t with n steps and a constant step size dt. After each iteration the iterator dereferences to the state x at the next time t+dt. This iterator can be used with Steppers and DenseOutputSteppers and it always makes use of the all the given steppers capabilities. A for_each over such an iterator range behaves similar to the integrate_n_steps routine.

n_step_iterator is a model of single-pass iterator.

The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time.

Template Parameters

  1. typename Stepper

    The stepper type which should be used during the iteration.

  2. typename System

    The type of the system function (ODE) which should be solved.

  3. typename State

    The state type of the ODE.

n_step_iterator public construct/copy/destruct

  1. n_step_iterator(Stepper stepper, System sys, State & s, time_type t, 
                    time_type dt, size_t num_of_steps);
  2. n_step_iterator(Stepper stepper, System sys, State & s);