Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72381 - in sandbox/odeint/branches/karsten: boost/numeric/odeint/stepper boost/numeric/odeint/stepper/detail libs/numeric/odeint/test
From: mario.mulansky_at_[hidden]
Date: 2011-06-03 18:21:53


Author: mariomulansky
Date: 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
New Revision: 72381
URL: http://svn.boost.org/trac/boost/changeset/72381

Log:
added generic error stepper
construct/copy tests fail, some refactoring required to fix this.
Added:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp (contents, props changed)
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck_generic.hpp (contents, props changed)
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/generic_error_stepper.cpp (contents, props changed)
Text files modified:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp | 52 +++++++++++++++++++-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp | 76 ++++++++++++++++++++++++++++++
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_generic_rk.hpp | 52 +++++++++++++-------
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4_generic.hpp | 63 +++++++++++++++++++++---
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile | 1
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/generic_stepper.cpp | 42 +++++++++++-----
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp | 11 +++-
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_copying.cpp | 100 ++++++++++++++++++++++++++++++++++++++++
   8 files changed, 348 insertions(+), 49 deletions(-)

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -24,6 +24,12 @@
     {
         Algebra::for_each3( s1 , s2 , s3 , op );
     }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( S1 &s1 , S2 &s2 , S4 s4_array[0] , Op op ) const
+ {
+ Algebra::for_each2( s1 , s2 , op );
+ }
 };
 
 template< class Algebra >
@@ -34,6 +40,12 @@
     {
         Algebra::for_each4( s1 , s2 , s3 , s4_array[0] , op );
     }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( S1 &s1 , S2 &s2 , S4 s4_array[1] , Op op ) const
+ {
+ Algebra::for_each3( s1 , s2 , s4_array[0] , op );
+ }
 };
 
 
@@ -41,10 +53,16 @@
 struct generic_rk_call_algebra< 3 , Algebra >
 {
     template< class S1 , class S2 , class S3 , class S4 , class Op>
- void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[2] , Op op ) const
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[2] , Op op ) const
     {
         Algebra::for_each5( s1 , s2 , s3 , s4_array[0] , s4_array[1] , op );
     }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( S1 &s1 , S2 &s2 , S4 s4_array[2] , Op op ) const
+ {
+ Algebra::for_each4( s1 , s2 , s4_array[0] , s4_array[1] , op );
+ }
 };
 
 
@@ -52,10 +70,16 @@
 struct generic_rk_call_algebra< 4 , Algebra >
 {
     template< class S1 , class S2 , class S3 , class S4 , class Op>
- void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[3] , Op op ) const
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[3] , Op op ) const
     {
         Algebra::for_each6( s1 , s2 , s3 , s4_array[0] , s4_array[1] , s4_array[2] , op );
     }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( S1 &s1 , S2 &s2 , S4 s4_array[3] , Op op ) const
+ {
+ Algebra::for_each5( s1 , s2 , s4_array[0] , s4_array[1] , s4_array[2] , op );
+ }
 };
 
 
@@ -63,10 +87,32 @@
 struct generic_rk_call_algebra< 5 , Algebra >
 {
     template< class S1 , class S2 , class S3 , class S4 , class Op>
- void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[4] , Op op ) const
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[4] , Op op ) const
     {
         Algebra::for_each7( s1 , s2 , s3 , s4_array[0] , s4_array[1] , s4_array[2] , s4_array[3] , op );
     }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( S1 &s1 , S2 &s2 , S4 s4_array[4] , Op op ) const
+ {
+ Algebra::for_each6( s1 , s2 , s4_array[0] , s4_array[1] , s4_array[2] , s4_array[3] , op );
+ }
+};
+
+template< class Algebra >
+struct generic_rk_call_algebra< 6 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[5] , Op op ) const
+ {
+ Algebra::for_each8( s1 , s2 , s3 , s4_array[0] , s4_array[1] , s4_array[2] , s4_array[3] , s4_array[4] , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( S1 &s1 , S2 &s2 , S4 s4_array[5] , Op op ) const
+ {
+ Algebra::for_each7( s1 , s2 , s4_array[0] , s4_array[1] , s4_array[2] , s4_array[3] , s4_array[4] , op );
+ }
 };
 
 }

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -60,12 +60,86 @@
 struct generic_rk_scale_sum< 5 , Operations , Fac > : public Operations::template scale_sum6< Fac >
 {
     generic_rk_scale_sum( const boost::array<Fac,5> &a , const Fac &dt )
- : Operations::template scale_sum6< Fac >( 1.0 , a[0]*dt , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt )
+ : Operations::template scale_sum6< Fac >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt )
         { }
 
     typedef void result_type;
 };
 
