2
0
mirror of https://github.com/boostorg/odeint.git synced 2026-01-25 18:32:14 +00:00

adding boost::ref support for stepper parameter in integrate functions, including tests - closes #101

This commit is contained in:
mariomulansky
2013-10-10 13:17:19 +02:00
parent 8170fa3b71
commit bb7ebc3af7
12 changed files with 367 additions and 69 deletions

View File

@@ -56,12 +56,14 @@ size_t integrate_adaptive(
{
size_t steps = detail::integrate_const( stepper , system , start_state , start_time ,
end_time , dt , observer , stepper_tag() );
typename odeint::unwrap_reference< Observer >::type &obs = observer;
typename odeint::unwrap_reference< Stepper >::type &st = stepper;
Time end = start_time + dt*steps;
if( less_with_sign( end , end_time , dt ) )
{ //make a last step to end exactly at end_time
stepper.do_step( system , start_state , end , end_time - end );
st.do_step( system , start_state , end , end_time - end );
steps++;
typename odeint::unwrap_reference< Observer >::type &obs = observer;
obs( start_state , end_time );
}
return steps;
@@ -79,6 +81,7 @@ size_t integrate_adaptive(
)
{
typename odeint::unwrap_reference< Observer >::type &obs = observer;
typename odeint::unwrap_reference< Stepper >::type &st = stepper;
const size_t max_attempts = 1000;
const char *error_string = "Integrate adaptive : Maximal number of iterations reached. A step size could not be found.";
@@ -95,7 +98,7 @@ size_t integrate_adaptive(
controlled_step_result res = success;
do
{
res = stepper.try_step( system , start_state , start_time , dt );
res = st.try_step( system , start_state , start_time , dt );
++trials;
}
while( ( res == fail ) && ( trials < max_attempts ) );
@@ -120,25 +123,27 @@ size_t integrate_adaptive(
Observer observer , dense_output_stepper_tag )
{
typename odeint::unwrap_reference< Observer >::type &obs = observer;
typename odeint::unwrap_reference< Stepper >::type &st = stepper;
size_t count = 0;
stepper.initialize( start_state , start_time , dt );
st.initialize( start_state , start_time , dt );
while( less_with_sign( stepper.current_time() , end_time , stepper.current_time_step() ) )
while( less_with_sign( st.current_time() , end_time , st.current_time_step() ) )
{
while( less_eq_with_sign( stepper.current_time() + stepper.current_time_step() ,
while( less_eq_with_sign( st.current_time() + st.current_time_step() ,
end_time ,
stepper.current_time_step() ) )
st.current_time_step() ) )
{ //make sure we don't go beyond the end_time
obs( stepper.current_state() , stepper.current_time() );
stepper.do_step( system );
obs( st.current_state() , st.current_time() );
st.do_step( system );
++count;
}
stepper.initialize( stepper.current_state() , stepper.current_time() , end_time - stepper.current_time() );
// calculate time step to arrive exactly at end time
st.initialize( st.current_state() , st.current_time() , end_time - st.current_time() );
}
obs( stepper.current_state() , stepper.current_time() );
obs( st.current_state() , st.current_time() );
// overwrite start_state with the final point
boost::numeric::odeint::copy( stepper.current_state() , start_state );
boost::numeric::odeint::copy( st.current_state() , start_state );
return count;
}

View File

@@ -46,6 +46,7 @@ size_t integrate_const(
)
{
typename odeint::unwrap_reference< Observer >::type &obs = observer;
typename odeint::unwrap_reference< Stepper >::type &st = stepper;
Time time = start_time;
int step = 0;
@@ -53,7 +54,7 @@ size_t integrate_const(
while( less_eq_with_sign( time+dt , end_time , dt ) )
{
obs( start_state , time );
stepper.do_step( system , start_state , time , dt );
st.do_step( system , start_state , time , dt );
// direct computation of the time avoids error propagation happening when using time += dt
// we need clumsy type analysis to get boost units working here
++step;
@@ -103,10 +104,11 @@ size_t integrate_const(
)
{
typename odeint::unwrap_reference< Observer >::type &obs = observer;
typename odeint::unwrap_reference< Stepper >::type &st = stepper;
Time time = start_time;
stepper.initialize( start_state , time , dt );
st.initialize( start_state , time , dt );
obs( start_state , time );
time += dt;
@@ -115,9 +117,9 @@ size_t integrate_const(
while( less_with_sign( time+dt , end_time , dt ) )
{
while( less_eq_with_sign( time , stepper.current_time() , dt ) )
while( less_eq_with_sign( time , st.current_time() , dt ) )
{
stepper.calc_state( time , start_state );
st.calc_state( time , start_state );
obs( start_state , time );
++obs_step;
// direct computation of the time avoids error propagation happening when using time += dt
@@ -125,20 +127,20 @@ size_t integrate_const(
time = start_time + static_cast< typename unit_value_type<Time>::type >(obs_step) * dt;
}
// we have not reached the end, do another real step
if( less_with_sign( stepper.current_time()+stepper.current_time_step() ,
if( less_with_sign( st.current_time()+st.current_time_step() ,
end_time ,
stepper.current_time_step() ) )
st.current_time_step() ) )
{
while( less_eq_with_sign( stepper.current_time() , time , dt ) )
while( less_eq_with_sign( st.current_time() , time , dt ) )
{
stepper.do_step( system );
st.do_step( system );
++real_step;
}
}
else if( less_with_sign( stepper.current_time() , end_time , stepper.current_time_step() ) )
else if( less_with_sign( st.current_time() , end_time , st.current_time_step() ) )
{ // do the last step ending exactly on the end point
stepper.initialize( stepper.current_state() , stepper.current_time() , end_time - stepper.current_time() );
stepper.do_step( system );
st.initialize( st.current_state() , st.current_time() , end_time - st.current_time() );
st.do_step( system );
++real_step;
}
@@ -146,7 +148,7 @@ size_t integrate_const(
// last observation, if we are still in observation interval
if( less_eq_with_sign( time , end_time , dt ) )
{
stepper.calc_state( time , start_state );
st.calc_state( time , start_state );
obs( start_state , time );
}

View File

@@ -46,13 +46,14 @@ Time integrate_n_steps(
Observer observer , stepper_tag )
{
typename odeint::unwrap_reference< Observer >::type &obs = observer;
typename odeint::unwrap_reference< Stepper >::type &st = stepper;
Time time = start_time;
for( size_t step = 0; step < num_of_steps ; ++step )
{
obs( start_state , time );
stepper.do_step( system , start_state , time , dt );
st.do_step( system , start_state , time , dt );
// direct computation of the time avoids error propagation happening when using time += dt
// we need clumsy type analysis to get boost units working here
time = start_time + static_cast< typename unit_value_type<Time>::type >( step+1 ) * dt;
@@ -98,19 +99,20 @@ Time integrate_n_steps(
Observer observer , dense_output_stepper_tag )
{
typename odeint::unwrap_reference< Observer >::type &obs = observer;
typename odeint::unwrap_reference< Stepper >::type &st = stepper;
Time time = start_time;
const Time end_time = start_time + static_cast< typename unit_value_type<Time>::type >(num_of_steps) * dt;
stepper.initialize( start_state , time , dt );
st.initialize( start_state , time , dt );
size_t step = 0;
while( step < num_of_steps )
{
while( less_with_sign( time , stepper.current_time() , stepper.current_time_step() ) )
while( less_with_sign( time , st.current_time() , st.current_time_step() ) )
{
stepper.calc_state( time , start_state );
st.calc_state( time , start_state );
obs( start_state , time );
++step;
// direct computation of the time avoids error propagation happening when using time += dt
@@ -119,30 +121,30 @@ Time integrate_n_steps(
}
// we have not reached the end, do another real step
if( less_with_sign( stepper.current_time()+stepper.current_time_step() ,
if( less_with_sign( st.current_time()+st.current_time_step() ,
end_time ,
stepper.current_time_step() ) )
st.current_time_step() ) )
{
stepper.do_step( system );
st.do_step( system );
}
else if( less_with_sign( stepper.current_time() , end_time , stepper.current_time_step() ) )
else if( less_with_sign( st.current_time() , end_time , st.current_time_step() ) )
{ // do the last step ending exactly on the end point
stepper.initialize( stepper.current_state() , stepper.current_time() , end_time - stepper.current_time() );
stepper.do_step( system );
st.initialize( st.current_state() , st.current_time() , end_time - st.current_time() );
st.do_step( system );
}
}
while( stepper.current_time() < end_time )
while( st.current_time() < end_time )
{
if( less_with_sign( end_time ,
stepper.current_time()+stepper.current_time_step() ,
stepper.current_time_step() ) )
stepper.initialize( stepper.current_state() , stepper.current_time() , end_time - stepper.current_time() );
stepper.do_step( system );
st.current_time()+st.current_time_step() ,
st.current_time_step() ) )
st.initialize( st.current_state() , st.current_time() , end_time - st.current_time() );
st.do_step( system );
}
// observation at end point, only if we ended exactly on the end-point (or above due to finite precision)
obs( stepper.current_state() , end_time );
obs( st.current_state() , end_time );
return time;
}

View File

@@ -44,6 +44,8 @@ size_t integrate_times(
)
{
typename odeint::unwrap_reference< Observer >::type &obs = observer;
typename odeint::unwrap_reference< Stepper >::type &st = stepper;
typedef typename unit_value_type<Time>::type time_type;
size_t steps = 0;
Time current_dt = dt;
@@ -53,10 +55,10 @@ size_t integrate_times(
obs( start_state , current_time );
if( start_time == end_time )
break;
while( less_with_sign( current_time , *start_time , current_dt ) )
while( less_with_sign( current_time , static_cast<time_type>(*start_time) , current_dt ) )
{
current_dt = min_abs( dt , *start_time - current_time );
stepper.do_step( system , start_state , current_time , current_dt );
st.do_step( system , start_state , current_time , current_dt );
current_time += current_dt;
steps++;
}
@@ -75,6 +77,8 @@ size_t integrate_times(
)
{
typename odeint::unwrap_reference< Observer >::type &obs = observer;
typename odeint::unwrap_reference< Stepper >::type &st = stepper;
typedef typename unit_value_type<Time>::type time_type;
const size_t max_attempts = 1000;
const char *error_string = "Integrate adaptive : Maximal number of iterations reached. A step size could not be found.";
@@ -86,16 +90,20 @@ size_t integrate_times(
obs( start_state , current_time );
if( start_time == end_time )
break;
while( less_with_sign( current_time , *start_time , dt ) )
while( less_with_sign( current_time , static_cast<time_type>(*start_time) , dt ) )
{
dt = min_abs( dt , *start_time - current_time );
if( stepper.try_step( system , start_state , current_time , dt ) == success )
// adjust stepsize to end up exactly at the observation point
double current_dt = min_abs( dt , *start_time - current_time );
if( st.try_step( system , start_state , current_time , current_dt ) == success )
{
++steps;
// continue with the original step size if dt was reduced due to observation
dt = max_abs( dt , current_dt );
}
else
{
++fail_steps;
dt = current_dt;
}
if( fail_steps == max_attempts ) throw std::overflow_error( error_string );
}
@@ -114,38 +122,39 @@ size_t integrate_times(
)
{
typename odeint::unwrap_reference< Observer >::type &obs = observer;
typename odeint::unwrap_reference< Stepper >::type &st = stepper;
typedef typename unit_value_type<Time>::type time_type;
if( start_time == end_time )
return 0;
Time last_time_point = *(end_time-1);
Time last_time_point = static_cast<time_type>(*(end_time-1));
stepper.initialize( start_state , *start_time , dt );
st.initialize( start_state , *start_time , dt );
obs( start_state , *start_time++ );
size_t count = 0;
while( start_time != end_time )
{
while( ( start_time != end_time ) && less_eq_with_sign( *start_time , stepper.current_time() , stepper.current_time_step() ) )
while( ( start_time != end_time ) && less_eq_with_sign( static_cast<time_type>(*start_time) , st.current_time() , st.current_time_step() ) )
{
stepper.calc_state( *start_time , start_state );
st.calc_state( *start_time , start_state );
obs( start_state , *start_time );
start_time++;
}
// we have not reached the end, do another real step
if( less_eq_with_sign( stepper.current_time() + stepper.current_time_step() ,
if( less_eq_with_sign( st.current_time() + st.current_time_step() ,
last_time_point ,
stepper.current_time_step() ) )
st.current_time_step() ) )
{
stepper.do_step( system );
st.do_step( system );
++count;
}
else if( start_time != end_time )
{ // do the last step ending exactly on the end point
stepper.initialize( stepper.current_state() , stepper.current_time() , last_time_point - stepper.current_time() );
stepper.do_step( system );
st.initialize( st.current_state() , st.current_time() , last_time_point - st.current_time() );
st.do_step( system );
++count;
}
}

View File

@@ -38,10 +38,11 @@ size_t integrate_adaptive(
Time start_time , Time end_time , Time dt ,
Observer observer )
{
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
return detail::integrate_adaptive(
stepper , system , start_state ,
start_time , end_time , dt ,
observer , typename Stepper::stepper_category() );
observer , stepper_category() );
/*
* Suggestion for a new extendable version:
@@ -61,10 +62,11 @@ size_t integrate_adaptive(
Time start_time , Time end_time , Time dt ,
Observer observer )
{
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
return detail::integrate_adaptive(
stepper , system , start_state ,
start_time , end_time , dt ,
observer , typename Stepper::stepper_category() );
observer , stepper_category() );
}

View File

@@ -44,19 +44,20 @@ size_t integrate_const(
Observer observer
)
{
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
// we want to get as fast as possible to the end
if( boost::is_same< null_observer , Observer >::value )
{
return detail::integrate_adaptive(
stepper , system , start_state ,
start_time , end_time , dt ,
observer , typename Stepper::stepper_category() );
observer , stepper_category() );
}
else
{
return detail::integrate_const( stepper , system , start_state ,
start_time , end_time , dt ,
observer , typename Stepper::stepper_category() );
observer , stepper_category() );
}
}
@@ -71,19 +72,20 @@ size_t integrate_const(
Observer observer
)
{
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
// we want to get as fast as possible to the end
if( boost::is_same< null_observer , Observer >::value )
{
return detail::integrate_adaptive(
stepper , system , start_state ,
start_time , end_time , dt ,
observer , typename Stepper::stepper_category() );
observer , stepper_category() );
}
else
{
return detail::integrate_const( stepper , system , start_state ,
start_time , end_time , dt ,
observer , typename Stepper::stepper_category() );
observer , stepper_category() );
}
}

View File

@@ -40,11 +40,11 @@ Time integrate_n_steps(
Time start_time , Time dt , size_t num_of_steps ,
Observer observer )
{
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
return detail::integrate_n_steps(
stepper , system , start_state ,
start_time , dt , num_of_steps ,
observer , typename Stepper::stepper_category() );
observer , stepper_category() );
}
/**
@@ -56,10 +56,11 @@ Time integrate_n_steps(
Time start_time , Time dt , size_t num_of_steps ,
Observer observer )
{
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
return detail::integrate_n_steps(
stepper , system , start_state ,
start_time , dt , num_of_steps ,
observer , typename Stepper::stepper_category() );
observer , stepper_category() );
}

View File

@@ -40,10 +40,11 @@ size_t integrate_times(
TimeIterator times_start , TimeIterator times_end , Time dt ,
Observer observer )
{
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
return detail::integrate_times(
stepper , system , start_state ,
times_start , times_end , dt ,
observer , typename Stepper::stepper_category() );
observer , stepper_category() );
}
/**
@@ -55,10 +56,11 @@ size_t integrate_times(
TimeIterator times_start , TimeIterator times_end , Time dt ,
Observer observer )
{
typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
return detail::integrate_times(
stepper , system , start_state ,
times_start , times_end , dt ,
observer , typename Stepper::stepper_category() );
observer , stepper_category() );
}
/**

View File

@@ -52,5 +52,6 @@ test-suite "odeint"
[ run same_size.cpp ]
[ run symplectic_steppers.cpp ]
[ compile algebra_dispatcher.cpp ]
[ run integrate_stepper_refs.cpp ]
: <testing.launcher>valgrind
;

View File

@@ -130,7 +130,7 @@ struct perform_integrate_adaptive_test
std::vector< value_type > times;
size_t steps = integrate_adaptive( Stepper() , *lorenz , x , 0.0 , t_end ,
size_t steps = integrate_adaptive( Stepper() , lorenz , x , 0.0 , t_end ,
dt , push_back_time( times , x_end ) );
// std::cout << t_end << " , " << steps << " , " << times.size() << " , " << 10.0+dt*steps << "=" << x_end[0] << std::endl;
@@ -161,8 +161,8 @@ struct perform_integrate_times_test
std::vector< double > times;
std::vector< double > obs_times( abs(n) );
for( int i=0 ; boost::numeric::odeint::detail::less_with_sign( i ,
static_cast<int>(obs_times.size()) ,
for( int i=0 ; boost::numeric::odeint::detail::less_with_sign( static_cast<double>(i) ,
static_cast<double>(obs_times.size()) ,
dt ) ; i+=dn )
{
obs_times[i] = i;

View File

@@ -0,0 +1,266 @@
/*
[auto_generated]
libs/numeric/odeint/test/integrate_stepper_refs.cpp
[begin_description]
Tests the integrate functions with boost::ref( stepper)
[end_description]
Copyright 2009-2013 Karsten Ahnert
Copyright 2009-2013 Mario Mulansky
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#define BOOST_TEST_MODULE odeint_integrate_stepper_refs
#include <vector>
#include <cmath>
#include <iostream>
#include <boost/numeric/odeint/config.hpp>
#include <boost/noncopyable.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/numeric/odeint/integrate/integrate_const.hpp>
#include <boost/numeric/odeint/integrate/integrate_adaptive.hpp>
#include <boost/numeric/odeint/integrate/integrate_times.hpp>
#include <boost/numeric/odeint/integrate/integrate_n_steps.hpp>
#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
using namespace boost::unit_test;
using namespace boost::numeric::odeint;
namespace mpl = boost::mpl;
typedef double value_type;
typedef std::vector< value_type > state_type;
// minimal non-copyable basic stepper
template<
class State
>
class simple_stepper_nc : boost::noncopyable
{
public :
typedef State state_type;
typedef double value_type;
typedef state_type deriv_type;
typedef double time_type;
typedef size_t order_type;
typedef stepper_tag stepper_category;
template< class System >
void do_step( System system , state_type &in , time_type t , time_type dt )
{
// empty
}
};
// minimal non-copyable controlled stepper
template<
class State
>
class controlled_stepper_nc : boost::noncopyable
{
public :
typedef State state_type;
typedef double value_type;
typedef state_type deriv_type;
typedef double time_type;
typedef size_t order_type;
typedef controlled_stepper_tag stepper_category;
template< class System >
controlled_step_result try_step( System system , state_type &in , time_type &t , time_type &dt )
{
t += dt;
return success;
}
};
// minimal non-copyable dense_output stepper
template<
class State
>
class dense_out_stepper_nc : boost::noncopyable
{
public :
typedef State state_type;
typedef double value_type;
typedef state_type deriv_type;
typedef double time_type;
typedef size_t order_type;
typedef dense_output_stepper_tag stepper_category;
void initialize( const state_type &x0 , const time_type t0 , const time_type dt0 )
{
m_x = x0;
m_t = t0;
m_dt = dt0;
std::cout << "initialize: " << m_t << " , " << m_dt << std::endl;
}
template< class System >
void do_step( System system )
{
std::cout << "dense out stepper: " << m_t << " , " << m_dt << std::endl;
m_t += m_dt;
}
void calc_state( const time_type t_inter , state_type &x )
{
x = m_x;
}
state_type current_state()
{ return m_x; }
time_type current_time()
{ return m_t; }
time_type current_time_step()
{ return m_dt; }
private :
time_type m_t;
time_type m_dt;
state_type m_x;
};
void lorenz( const state_type &x , state_type &dxdt , const value_type t )
{
//const value_type sigma( 10.0 );
const value_type R( 28.0 );
const value_type b( value_type( 8.0 ) / value_type( 3.0 ) );
// first component trivial
dxdt[0] = 1.0; //sigma * ( x[1] - x[0] );
dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
dxdt[2] = -b * x[2] + x[0] * x[1];
}
struct push_back_time
{
std::vector< double >& m_times;
state_type& m_x;
push_back_time( std::vector< double > &times , state_type &x )
: m_times( times ) , m_x( x ) { }
void operator()( const state_type &x , double t )
{
m_times.push_back( t );
boost::numeric::odeint::copy( x , m_x );
}
};
template< class Stepper >
struct perform_integrate_const_test
{
void operator()()
{
state_type x( 3 , 10.0 ) , x_end( 3 );
std::vector< value_type > times;
Stepper stepper;
integrate_const( boost::ref(stepper) , lorenz , x , 0.0 , 1.0 ,
0.1, push_back_time( times , x_end ) );
}
};
template< class Stepper >
struct perform_integrate_adaptive_test
{
void operator()()
{
state_type x( 3 , 10.0 ) , x_end( 3 );
std::vector< value_type > times;
Stepper stepper;
integrate_adaptive( boost::ref(stepper) , lorenz , x , 0.0 , 1.0 ,
0.1, push_back_time( times , x_end ) );
}
};
template< class Stepper >
struct perform_integrate_n_steps_test
{
void operator()()
{
state_type x( 3 , 10.0 ) , x_end( 3 );
std::vector< value_type > times;
Stepper stepper;
integrate_n_steps( boost::ref(stepper) , lorenz , x , 0.0 , 0.1 ,
10 , push_back_time( times , x_end ) );
}
};
template< class Stepper >
struct perform_integrate_times_test
{
void operator()()
{
state_type x( 3 , 10.0 ) , x_end( 3 );
std::vector< value_type > times;
Stepper stepper;
integrate_times( boost::ref(stepper) , lorenz , x ,
boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) , 0.1 ,
push_back_time( times , x_end ) );
}
};
class stepper_methods : public mpl::vector<
simple_stepper_nc< state_type > ,
controlled_stepper_nc< state_type >,
dense_out_stepper_nc< state_type > > { };
BOOST_AUTO_TEST_SUITE( integrate_stepper_refs )
BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_const_test_case , Stepper, stepper_methods )
{
perform_integrate_const_test< Stepper > tester;
tester();
}
BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_adaptive_test_case , Stepper, stepper_methods )
{
perform_integrate_adaptive_test< Stepper > tester;
tester();
}
BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_n_steps_test_case , Stepper, stepper_methods )
{
perform_integrate_n_steps_test< Stepper > tester;
tester();
}
BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_times_test_case , Stepper, stepper_methods )
{
perform_integrate_times_test< Stepper > tester;
tester();
}
BOOST_AUTO_TEST_SUITE_END()

View File

@@ -90,6 +90,8 @@ BOOST_AUTO_TEST_CASE( test_integrate_times )
BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
times.clear();
std::cout << "test dopri5 stepper" << std::endl;
// controlled stepper
integrate_times( controlled_runge_kutta< runge_kutta_dopri5< state_type > >() , lorenz , x ,
boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ,
@@ -100,6 +102,8 @@ BOOST_AUTO_TEST_CASE( test_integrate_times )
BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
times.clear();
std::cout << "test BS stepper" << std::endl;
//another controlled stepper
integrate_times( bulirsch_stoer< state_type >() , lorenz , x ,
boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ,
@@ -110,6 +114,7 @@ BOOST_AUTO_TEST_CASE( test_integrate_times )
BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
times.clear();
std::cout << "test dense_out stepper" << std::endl;
// dense output stepper
integrate_times( dense_output_runge_kutta< controlled_runge_kutta< runge_kutta_dopri5< state_type > > >() ,
@@ -121,6 +126,7 @@ BOOST_AUTO_TEST_CASE( test_integrate_times )
// check if observer was called at times 0,1,2,...
BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
std::cout << "test BS_do stepper" << std::endl;
integrate_times( bulirsch_stoer_dense_out< state_type >() , lorenz , x ,
boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ,