Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68910 - in sandbox/odeint/branches/karsten: . boost/numeric/odeint/stepper boost/numeric/odeint/stepper/base boost/numeric/odeint/stepper/detail libs/numeric/odeint/regression_test libs/numeric/odeint/test
From: karsten.ahnert_at_[hidden]
Date: 2011-02-15 08:49:35


Author: karsten
Date: 2011-02-15 08:49:34 EST (Tue, 15 Feb 2011)
New Revision: 68910
URL: http://svn.boost.org/trac/boost/changeset/68910

Log:
making explicit_stepper ready for boost.range
Text files modified:
   sandbox/odeint/branches/karsten/Jamroot | 6 +-
   sandbox/odeint/branches/karsten/TODO | 8 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp | 93 ++++++++++++++++++++++++------
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/symplectic_nystroem_stepper_base.hpp | 20 +++---
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/macros.hpp | 12 ++--
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/symplectic_euler.hpp | 10 ++-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp | 10 ++-
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/hamiltonian_steppers.cpp | 10 +-
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_with_ranges.cpp | 118 ++++++++++++++++++++++++++++++++++++---
   9 files changed, 221 insertions(+), 66 deletions(-)

Modified: sandbox/odeint/branches/karsten/Jamroot
==============================================================================
--- sandbox/odeint/branches/karsten/Jamroot (original)
+++ sandbox/odeint/branches/karsten/Jamroot 2011-02-15 08:49:34 EST (Tue, 15 Feb 2011)
@@ -27,11 +27,11 @@
 
 
 # ideas
-build-project libs/numeric/odeint/ideas/butcher ;
-build-project libs/numeric/odeint/ideas/generic_stepper ;
+# build-project libs/numeric/odeint/ideas/butcher ;
+# build-project libs/numeric/odeint/ideas/generic_stepper ;
 build-project libs/numeric/odeint/ideas/rosenbrock4 ;
 build-project libs/numeric/odeint/ideas/units ;
-build-project libs/numeric/odeint/ideas/algebra ;
+# build-project libs/numeric/odeint/ideas/algebra ;
 
 
 # docs:

Modified: sandbox/odeint/branches/karsten/TODO
==============================================================================
--- sandbox/odeint/branches/karsten/TODO (original)
+++ sandbox/odeint/branches/karsten/TODO 2011-02-15 08:49:34 EST (Tue, 15 Feb 2011)
@@ -16,9 +16,9 @@
   * check if rosenbrock controller and controlled_stepper can both be used with the explicit steppers
   OK * move error_checker into controlled_stepper
   * rename controlled_stepper to a more specific name
-* file cleanup
- * split resizing and copy/destruct/construct in different files
- * subfolder algebra, operations, util
+OK * file cleanup
+ OK * split resizing and copy/destruct/construct in different files
+ OK * subfolder algebra, operations, util
 * general:
   * check if everywhere static_cast< value_type > is used
   * check header guards
@@ -27,7 +27,7 @@
   * check once more, if all contructor, destructors and assign-operators are present
 * symplecit_stepper
   * find an appropriate name, (symplectic stroemer nystroem)
- * check is the coefficients are named good
+ OK * check is the coefficients are named good
 
 * Integrate functions
 * skript for setting the include defines according to the position in file system an writing a general copyright comment at the beginning

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp 2011-02-15 08:49:34 EST (Tue, 15 Feb 2011)
@@ -95,58 +95,86 @@
 
 
         /*
- * test if boost::range works
+ * Version 1 : do_step( sys , x , t , dt )
          *
- * is ok, but takes many implementations of do_step() with various const
+ * the two overloads are needed in order to solve the forwarding problem
          */
- // do_step( sys , x , t , dt )
         template< class System , class StateInOut >
         void do_step( System system , StateInOut &x , const time_type &t , const time_type &dt )
         {
- do_step_caller( system , x , t , dt );
+ do_step_caller_v1( system , x , t , dt );
         }
 
         template< class System , class StateInOut >
         void do_step( System system , const StateInOut &x , const time_type &t , const time_type &dt )
         {
- do_step_caller( system , x , t , dt );
+ do_step_caller_v1( system , x , t , dt );
         }
 