+template< class Operations , class Fac >
+struct generic_rk_scale_sum< 6 , Operations , Fac > : public Operations::template scale_sum7< Fac >
+{
+ generic_rk_scale_sum( const boost::array<Fac,6> &a , const Fac &dt )
+ : Operations::template scale_sum7< Fac >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+// for error estimates
+template< size_t StageNumber , class Operations , class Fac >
+struct generic_rk_scale_sum_err;
+
+template< class Operations , class Fac >
+struct generic_rk_scale_sum_err< 1 , Operations , Fac > : public Operations::template scale_sum1< Fac >
+{
+ generic_rk_scale_sum_err( const boost::array<Fac,1> &a , const Fac &dt ) : Operations::template scale_sum1< Fac >( a[0]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+
+template< class Operations , class Fac >
+struct generic_rk_scale_sum_err< 2 , Operations , Fac > : public Operations::template scale_sum2< Fac >
+{
+ generic_rk_scale_sum_err( const boost::array<Fac,2> &a , const Fac &dt )
+ : Operations::template scale_sum2< Fac >( a[0]*dt , a[1]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+template< class Operations , class Fac >
+struct generic_rk_scale_sum_err< 3 , Operations , Fac > : public Operations::template scale_sum3< Fac >
+{
+ generic_rk_scale_sum_err( const boost::array<Fac,3> &a , const Fac &dt )
+ : Operations::template scale_sum3< Fac >( a[0]*dt , a[1]*dt , a[2]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+template< class Operations , class Fac >
+struct generic_rk_scale_sum_err< 4 , Operations , Fac > : public Operations::template scale_sum4< Fac >
+{
+ generic_rk_scale_sum_err( const boost::array<Fac,4> &a , const Fac &dt )
+ : Operations::template scale_sum4< Fac >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+template< class Operations , class Fac >
+struct generic_rk_scale_sum_err< 5 , Operations , Fac > : public Operations::template scale_sum5< Fac >
+{
+ generic_rk_scale_sum_err( const boost::array<Fac,5> &a , const Fac &dt )
+ : Operations::template scale_sum5< Fac >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+
+template< class Operations , class Fac >
+struct generic_rk_scale_sum_err< 6 , Operations , Fac > : public Operations::template scale_sum6< Fac >
+{
+ generic_rk_scale_sum_err( const boost::array<Fac,6> &a , const Fac &dt )
+ : Operations::template scale_sum6< Fac >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt )
+ { }
+
+ typedef void result_type;
+};
 
 }
 }

Added: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -0,0 +1,125 @@
+/*
+ * explicit_error_generic_rk.hpp
+ *
+ * Created on: Jun 3, 2011
+ * Author: mario
+ */
+
+#ifndef EXPLICIT_ERROR_GENERIC_RK_HPP_
+#define EXPLICIT_ERROR_GENERIC_RK_HPP_
+
+#include <boost/numeric/odeint/stepper/explicit_generic_rk.hpp>
+#include <boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp>
+
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp>
+#include <boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp>
+
+namespace mpl = boost::mpl;
+namespace fusion = boost::fusion;
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template<
+ size_t StageCount,
+ size_t Order,
+ size_t StepperOrder ,
+ size_t ErrorOrder ,
+ class State ,
+ class Value = double ,
+ class Deriv = State ,
+ class Time = Value ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
+ class AdjustSizePolicy = adjust_size_initially_tag
+ >
+class explicit_error_generic_rk
+: public explicit_stepper_and_error_stepper_base<
+ explicit_error_generic_rk< StageCount , Order , StepperOrder , ErrorOrder , State ,
+ Value , Deriv , Time , Algebra , Operations , AdjustSizePolicy > ,
+ Order , StepperOrder , ErrorOrder , State , Value , Deriv , Time , Algebra ,
+ Operations , AdjustSizePolicy >
+{
+
+public:
+
+ typedef explicit_stepper_and_error_stepper_base<
+ explicit_error_generic_rk< StageCount , Order , StepperOrder , ErrorOrder , State ,
+ Value , Deriv , Time , Algebra , Operations , AdjustSizePolicy > ,
+ Order , StepperOrder , ErrorOrder , State , Value , Deriv , Time , Algebra ,
+ Operations , AdjustSizePolicy > stepper_base_type;
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::value_type value_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 explicit_generic_rk< StageCount , Order , State , Value , Deriv ,
+ Time , Algebra , Operations , AdjustSizePolicy > generic_rk_stepper_type;
+
+ typedef typename generic_rk_stepper_type::coef_a_type coef_a_type;
+ typedef typename generic_rk_stepper_type::coef_b_type coef_b_type;
+ typedef typename generic_rk_stepper_type::coef_c_type coef_c_type;
+
+ static const size_t stage_count = StageCount;
+
+ // we use an explicit_generic_rk to do the normal rk step
+ // and add a separate calculation of the error estimate afterwards
+ explicit_error_generic_rk( const coef_a_type &a ,
+ const coef_b_type &b ,
+ const coef_b_type &b2 ,
+ const coef_c_type &c )
+ : m_rk_stepper( a , b , c ) , m_b2( b2 )
+ { }
+
+ explicit_error_generic_rk( const explicit_error_generic_rk &rk )
+ : m_rk_stepper( rk.m_rk_stepper ) , m_b2( rk.m_b2 )
+ { }
+
+ explicit_error_generic_rk& operator=( const explicit_error_generic_rk &rk )
+ {
+ //stepper_base_type::operator=( rk );
+ m_rk_stepper = rk.m_rk_stepper;
+ return *this;
+ }
+
+ template< class System , class StateIn , class DerivIn , class StateOut , class Err >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt ,
+ const time_type &t , StateOut &out , const time_type &dt , Err &xerr )
+ {
+ m_rk_stepper.do_step_impl( system , in , dxdt , t , out , dt );
+
+ // additionally perform the error calculation
+ detail::template generic_rk_call_algebra< StageCount , algebra_type >()( xerr , dxdt , m_rk_stepper.m_F ,
+ detail::generic_rk_scale_sum_err< StageCount , operations_type , time_type >( m_b2 , dt) );
+ }
+
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt ,
+ const time_type &t , StateOut &out , const time_type &dt )
+ {
+ m_rk_stepper.do_step_impl( system , in , dxdt , t , out , dt );
+ }
+
+private:
+
+ generic_rk_stepper_type m_rk_stepper;
+ const coef_b_type m_b2;
+
+};
+
+}
+}
+}
+
+
+#endif /* EXPLICIT_ERROR_GENERIC_RK_HPP_ */

Added: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck_generic.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck_generic.hpp 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -0,0 +1,163 @@
+/*
+ * explicit_error_rk54_ck_generic.hpp
+ *
+ * Created on: Jun 3, 2011
+ * Author: mario
+ */
+
+#include <boost/fusion/container.hpp>
+
+#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/array.hpp>
+
+
+namespace fusion = boost::fusion;
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template< class Value = double >
+struct rk54_ck_coefficients_a1 : boost::array< Value , 1 >
+{
+ rk54_ck_coefficients_a1( void )
+ {
+ (*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 5 );
+ }
+};
+
+template< class Value = double >
+struct rk54_ck_coefficients_a2 : boost::array< Value , 2 >
+{
+ rk54_ck_coefficients_a2( void )
+ {
+ (*this)[0] = static_cast<Value>( 3 )/static_cast<Value>( 40 );
+ (*this)[1] = static_cast<Value>( 9 )/static_cast<Value>( 40 );
+ }
+};
+
+
+template< class Value = double >
+struct rk54_ck_coefficients_a3 : boost::array< Value , 3 >
+{
+ rk54_ck_coefficients_a3( void )
+ {
+ (*this)[0] = static_cast<Value>( 3 )/static_cast<Value>( 10 );
+ (*this)[1] = static_cast<Value>( -9 )/static_cast<Value>( 10 );
+ (*this)[2] = static_cast<Value>( 6 )/static_cast<Value>( 5 );
+ }
+};
+
+template< class Value = double >
+struct rk54_ck_coefficients_a4 : boost::array< Value , 4 >
+{
+ rk54_ck_coefficients_a4( void )
+ {
+ (*this)[0] = static_cast<Value>( -11 )/static_cast<Value>( 54 );
+ (*this)[1] = static_cast<Value>( 5 )/static_cast<Value>( 2 );
+ (*this)[2] = static_cast<Value>( -70 )/static_cast<Value>( 27 );
+ (*this)[3] = static_cast<Value>( 35 )/static_cast<Value>( 27 );
+ }
+};
+
+template< class Value = double >
+struct rk54_ck_coefficients_a5 : boost::array< Value , 5 >
+{
+ rk54_ck_coefficients_a5( void )
+ {
+ (*this)[0] = static_cast<Value>( 1631 )/static_cast<Value>( 55296 );
+ (*this)[1] = static_cast<Value>( 175 )/static_cast<Value>( 512 );
+ (*this)[2] = static_cast<Value>( 575 )/static_cast<Value>( 13824 );
+ (*this)[3] = static_cast<Value>( 44275 )/static_cast<Value>( 110592 );
+ (*this)[4] = static_cast<Value>( 253 )/static_cast<Value>( 4096 );
+ }
+};
+
+template< class Value = double >
+struct rk54_ck_coefficients_b : boost::array< Value , 6 >
+{
+ rk54_ck_coefficients_b( void )
+ {
+ (*this)[0] = static_cast<Value>( 37 )/static_cast<Value>( 378 );
+ (*this)[1] = static_cast<Value>( 0 );
+ (*this)[2] = static_cast<Value>( 250 )/static_cast<Value>( 621 );
+ (*this)[3] = static_cast<Value>( 125 )/static_cast<Value>( 594 );
+ (*this)[4] = static_cast<Value>( 0 );
+ (*this)[5] = static_cast<Value>( 512 )/static_cast<Value>( 1771 );
+ }
+};
+
+template< class Value = double >
+struct rk54_ck_coefficients_db : boost::array< Value , 6 >
+{
+ rk54_ck_coefficients_db( void )
+ {
+ (*this)[0] = static_cast<Value>( 37 )/static_cast<Value>( 378 ) - static_cast<Value>( 2825 )/static_cast<Value>( 27648 );
+ (*this)[1] = static_cast<Value>( 0 );
+ (*this)[2] = static_cast<Value>( 250 )/static_cast<Value>( 621 ) - static_cast<Value>( 18575 )/static_cast<Value>( 48384 );
+ (*this)[3] = static_cast<Value>( 125 )/static_cast<Value>( 594 ) - static_cast<Value>( 13525 )/static_cast<Value>( 55296 );
+ (*this)[4] = static_cast<Value>( -277 )/static_cast<Value>( 14336 );
+ (*this)[5] = static_cast<Value>( 512 )/static_cast<Value>( 1771 ) - static_cast<Value>( 1 )/static_cast<Value>( 4 );
+ }
+};
+
+
+template< class Value = double >
+struct rk54_ck_coefficients_c : boost::array< Value , 6 >
+{
+ rk54_ck_coefficients_c( void )
+ {
+ (*this)[0] = static_cast<Value>(0);
+ (*this)[1] = static_cast<Value>( 1 )/static_cast<Value>( 5 );
+ (*this)[2] = static_cast<Value>( 3 )/static_cast<Value>( 10 );
+ (*this)[3] = static_cast<Value>( 3 )/static_cast<Value>( 5 );
+ (*this)[4] = static_cast<Value>( 3 )/static_cast<Value>( 5 );
+ (*this)[4] = static_cast<Value>( 1 );
+ (*this)[4] = static_cast<Value>( 7 )/static_cast<Value>( 8 );
+ }
+};
+
+template<
+ class State ,
+ class Value = double ,
+ class Deriv = State ,
+ class Time = Value ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
+ class AdjustSizePolicy = adjust_size_initially_tag
+ >
+class explicit_error_rk54_ck_generic : public explicit_error_generic_rk< 6 , 5 , 5 , 4 ,
+ State , Value , Deriv , Time , Algebra , Operations , AdjustSizePolicy >
+{
+
+public:
+
+ typedef explicit_error_generic_rk< 6 , 5 , 5 , 4 , State , Value , Deriv , Value ,
+ Algebra , Operations , AdjustSizePolicy > stepper_base_type;
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::value_type value_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;
+
+ explicit_error_rk54_ck_generic( void ) : stepper_base_type(
+ fusion::make_vector( rk54_ck_coefficients_a1<Value>() ,
+ rk54_ck_coefficients_a2<Value>() ,
+ rk54_ck_coefficients_a3<Value>() ,
+ rk54_ck_coefficients_a4<Value>() ,
+ rk54_ck_coefficients_a5<Value>() ) ,
+ rk54_ck_coefficients_b<Value>() , rk54_ck_coefficients_db<Value>() , rk54_ck_coefficients_c<Value>() )
+ { }
+};
+
+}
+}
+}

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_generic_rk.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_generic_rk.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_generic_rk.hpp 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -31,6 +31,7 @@
 #include <boost/numeric/odeint/algebra/default_operations.hpp>
 #include <boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp>
 #include <boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp>
+
 //#include "fusion_foreach_performance.hpp"
 
 #include <iostream>
@@ -38,11 +39,30 @@
 namespace mpl = boost::mpl;
 namespace fusion = boost::fusion;
 
+//forward declarations
+namespace boost { namespace numeric { namespace odeint {
+template<
+ size_t StageCount,
+ size_t Order,
+ class State ,
+ class Value = double ,
+ class Deriv = State ,
+ class Time = Value ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
+ class AdjustSizePolicy = adjust_size_initially_tag
+ >
+class explicit_generic_rk;
+struct stage_vector;
+} } }
+
+#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp>
 
 namespace boost {
 namespace numeric {
 namespace odeint {
 
+
 template< class T , class Constant >
 struct array_wrapper
 {
@@ -63,20 +83,6 @@
     typedef stage< T , Constant::value > type;
 };
 
-template<
- size_t StageCount,
- size_t Order,
- class State ,
- class Value = double ,
- class Deriv = State ,
- class Time = Value ,
- class Algebra = range_algebra ,
- class Operations = default_operations ,
- class AdjustSizePolicy = adjust_size_initially_tag
- >
-class explicit_generic_rk;
-
-struct stage_vector;
 
 template<
     size_t StageCount,
@@ -141,7 +147,7 @@
             mpl::inserter
             <
                 mpl::vector0< > ,
- mpl::push_back< mpl::_1 , array_wrapper< double , mpl::_2 > >
+ mpl::push_back< mpl::_1 , array_wrapper< Value , mpl::_2 > >
>
>::type
>::type coef_a_type;
@@ -259,7 +265,7 @@
         const double t;
         const double dt;
 
- calculate_stage( System &_system , const StateIn &_x , const DerivIn &_dxdt , StateOut &_out ,
+ calculate_stage( System &_system , const StateIn &_x , const DerivIn &_dxdt , StateOut &_out ,
                         state_type &_x_tmp , state_type *_F , const time_type &_t , const time_type &_dt )
         : system( _system ) , x( _x ) , x_tmp( _x_tmp ) , x_out( _out) , dxdt( _dxdt ) , F( _F ) , t( _t ) , dt( _dt )
         {}
@@ -355,13 +361,17 @@
 
 
     template< class System , class StateIn , class DerivIn , class StateOut >
- void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , const time_type &t , StateOut &out , const time_type &dt )
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt ,
+ const time_type &t , StateOut &out , const time_type &dt )
         {
+ typedef typename boost::unwrap_reference< System >::type unwrapped_system_type;
+ unwrapped_system_type &sys = system;
+
         m_deriv_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
         m_state_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
 
- fusion::for_each( m_stages , calculate_stage< System , StateIn , DerivIn , StateOut >
- ( system , in , dxdt , out , m_x_tmp , m_F , t , dt ) );
+ fusion::for_each( m_stages , calculate_stage< unwrapped_system_type , StateIn , DerivIn , StateOut >
+ ( sys , in , dxdt , out , m_x_tmp , m_F , t , dt ) );
     }
 
     template< class StateType >
@@ -374,6 +384,10 @@
 
     friend std::ostream& operator << <>( std::ostream &os , const explicit_generic_rk &rk );
 
+ template< size_t , size_t , size_t , size_t ,
+ typename , typename , typename , typename, typename , typename, typename >
+ friend class explicit_error_generic_rk;
+
 private:
 
     const stage_vector m_stages;

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4_generic.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4_generic.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4_generic.hpp 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -24,16 +24,61 @@
 namespace numeric {
 namespace odeint {
 
-namespace constants_generic {
+template< class Value = double >
+struct rk4_coefficients_a1 : boost::array< Value , 1 >
+{
+ rk4_coefficients_a1( void )
+ {
+ (*this)[0] = static_cast< Value >( 0.5 );
+ }
+};
 
- const boost::array< double , 1 > rk4_a1 = {{ 0.5 }};
- const boost::array< double , 2 > rk4_a2 = {{ 0.0 , 0.5 }};
- const boost::array< double , 3 > rk4_a3 = {{ 0.0 , 0.0 , 1.0 }};
+template< class Value = double >
+struct rk4_coefficients_a2 : boost::array< Value , 2 >
+{
+ rk4_coefficients_a2( void )
+ {
+ (*this)[0] = static_cast<Value>(0.0);
+ (*this)[1] = static_cast<Value>(0.5);
+ }
+};
 
- const boost::array< double , 4 > rk4_b = {{ 1.0/6 , 1.0/3 , 1.0/3 , 1.0/6 }};
- const boost::array< double , 4 > rk4_c = {{ 0.0 , 0.5 , 0.5 , 1.0 }};
 
-}
+template< class Value = double >
+struct rk4_coefficients_a3 : boost::array< Value , 3 >
+{
+ rk4_coefficients_a3( void )
+ {
+ (*this)[0] = static_cast<Value>(0.0);
+ (*this)[1] = static_cast<Value>(0.0);
+ (*this)[2] = static_cast<Value>(1.0);
+ }
+};
+
+template< class Value = double >
+struct rk4_coefficients_b : boost::array< Value , 4 >
+{
+ rk4_coefficients_b( void )
+ {
+ (*this)[0] = static_cast<Value>(1.0)/static_cast<Value>(6.0);
+ (*this)[1] = static_cast<Value>(1.0)/static_cast<Value>(3.0);
+ (*this)[2] = static_cast<Value>(1.0)/static_cast<Value>(3.0);
+ (*this)[3] = static_cast<Value>(1.0)/static_cast<Value>(6.0);
+ }
+};
+
+template< class Value = double >
+struct rk4_coefficients_c : boost::array< Value , 4 >
+{
+ rk4_coefficients_c( void )
+ {
+ (*this)[0] = static_cast<Value>(0.0);
+ (*this)[1] = static_cast<Value>(0.5);
+ (*this)[2] = static_cast<Value>(0.5);
+ (*this)[3] = static_cast<Value>(1.0);
+ }
+};
+
 
 template<
     class State ,
@@ -63,8 +108,8 @@
     typedef typename stepper_base_type::stepper_type stepper_type;
 
     explicit_rk4_generic( void ) : stepper_base_type(
- fusion::make_vector( constants_generic::rk4_a1 , constants_generic::rk4_a2 , constants_generic::rk4_a3 ) ,
- constants_generic::rk4_b , constants_generic::rk4_c )
+ fusion::make_vector( rk4_coefficients_a1<Value>() , rk4_coefficients_a2<Value>() , rk4_coefficients_a3<Value>() ) ,
+ rk4_coefficients_b<Value>() , rk4_coefficients_c<Value>() )
     { }
 
 };

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -32,5 +32,6 @@
          [ run adams_moulton.cpp ]
          [ run adams_bashforth_moulton.cpp ]
          [ run generic_stepper.cpp ]
+ [ run generic_error_stepper.cpp ]
         : <testing.launcher>valgrind
         ;

Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/generic_error_stepper.cpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/generic_error_stepper.cpp 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -0,0 +1,98 @@
+/* Boost generic_error_stepper.cpp test file
+
+ Copyright 2011 Karsten Ahnert
+ Copyright 2011 Mario Mulansky
+
+ This file tests the use of the generic error stepper
+
+ 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_generic_error_stepper
+
+#include <iostream>
+#include <utility>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_rk54_ck_generic.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp>
+
+#include <boost/array.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+typedef double value_type;
+typedef boost::array< value_type , 2 > state_type;
+
+void sys( const state_type &x , state_type &dxdt , const value_type &t )
+{
+ dxdt[ 0 ] = x[ 0 ] + 2 * x[ 1 ];
+ dxdt[ 1 ] = x[ 1 ];
+}
+
+typedef explicit_error_generic_rk< 6 , 5 , 4 , 5 , state_type> error_rk_generic_type;
+
+const boost::array< double , 1 > a1 = {{ 0.2 }};
+const boost::array< double , 2 > a2 = {{ 3.0/40.0 , 9.0/40 }};
+const boost::array< double , 3 > a3 = {{ 0.3 , -0.9 , 1.2 }};
+const boost::array< double , 4 > a4 = {{ -11.0/54.0 , 2.5 , -70.0/27.0 , 35.0/27.0 }};
+const boost::array< double , 5 > a5 = {{ 1631.0/55296.0 , 175.0/512.0 , 575.0/13824.0 , 44275.0/110592.0 , 253.0/4096.0 }};
+
+const error_rk_generic_type::coef_a_type a = fusion::make_vector( a1 , a2 , a3 , a4 , a5 );
+const error_rk_generic_type::coef_b_type b = {{ 37.0/378.0 , 0.0 , 250.0/621.0 , 125.0/594.0 , 0.0 , 512.0/1771.0 }};
+const error_rk_generic_type::coef_b_type b2 = {{ b[0]-2825.0/27648.0 , b[1]-0.0 , b[2]-18575.0/48384.0 , b[3]-13525.0/55296.0 , b[4]-277.0/14336.0 , b[5]-0.25 }};
+const error_rk_generic_type::coef_c_type c = {{ 0.0 , 0.2 , 0.3 , 0.6 , 1.0 , 7.0/8 }};
+
+typedef explicit_error_rk54_ck_generic< state_type > error_rk54_ck_generic_type;
+typedef explicit_error_rk54_ck< state_type > rk54_ck_type;
+
+BOOST_AUTO_TEST_SUITE( generic_error_stepper_test )
+
+BOOST_AUTO_TEST_CASE( test_generic_error_stepper )
+{
+ //simultaneously test copying
+ error_rk_generic_type rk_generic_( a , b , b2 , c );
+ error_rk_generic_type rk_generic = rk_generic_;
+
+ error_rk54_ck_generic_type rk54_ck_generic_;
+ error_rk54_ck_generic_type rk54_ck_generic = rk54_ck_generic_;
+
+ //std::cout << stepper;
+
+ rk54_ck_type rk54_ck_;
+ rk54_ck_type rk54_ck = rk54_ck_;
+
+ typedef error_rk_generic_type::state_type state_type;
+ typedef error_rk_generic_type::value_type stepper_value_type;
+ typedef error_rk_generic_type::deriv_type deriv_type;
+ typedef error_rk_generic_type::time_type time_type;
+
+ state_type x = {{ 0.0 , 1.0 }};
+ state_type y = x;
+ state_type z = x;
+ state_type x_err , y_err , z_err;
+
+ rk_generic.do_step( sys , x , 0.0 , 0.1 , x_err );
+
+ rk54_ck_generic.do_step( sys , y , 0.0 , 0.1 , y_err);
+
+ rk54_ck.do_step( sys , z , 0.0 , 0.1 , z_err );
+
+ BOOST_CHECK_NE( 0.0 , x[0] );
+ BOOST_CHECK_NE( 1.0 , x[1] );
+ BOOST_CHECK_NE( 0.0 , x_err[0] );
+ BOOST_CHECK_NE( 0.0 , x_err[1] );
+ // compare with analytic solution of above system
+ BOOST_CHECK_EQUAL( x[0] , y[0] );
+ BOOST_CHECK_EQUAL( x[1] , y[1] );
+ BOOST_CHECK_EQUAL( x[0] , z[0] );
+ BOOST_CHECK_EQUAL( x[1] , z[1] );
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/generic_stepper.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/generic_stepper.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/generic_stepper.cpp 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -18,6 +18,7 @@
 #include <boost/test/unit_test.hpp>
 
 #include <boost/numeric/odeint/stepper/explicit_generic_rk.hpp>
+#include <boost/numeric/odeint/stepper/explicit_rk4_generic.hpp>
 #include <boost/numeric/odeint/stepper/explicit_rk4.hpp>
 
 #include <boost/array.hpp>
@@ -34,44 +35,57 @@
     dxdt[ 1 ] = x[ 1 ];
 }
 
-typedef explicit_generic_rk< 4 , 4 , state_type> stepper_type;
+typedef explicit_generic_rk< 4 , 4 , state_type> rk_generic_type;
+typedef explicit_rk4_generic< state_type > rk4_generic_type;
 
 const boost::array< double , 1 > a1 = {{ 0.5 }};
 const boost::array< double , 2 > a2 = {{ 0.0 , 0.5 }};
 const boost::array< double , 3 > a3 = {{ 0.0 , 0.0 , 1.0 }};
 
-const stepper_type::coef_a_type a = fusion::make_vector( a1 , a2 , a3 );
-const stepper_type::coef_b_type b = {{ 1.0/6 , 1.0/3 , 1.0/3 , 1.0/6 }};
-const stepper_type::coef_c_type c = {{ 0.0 , 0.5 , 0.5 , 1.0 }};
+const rk_generic_type::coef_a_type a = fusion::make_vector( a1 , a2 , a3 );
+const rk_generic_type::coef_b_type b = {{ 1.0/6 , 1.0/3 , 1.0/3 , 1.0/6 }};
+const rk_generic_type::coef_c_type c = {{ 0.0 , 0.5 , 0.5 , 1.0 }};
 
-typedef explicit_rk4< state_type > rk4_stepper_type;
+typedef explicit_rk4< state_type > rk4_type;
 
 BOOST_AUTO_TEST_SUITE( generic_stepper_test )
 
 BOOST_AUTO_TEST_CASE( test_generic_stepper )
 {
- stepper_type stepper_( a , b , c );
- stepper_type stepper = stepper_;
+ //simultaneously test copying
+ rk_generic_type rk_generic_( a , b , c );
+ rk_generic_type rk_generic = rk_generic_;
+
+ rk4_generic_type rk4_generic_;
+ rk4_generic_type rk4_generic = rk4_generic_;
 
         //std::cout << stepper;
 
- rk4_stepper_type rk4;
+ rk4_type rk4_;
+ rk4_type rk4 = rk4_;
 
- typedef stepper_type::state_type state_type;
- typedef stepper_type::value_type stepper_value_type;
- typedef stepper_type::deriv_type deriv_type;
- typedef stepper_type::time_type time_type;
+ typedef rk_generic_type::state_type state_type;
+ typedef rk_generic_type::value_type stepper_value_type;
+ typedef rk_generic_type::deriv_type deriv_type;
+ typedef rk_generic_type::time_type time_type;
 
         state_type x = {{ 0.0 , 1.0 }};
         state_type y = x;
+ state_type z = x;
+
+ rk_generic.do_step( sys , x , 0.0 , 0.1 );
         
- stepper.do_step( sys , x , 0.0 , 0.1 );
+ rk4_generic.do_step( sys , y , 0.0 , 0.1 );
 
- rk4.do_step( sys , y , 0.0 , 0.1 );
+ rk4.do_step( sys , z , 0.0 , 0.1 );
 
+ BOOST_CHECK_NE( 0.0 , x[0] );
+ BOOST_CHECK_NE( 1.0 , x[1] );
         // compare with analytic solution of above system
         BOOST_CHECK_EQUAL( x[0] , y[0] );
         BOOST_CHECK_EQUAL( x[1] , y[1] );
+ BOOST_CHECK_EQUAL( x[0] , z[0] );
+ BOOST_CHECK_EQUAL( x[1] , z[1] );
 
 }
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -6,7 +6,7 @@
  This file tests the use of the all different steppers with several state types:
  std::vector< double >
  vector_space_1d< double > (see vector_space_1d.hpp)
- std::tr1::array< double , 1 >
+ boost::array< double , 1 >
 
  Distributed under the Boost Software License, Version 1.0.
  (See accompanying file LICENSE_1_0.txt or
@@ -19,7 +19,7 @@
 #include <cmath>
 #include <iostream>
 
-#include <tr1/array>
+#include <boost/array.hpp>
 
 #include <boost/test/unit_test.hpp>
 
@@ -38,7 +38,9 @@
 
 #include <boost/numeric/odeint/stepper/explicit_euler.hpp>
 #include <boost/numeric/odeint/stepper/explicit_rk4.hpp>
+#include <boost/numeric/odeint/stepper/explicit_rk4_generic.hpp>
 #include <boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_rk54_ck_generic.hpp>
 #include <boost/numeric/odeint/stepper/explicit_error_dopri5.hpp>
 #include <boost/numeric/odeint/stepper/controlled_error_stepper.hpp>
 #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
@@ -55,7 +57,7 @@
 
 typedef std::vector< double > vector_type;
 typedef vector_space_1d< double > vector_space_type;
-typedef std::tr1::array< double , 1 > array_type;
+typedef boost::array< double , 1 > array_type;
 
 
 const double result = 2.2;
@@ -183,7 +185,9 @@
 template< class State > class stepper_methods : public mpl::vector<
         explicit_euler< State , double , State , double , typename algebra_dispatcher< State >::type > ,
         explicit_rk4< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ explicit_rk4_generic< State , double , State , double , typename algebra_dispatcher< State >::type > ,
         explicit_error_rk54_ck< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ explicit_error_rk54_ck_generic< State , double , State , double , typename algebra_dispatcher< State >::type > ,
         explicit_error_dopri5< State , double , State , double , typename algebra_dispatcher< State >::type >
> { };
 
@@ -280,6 +284,7 @@
 
 template< class State > class error_stepper_methods : public mpl::vector<
         explicit_error_rk54_ck< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ explicit_error_rk54_ck_generic< State , double , State , double , typename algebra_dispatcher< State >::type > ,
         explicit_error_dopri5< State , double , State , double , typename algebra_dispatcher< State >::type >
> { };
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_copying.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_copying.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_copying.cpp 2011-06-03 18:21:51 EDT (Fri, 03 Jun 2011)
@@ -18,6 +18,7 @@
 #include <boost/numeric/odeint/stepper/explicit_rk4.hpp>
 #include <boost/numeric/odeint/stepper/explicit_rk4_generic.hpp>
 #include <boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_rk54_ck_generic.hpp>
 #include <boost/numeric/odeint/stepper/explicit_error_dopri5.hpp>
 #include <boost/numeric/odeint/stepper/controlled_error_stepper.hpp>
 #include <boost/numeric/odeint/stepper/dense_output_explicit.hpp>
@@ -170,8 +171,10 @@
 typedef boost::numeric::odeint::explicit_rk4< state_type , double , deriv_type > rk4_type;
 typedef boost::numeric::odeint::explicit_rk4_generic< state_type , double , deriv_type > rk4_generic_type;
 typedef boost::numeric::odeint::explicit_error_rk54_ck< state_type , double , deriv_type > rk54_type;
+typedef boost::numeric::odeint::explicit_error_rk54_ck_generic< state_type , double , deriv_type > rk54_generic_type;
 typedef boost::numeric::odeint::explicit_error_dopri5< state_type , double , deriv_type > dopri5_type;
 typedef boost::numeric::odeint::controlled_error_stepper< rk54_type > controlled_rk54_type;
+typedef boost::numeric::odeint::controlled_error_stepper< rk54_generic_type > controlled_rk54_generic_type;
 typedef boost::numeric::odeint::controlled_error_stepper< dopri5_type > controlled_dopri5_type;
 typedef boost::numeric::odeint::dense_output_explicit< euler_type > dense_output_euler_type;
 typedef boost::numeric::odeint::dense_output_controlled_explicit_fsal< controlled_dopri5_type > dense_output_dopri5_type;
@@ -446,6 +449,103 @@
 }
 
 
+
+/*
+ * Construct + Destruct
+ * 2 explicit_rk54_ck_generic:
+ * 2 * 1 deriv_type in explicit_error_stepper_base
+ * 2 * 5 deriv_type in explicit_error_rk54_ck_generic
+ * 2 * 1 state_type in explicit_error_rk4_generic
+ * 1 controlled_stepper:
+ * 1 deriv_type
+ * 2 state_type
+ *
+ * Copying
+ * 1 copy process of explicit_rk54_ck_generic:
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck_generic
+ * 1 state_type from explicit_error_rk54_ck_generic
+ */
+BOOST_AUTO_TEST_CASE( controlled_rk54_generic_construct )
+{
+ reset_counter();
+ {
+ controlled_rk54_generic_type stepper;
+ }
+ CHECK_COUNTERS( 4 , 13 , 4 , 13 , 1 , 6 );
+}
+
+
+/*
+ * Construct + Destruct
+ * 3 explicit_rk54_ck_generic:
+ * 3 * 1 deriv_type in explicit_error_stepper_base
+ * 3 * 5 deriv_type in explicit_error_rk54_ck_generic
+ * 3 * 1 state_type in explicit_error_rk4_generic
+ * 2 controlled_stepper:
+ * 2 * 1 deriv_type
+ * 2 * 2 state_type
+ *
+ * Copying
+ * 1 copy process of explicit_rk54_ck_generic:
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck_generic
+ * 1 state_type from explicit_error_rk54_ck_generic
+ *
+ * 1 process of copying controlled_error_stepper
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck_generic
+ * 1 state_type from explicit_error_rk54_ck_generic
+ * 1 deriv_type from controlled_error_stepper
+ * 2 state_type from controlled_error_stepper
+ */
+BOOST_AUTO_TEST_CASE( controlled_rk54_generic_copy_construct )
+{
+ reset_counter();
+ {
+ controlled_rk54_generic_type stepper;
+ controlled_rk54_generic_type stepper2( stepper );
+ }
+ CHECK_COUNTERS( 7 , 20 , 7 , 20 , 4 , 13 );
+}
+
+/*
+ * Construct + Destruct
+ * 4 explicit_rk54_ck_generic:
+ * 4 * 1 deriv_type in explicit_error_stepper_base
+ * 4 * 5 deriv_type in explicit_error_rk54_ck_generic
+ * 4 * 1 state_type in explicit_error_rk4_generic
+ * 2 controlled_stepper:
+ * 2 * 1 deriv_type
+ * 2 * 2 state_type
+ *
+ * Copying
+ * 2 copy process of explicit_rk54_ck_generic:
+ * 2 * 1 deriv_type from explicit_error_stepper_base
+ * 2 * 5 deriv_type from explicit_error_rk54_ck_generic
+ * 2 * 1 state_type from explicit_error_rk54_ck_generic
+ *
+ * 1 process of copying controlled_error_stepper
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck_generic
+ * 1 state_type from explicit_error_rk54_ck_generic
+ * 1 deriv_type from controlled_error_stepper
+ * 2 state_type from controlled_error_stepper
+ */
+BOOST_AUTO_TEST_CASE( controlled_rk54_generic_assign )
+{
+ reset_counter();
+ {
+ controlled_rk54_generic_type stepper;
+ controlled_rk54_generic_type stepper2;
+ stepper2 = stepper;
+ }
+ CHECK_COUNTERS( 8 , 26 , 8 , 26 , 5 , 19 );
+}
+
+
+
+
 BOOST_AUTO_TEST_CASE( controlled_dopri5_construct )
 {
         reset_counter();


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