- template< class System , class StateInOut >
- void do_step_caller( System system , StateInOut &x , const time_type &t , const time_type &dt )
- {
- typename boost::unwrap_reference< System >::type &sys = system;
- m_size_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
- sys( x , m_dxdt ,t );
- this->stepper().do_step_impl( system , x , m_dxdt , t , x , dt );
- }
 
 
 
- // do_step( sys , x , dxdt , t , dt )
+
+
+
+
+ /*
+ * Version 2 : do_step( sys , x , dxdt , t , dt )
+ *
+ * the two overloads are needed in order to solve the forwarding problem
+ */
         template< class System , class StateInOut , class DerivIn >
         void do_step( System system , StateInOut &x , const DerivIn &dxdt , const time_type &t , const time_type &dt )
         {
                 this->stepper().do_step_impl( system , x , dxdt , t , x , dt );
         }
 
- // do_step( sys , in , t , out , dt )
+ template< class System , class StateInOut , class DerivIn >
+ void do_step( System system , const StateInOut &x , const DerivIn &dxdt , const time_type &t , const time_type &dt )
+ {
+ this->stepper().do_step_impl( system , x , dxdt , t , x , dt );
+ }
+
+
+
+
+ /*
+ * Version 3 : do_step( sys , in , t , out , dt )
+ *
+ * the two overloads are needed in order to solve the forwarding problem
+ */
         template< class System , class StateIn , class StateOut >
         void do_step( System system , const StateIn &in , const time_type &t , StateOut &out , const time_type &dt )
         {
- typename boost::unwrap_reference< System >::type &sys = system;
- m_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
- sys( in , m_dxdt ,t );
- this->stepper().do_step_impl( system , in , m_dxdt , t , out , dt );
+ do_step_caller_v3( system , in , t , out , dt );
+ }
+
+ template< class System , class StateIn , class StateOut >
+ void do_step( System system , const StateIn &in , const time_type &t , const StateOut &out , const time_type &dt )
+ {
+ do_step_caller_v3( system , in , t , out , dt );
         }
 
- // do_step( sys , in , dxdt , t , out , dt )
+
+
+ /*
+ * Version 4 : do_step( sys , in , dxdt , t , out , dt )
+ *
+ * the two overloads are needed in order to solve the forwarding problem
+ */
         template< class System , class StateIn , class DerivIn , class StateOut >
         void do_step( System system , const StateIn &in , const DerivIn &dxdt , const time_type &t , StateOut &out , const time_type &dt )
         {
                 this->stepper().do_step_impl( system , in , dxdt , t , out , dt );
         }
 
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step( System system , const StateIn &in , const DerivIn &dxdt , const time_type &t , const StateOut &out , const time_type &dt )
+ {
+ this->stepper().do_step_impl( system , in , dxdt , t , out , dt );
+ }
+
+
 
 
         template< class StateType >
@@ -156,6 +184,31 @@
         }
 
 
+private:
+
+ template< class System , class StateInOut >
+ void do_step_caller_v1( System system , StateInOut &x , const time_type &t , const time_type &dt )
+ {
+ typename boost::unwrap_reference< System >::type &sys = system;
+ m_size_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
+ sys( x , m_dxdt ,t );
+ this->stepper().do_step_impl( system , x , m_dxdt , t , x , dt );
+ }
+
+ // do_step_caller_v2 is not needed since it calls do_step_impl directly
+
+ template< class System , class StateIn , class StateOut >
+ void do_step_caller_v3( System system , const StateIn &in , const time_type &t , StateOut &out , const time_type &dt )
+ {
+ typename boost::unwrap_reference< System >::type &sys = system;
+ m_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
+ sys( in , m_dxdt ,t );
+ this->stepper().do_step_impl( system , in , m_dxdt , t , out , dt );
+ }
+
+ // do_step_caller_v4 is not needed since it calls do_step_impl directly
+
+
 protected:
 
     stepper_type& stepper( void )

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/symplectic_nystroem_stepper_base.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/symplectic_nystroem_stepper_base.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/symplectic_nystroem_stepper_base.hpp 2011-02-15 08:49:34 EST (Tue, 15 Feb 2011)
@@ -27,9 +27,11 @@
 template<
         size_t NumOfStages ,
         class Stepper ,
- class State ,
+ class Coor ,
+ class Momentum ,
         class Value ,
- class Deriv ,
+ class CoorDeriv ,
+ class MomentumDeriv ,
         class Time ,
         class Algebra ,
         class Operations ,
@@ -55,9 +57,13 @@
 public:
 
         const static size_t num_of_stages = NumOfStages;
- typedef State state_type;
+ typedef Coor coor_type;
+ typedef Momentum momentum_type;
+ typedef std::pair< coor_type , momentum_type > state_type;
+ typedef CoorDeriv coor_deriv_type;
+ typedef MomentumDeriv momentum_deriv_type;
+ typedef std::pair< coor_deriv_type , momentum_deriv_type > deriv_type;
         typedef Value value_type;
- typedef Deriv deriv_type;
         typedef Time time_type;
         typedef Algebra algebra_type;
         typedef Operations operations_type;
@@ -65,12 +71,6 @@
         typedef Stepper stepper_type;
         typedef stepper_tag stepper_category;
 
- typedef typename state_type::first_type coor_type;
- typedef typename state_type::second_type momentum_type;
-
- typedef typename deriv_type::first_type coor_deriv_type;
- typedef typename deriv_type::second_type momentum_deriv_type;
-
         typedef boost::array< value_type , num_of_stages > coef_type;
 
         symplectic_nystroem_stepper_base( const coef_type &coef_a , const coef_type &coef_b )

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/macros.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/macros.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/macros.hpp 2011-02-15 08:49:34 EST (Tue, 15 Feb 2011)
@@ -72,20 +72,20 @@
 #define BOOST_ODEINT_SYMPLECTIC_NYSTROEM_STEPPER_TYPEDEFS( STEPPER , STAGES ) \
         typedef symplectic_nystroem_stepper_base< \
                 STAGES , \
- STEPPER< State , Value , Deriv , Time , Algebra , Operations , AdjustSizePolicy > , \
- State , Value , Deriv , Time , Algebra , Operations , AdjustSizePolicy > stepper_base_type; \
+ STEPPER< Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , AdjustSizePolicy > , \
+ Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , AdjustSizePolicy > stepper_base_type; \
+ typedef typename stepper_base_type::coor_type coor_type; \
+ typedef typename stepper_base_type::momentum_type momentum_type; \
         typedef typename stepper_base_type::state_type state_type; \
         typedef typename stepper_base_type::value_type value_type; \
+ typedef typename stepper_base_type::coor_deriv_type coor_deriv_type; \
+ typedef typename stepper_base_type::momentum_deriv_type momentum_deriv_type; \
         typedef typename stepper_base_type::deriv_type deriv_type; \
         typedef typename stepper_base_type::time_type time_type; \
         typedef typename stepper_base_type::algebra_type algebra_type; \
         typedef typename stepper_base_type::operations_type operations_type; \
         typedef typename stepper_base_type::adjust_size_policy adjust_size_policy; \
         typedef typename stepper_base_type::stepper_type stepper_type; \
- typedef typename stepper_base_type::coor_type coor_type; \
- typedef typename stepper_base_type::momentum_type momentum_type; \
- typedef typename stepper_base_type::coor_deriv_type coor_deriv_type; \
- typedef typename stepper_base_type::momentum_deriv_type momentum_deriv_type; \
         typedef typename stepper_base_type::coef_type coef_type
 
 

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/symplectic_euler.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/symplectic_euler.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/symplectic_euler.hpp 2011-02-15 08:49:34 EST (Tue, 15 Feb 2011)
@@ -48,9 +48,11 @@
 
 
 template<
- class State ,
+ class Coor ,
+ class Momentum = Coor ,
         class Value = double ,
- class Deriv = State ,
+ class CoorDeriv = Coor ,
+ class MomentumDeriv = Coor ,
         class Time = Value ,
         class Algebra = range_algebra ,
         class Operations = default_operations ,
@@ -60,8 +62,8 @@
         public symplectic_nystroem_stepper_base
         <
                 1 ,
- symplectic_euler< State , Value , Deriv , Time , Algebra , Operations , AdjustSizePolicy > ,
- State , Value , Deriv , Time , Algebra , Operations , AdjustSizePolicy
+ symplectic_euler< Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , AdjustSizePolicy > ,
+ Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , AdjustSizePolicy
>
 {
 public:

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp 2011-02-15 08:49:34 EST (Tue, 15 Feb 2011)
@@ -76,9 +76,11 @@
 
 
 template<
- class State ,
+ class Coor ,
+ class Momentum = Coor ,
         class Value = double ,
- class Deriv = State ,
+ class CoorDeriv = Coor ,
+ class MomentumDeriv = Coor ,
         class Time = Value ,
         class Algebra = range_algebra ,
         class Operations = default_operations ,
@@ -88,8 +90,8 @@
         public symplectic_nystroem_stepper_base
         <
                 6 ,
- symplectic_euler< State , Value , Deriv , Time , Algebra , Operations , AdjustSizePolicy > ,
- State , Value , Deriv , Time , Algebra , Operations , AdjustSizePolicy
+ symplectic_euler< Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , AdjustSizePolicy > ,
+ Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , AdjustSizePolicy
>
 {
 public:

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/hamiltonian_steppers.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/hamiltonian_steppers.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/hamiltonian_steppers.cpp 2011-02-15 08:49:34 EST (Tue, 15 Feb 2011)
@@ -61,7 +61,7 @@
 
 void test_euler( void )
 {
- typedef boost::numeric::odeint::symplectic_euler< state_type > stepper_type;
+ typedef boost::numeric::odeint::symplectic_euler< container_type > stepper_type;
         stepper_type stepper;
         stepper_type stepper2( stepper );
         stepper_type stepper3;
@@ -80,7 +80,7 @@
 
 void test_rkn_sb3a_mclachlan( void )
 {
- typedef boost::numeric::odeint::symplectic_rkn_sb3a_mclachlan< state_type > stepper_type;
+ typedef boost::numeric::odeint::symplectic_rkn_sb3a_mclachlan< container_type > stepper_type;
         stepper_type stepper;
         stepper_type stepper2( stepper );
         stepper_type stepper3;
@@ -99,8 +99,8 @@
 
 void compare_euler_rkn( void )
 {
- typedef boost::numeric::odeint::symplectic_euler< state_type > stepper_type1;
- typedef boost::numeric::odeint::symplectic_rkn_sb3a_mclachlan< state_type > stepper_type2;
+ typedef boost::numeric::odeint::symplectic_euler< container_type > stepper_type1;
+ typedef boost::numeric::odeint::symplectic_rkn_sb3a_mclachlan< container_type > stepper_type2;
 
         stepper_type1 stepper1;
         stepper_type2 stepper2;
@@ -132,7 +132,7 @@
 void performance_compare( void )
 {
         typedef boost::numeric::odeint::hamiltonian_stepper_rk_qfunc< container_type > stepper_type1;
- typedef boost::numeric::odeint::symplectic_rkn_sb3a_mclachlan< state_type > stepper_type2;
+ typedef boost::numeric::odeint::symplectic_rkn_sb3a_mclachlan< container_type > stepper_type2;
 
         state_type state1;
         state1.first[0] = 1.0;

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_with_ranges.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_with_ranges.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_with_ranges.cpp 2011-02-15 08:49:34 EST (Tue, 15 Feb 2011)
@@ -32,23 +32,121 @@
                 dxdt[1] = 2.0;
                 dxdt[2] = 3.0;
         }
+
+ template< class State , class Deriv >
+ void operator()( const State &x_ , const Deriv &dxdt_ , double t )
+ {
+ typename boost::range_iterator< const State >::type x = boost::begin( x_ );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+
+ dxdt[0] = x[0];
+ dxdt[1] = 2.0;
+ dxdt[2] = 3.0;
+ }
+
+};
+
+struct vector_fixture
+{
+ const static size_t dim = 6;
+ std::vector< double > in , out , dxdt ;
+ boost::numeric::odeint::explicit_euler< state_type > euler;
+
+ vector_fixture( void )
+ : in( dim ) , out( dim ) , dxdt( dim )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ in[ i ] = double( i );
+ out[ i ] = double( i ) + 10.0 ;
+ dxdt[ i ] = double( i ) + 100.0 ;
+ }
+ }
+
+ ~vector_fixture( void )
+ {
+ }
 };
 
+#define CHECK_VALUES( x , x0 , x1 , x2 , x3 , x4 , x5 ) \
+ BOOST_CHECK_CLOSE( x[0] , x0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[1] , x1 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[2] , x2 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[3] , x3 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[4] , x4 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[5] , x5 , 1.0e-8 )
+
+#define CHECK_IN_DEFAULT( x ) \
+ BOOST_CHECK_CLOSE( x[0] , 0.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[1] , 1.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[2] , 2.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[3] , 3.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[4] , 4.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[5] , 5.0 , 1.0e-8 )
+
+#define CHECK_OUT_DEFAULT( x ) \
+ BOOST_CHECK_CLOSE( x[0] , 10.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[1] , 11.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[2] , 12.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[3] , 13.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[4] , 14.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[5] , 15.0 , 1.0e-8 )
+
+#define CHECK_DXDT_DEFAULT( x ) \
+ BOOST_CHECK_CLOSE( x[0] , 100.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[1] , 101.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[2] , 102.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[3] , 103.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[4] , 104.0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[5] , 105.0 , 1.0e-8 )
+
+
+
 BOOST_AUTO_TEST_SUITE( stepper_with_ranges )
 
-BOOST_AUTO_TEST_CASE( explicit_euler_with_range )
+BOOST_AUTO_TEST_CASE( explicit_euler_with_range_v1 )
 {
- std::vector< double > x( 3 * 2 );
- x[0] = 1.0;
- x[1] = 1.0;
- x[2] = 1.0;
- boost::numeric::odeint::explicit_euler< state_type > euler;
- euler.do_step( lorenz() , std::make_pair( x.begin() , x.begin() + 3 ) , 0.1 , 0.1 );
- BOOST_CHECK_CLOSE( x[0] , 1.1 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x[1] , 1.2 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x[2] , 1.3 , 1.0e-10 );
+ vector_fixture f;
+ f.euler.do_step( lorenz() , std::make_pair( f.in.begin() + 1 , f.in.begin() + 4 ) , 0.1 , 0.1 );
+ CHECK_VALUES( f.in , 0.0 , 1.1 , 2.2 , 3.3 , 4.0 , 5.0 );
+ CHECK_OUT_DEFAULT( f.out );
+ CHECK_DXDT_DEFAULT( f.dxdt );
+}
+
+BOOST_AUTO_TEST_CASE( explicit_euler_with_range_v2 )
+{
+ vector_fixture f;
+ lorenz()( std::make_pair( f.in.begin() , f.in.begin() + 3 ) ,
+ std::make_pair( f.dxdt.begin() + 3 , f.dxdt.begin() + 6 ) , 0.0 );
+ f.euler.do_step( lorenz() , std::make_pair( f.in.begin() , f.in.begin() + 3 ) ,
+ std::make_pair( f.dxdt.begin() + 3 , f.dxdt.begin() + 6 ) , 0.1 , 0.1 );
+ CHECK_VALUES( f.in , 0.0 , 1.2 , 2.3 , 3.0 , 4.0 , 5.0 );
+ CHECK_OUT_DEFAULT( f.out );
+ CHECK_VALUES( f.dxdt , 100.0 , 101.0 , 102.0 , 0.0 , 2.0 , 3.0 );
 }
 
+BOOST_AUTO_TEST_CASE( explicit_euler_with_range_v3 )
+{
+ vector_fixture f;
+ f.euler.do_step( lorenz() , std::make_pair( f.in.begin() + 2 , f.in.begin() + 5 ) , 0.1 ,
+ std::make_pair( f.out.begin() , f.out.begin() +3 ) , 0.1 );
+ CHECK_IN_DEFAULT( f.in );
+ CHECK_VALUES( f.out , 2.2 , 3.2 , 4.3 , 13.0 , 14.0 , 15.0 );
+ CHECK_DXDT_DEFAULT( f.dxdt );
+}
+
+BOOST_AUTO_TEST_CASE( explicit_euler_with_range_v4 )
+{
+ vector_fixture f;
+ f.euler.do_step( lorenz() , std::make_pair( f.in.begin() + 2 , f.in.begin() + 5 ) , 0.1 ,
+ std::make_pair( f.out.begin() , f.out.begin() +3 ) , 0.1 );
+ CHECK_IN_DEFAULT( f.in );
+ CHECK_VALUES( f.out , 2.2 , 3.2 , 4.3 , 13.0 , 14.0 , 15.0 );
+ CHECK_DXDT_DEFAULT( f.dxdt );
+}
+
+
+
 BOOST_AUTO_TEST_CASE( explicit_euler_with_array )
 {
         state_type2 x;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk