Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62508 - sandbox/odeint/boost/numeric/odeint
From: mario.mulansky_at_[hidden]
Date: 2010-06-07 08:50:07


Author: mariomulansky
Date: 2010-06-07 08:50:05 EDT (Mon, 07 Jun 2010)
New Revision: 62508
URL: http://svn.boost.org/trac/boost/changeset/62508

Log:
added state_type
Binary files modified:
   sandbox/odeint/boost/numeric/odeint/stepper_rk5_ck.hpp
Text files modified:
   sandbox/odeint/boost/numeric/odeint/controlled_stepper_bs.hpp | 37 +++++++++++++++++++------------------
   sandbox/odeint/boost/numeric/odeint/controlled_stepper_standard.hpp | 21 +++++++++++----------
   sandbox/odeint/boost/numeric/odeint/stepper_euler.hpp | 13 +++++++------
   sandbox/odeint/boost/numeric/odeint/stepper_midpoint.hpp | 23 ++++++++++++-----------
   sandbox/odeint/boost/numeric/odeint/stepper_rk4.hpp | 21 +++++++++++----------
   sandbox/odeint/boost/numeric/odeint/stepper_rk4_classical.hpp | 19 ++++++++++---------
   sandbox/odeint/boost/numeric/odeint/stepper_rk78_fehlberg.hpp | 27 ++++++++++++++-------------
   sandbox/odeint/boost/numeric/odeint/stepper_rk_generic.hpp | 22 ++++++++++++----------
   8 files changed, 96 insertions(+), 87 deletions(-)

Modified: sandbox/odeint/boost/numeric/odeint/controlled_stepper_bs.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/controlled_stepper_bs.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/controlled_stepper_bs.hpp 2010-06-07 08:50:05 EDT (Mon, 07 Jun 2010)
@@ -45,6 +45,7 @@
         typedef Time time_type;
         typedef Traits traits_type;
         typedef typename traits_type::container_type container_type;
+ typedef container_type state_type;
         typedef typename traits_type::value_type value_type;
         typedef typename traits_type::iterator iterator;
         typedef typename traits_type::const_iterator const_iterator;
@@ -54,8 +55,8 @@
         // private memebers
     private:
 
- stepper_midpoint< container_type, time_type, traits_type > m_stepper_mp;
- error_checker_standard< container_type, time_type , traits_type > m_error_checker;
+ stepper_midpoint< state_type, time_type, traits_type > m_stepper_mp;
+ error_checker_standard< state_type, time_type , traits_type > m_error_checker;
         
         const unsigned short m_k_max;
 
@@ -75,11 +76,11 @@
         unsigned short m_current_k_max;
         unsigned short m_current_k_opt;
 
- container_type m_x0;
- container_type m_xerr;
- container_type m_x_mp;
- container_type m_x_scale;
- container_type m_dxdt;
+ state_type m_x0;
+ state_type m_xerr;
+ state_type m_x_mp;
+ state_type m_x_scale;
+ state_type m_dxdt;
 
         typedef std::vector< time_type > value_vector;
         typedef std::vector< std::vector< time_type > > value_matrix;
@@ -91,8 +92,8 @@
         us_vector m_interval_sequence;
 
         value_vector m_times;
- std::vector< container_type > m_d;
- container_type m_c;
+ std::vector< state_type > m_d;
+ state_type m_c;
         
         // public functions
     public:
@@ -125,7 +126,7 @@
 
         //constructor
         controlled_stepper_bs(
- const container_type &x,
+ const state_type &x,
                 time_type abs_err, time_type rel_err,
                 time_type factor_x, time_type factor_dxdt )
         {
@@ -135,7 +136,7 @@
 
 
 
- void adjust_size( const container_type &x )
+ void adjust_size( const state_type &x )
         {
             traits_type::adjust_size(x, m_xerr);
             traits_type::adjust_size(x, m_x_mp);
@@ -148,8 +149,8 @@
         template< class DynamicalSystem >
         controlled_step_result try_step(
                 DynamicalSystem &system ,
- container_type &x ,
- container_type &dxdt ,
+ state_type &x ,
+ state_type &dxdt ,
                 time_type &t ,
                 time_type &dt )
         {
@@ -280,7 +281,7 @@
         template< class System >
         controlled_step_result try_step(
                 System &system,
- container_type &x,
+ state_type &x,
                 time_type &t,
                 time_type &dt )
         {
@@ -322,12 +323,12 @@
         void extrapolate(
                 unsigned short k_est,
                 time_type t_est,
- container_type &x_est,
- container_type &x,
- container_type &x_err )
+ state_type &x_est,
+ state_type &x,
+ state_type &x_err )
         {
             //traits_type::adjust_size(x, m_c);
- //std::vector< container_type > m_d_iter = m_d.begin();
+ //std::vector< state_type > m_d_iter = m_d.begin();
             //while( m_d_iter != m_d.end() )
             // traits_type::adjust_size(x, (*m_d_iter++));
             

Modified: sandbox/odeint/boost/numeric/odeint/controlled_stepper_standard.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/controlled_stepper_standard.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/controlled_stepper_standard.hpp 2010-06-07 08:50:05 EDT (Mon, 07 Jun 2010)
@@ -69,6 +69,7 @@
         typedef ErrorStepper stepper_type;
         typedef typename stepper_type::order_type order_type;
         typedef typename stepper_type::container_type container_type;
+ typedef container_type state_type;
         typedef typename stepper_type::time_type time_type;
         typedef typename stepper_type::traits_type traits_type;
         typedef typename stepper_type::value_type value_type;
@@ -76,7 +77,7 @@
 // typedef typename stepper_type::const_iterator const_iterator;
 
         typedef error_checker_standard<
- container_type, time_type , traits_type
+ state_type, time_type , traits_type
> error_checker_type;
 
 
@@ -91,10 +92,10 @@
         time_type m_a_x;
         time_type m_a_dxdt;
 
- container_type m_dxdt;
- container_type m_x_tmp;
- container_type m_x_err;
- container_type m_x_scale;
+ state_type m_dxdt;
+ state_type m_x_tmp;
+ state_type m_x_err;
+ state_type m_x_scale;
 
 
         // public functions
@@ -114,7 +115,7 @@
         }
 
         controlled_stepper_standard(
- const container_type &x ,
+ const state_type &x ,
             time_type abs_err, time_type rel_err,
             time_type factor_x, time_type factor_dxdt )
             : m_error_checker( abs_err, rel_err, factor_x, factor_dxdt ),
@@ -126,7 +127,7 @@
             adjust_size( x );
         }
 
- void adjust_size( const container_type &x )
+ void adjust_size( const state_type &x )
         {
             traits_type::adjust_size( x , m_x_err );
             traits_type::adjust_size( x , m_x_scale );
@@ -147,8 +148,8 @@
         template< class DynamicalSystem >
         controlled_step_result try_step(
                 DynamicalSystem &system,
- container_type &x,
- const container_type &dxdt,
+ state_type &x,
+ const state_type &dxdt,
                 time_type &t,
                 time_type &dt )
         {
@@ -191,7 +192,7 @@
         template< class DynamicalSystem >
         controlled_step_result try_step(
                 DynamicalSystem &system,
- container_type &x,
+ state_type &x,
                 time_type &t,
                 time_type &dt )
         {

Modified: sandbox/odeint/boost/numeric/odeint/stepper_euler.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/stepper_euler.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/stepper_euler.hpp 2010-06-07 08:50:05 EDT (Mon, 07 Jun 2010)
@@ -41,6 +41,7 @@
         typedef Time time_type;
         typedef Traits traits_type;
         typedef typename traits_type::container_type container_type;
+ typedef container_type state_type;
         typedef typename traits_type::value_type value_type;
 
 
@@ -49,7 +50,7 @@
         //
     private:
 
- container_type m_dxdt;
+ state_type m_dxdt;
 
 
 
@@ -70,7 +71,7 @@
 
 
         // contructor, which adjusts m_dxdt
- stepper_euler( const container_type &x )
+ stepper_euler( const state_type &x )
         {
             adjust_size( x );
         }
@@ -78,7 +79,7 @@
 
 
         // adjust the size of m_dxdt
- void adjust_size( const container_type &x )
+ void adjust_size( const state_type &x )
         {
             traits_type::adjust_size( x , m_dxdt );
         }
@@ -88,8 +89,8 @@
         // performs one step with the knowledge of dxdt(t)
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
- const container_type &dxdt ,
+ state_type &x ,
+ const state_type &dxdt ,
                       time_type t ,
                       time_type dt )
         {
@@ -105,7 +106,7 @@
         // performs one step
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
+ state_type &x ,
                                           time_type t ,
                                           time_type dt )
         {

Modified: sandbox/odeint/boost/numeric/odeint/stepper_midpoint.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/stepper_midpoint.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/stepper_midpoint.hpp 2010-06-07 08:50:05 EDT (Mon, 07 Jun 2010)
@@ -43,6 +43,7 @@
         typedef Time time_type;
         typedef Traits traits_type;
         typedef typename traits_type::container_type container_type;
+ typedef container_type state_type;
         typedef typename traits_type::value_type value_type;
 // typedef typename traits_type::iterator iterator;
 // typedef typename traits_type::const_iterator const_iterator;
@@ -56,9 +57,9 @@
 
         unsigned short m_step_number;
 
- container_type m_x0;
- container_type m_x1;
- container_type m_dxdt;
+ state_type m_x0;
+ state_type m_x1;
+ state_type m_dxdt;
 
 
 
@@ -74,14 +75,14 @@
         }
 
         // constructor, which adjusts the size of the internal containers
- stepper_midpoint( const container_type &x , unsigned short step_number = 2 )
+ stepper_midpoint( const state_type &x , unsigned short step_number = 2 )
         {
             adjust_size( x );
             set_step_number( step_number );
         }
 
         // adjusts the size of the internal containers
- void adjust_size( const container_type &x )
+ void adjust_size( const state_type &x )
         {
             traits_type::adjust_size( x , m_x0 );
             traits_type::adjust_size( x , m_x1 );
@@ -105,11 +106,11 @@
         template< class DynamicalSystem >
         void midpoint_step(
                 DynamicalSystem &system ,
- container_type &x ,
- const container_type &dxdt ,
+ state_type &x ,
+ const state_type &dxdt ,
                 time_type t ,
                 time_type dt ,
- container_type &x_out )
+ state_type &x_out )
         {
             using namespace detail::it_algebra;
 
@@ -160,8 +161,8 @@
         template< class DynamicalSystem >
         void do_step(
                 DynamicalSystem &system ,
- container_type &x ,
- const container_type &dxdt ,
+ state_type &x ,
+ const state_type &dxdt ,
                 time_type t ,
                 time_type dt )
         {
@@ -175,7 +176,7 @@
         template< class DynamicalSystem >
         void do_step(
                 DynamicalSystem &system ,
- container_type &x ,
+ state_type &x ,
                 time_type t ,
                 time_type dt )
         {

Modified: sandbox/odeint/boost/numeric/odeint/stepper_rk4.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/stepper_rk4.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/stepper_rk4.hpp 2010-06-07 08:50:05 EDT (Mon, 07 Jun 2010)
@@ -38,6 +38,7 @@
         typedef Time time_type;
         typedef Traits traits_type;
         typedef typename traits_type::container_type container_type;
+ typedef container_type state_type;
         typedef typename traits_type::value_type value_type;
 // typedef typename traits_type::iterator iterator;
 // typedef typename traits_type::const_iterator const_iterator;
@@ -50,11 +51,11 @@
         // private members
     private:
 
- container_type m_dxdt;
- container_type m_dxt;
- container_type m_dxm;
- container_type m_dxh;
- container_type m_xt;
+ state_type m_dxdt;
+ state_type m_dxt;
+ state_type m_dxm;
+ state_type m_dxh;
+ state_type m_xt;
 
 
         // private member functions
@@ -73,12 +74,12 @@
         }
 
         // constructor, which adjusts the internal containers
- stepper_rk4( const container_type &x )
+ stepper_rk4( const state_type &x )
         {
             adjust_size( x );
         }
 
- void adjust_size( const container_type &x )
+ void adjust_size( const state_type &x )
         {
             traits_type::adjust_size( x , m_dxdt );
             traits_type::adjust_size( x , m_dxt );
@@ -91,8 +92,8 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
- const container_type &dxdt ,
+ state_type &x ,
+ const state_type &dxdt ,
                       time_type t ,
                       time_type dt )
         {
@@ -146,7 +147,7 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
+ state_type &x ,
                         time_type t ,
                         time_type dt )
         {

Modified: sandbox/odeint/boost/numeric/odeint/stepper_rk4_classical.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/stepper_rk4_classical.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/stepper_rk4_classical.hpp 2010-06-07 08:50:05 EDT (Mon, 07 Jun 2010)
@@ -38,6 +38,7 @@
         typedef Time time_type;
         typedef Traits traits_type;
         typedef typename traits_type::container_type container_type;
+ typedef container_type state_type;
         typedef typename traits_type::value_type value_type;
 // typedef typename traits_type::iterator iterator;
 // typedef typename traits_type::const_iterator const_iterator;
@@ -50,10 +51,10 @@
         // private members
     private:
 
- container_type m_dxdt;
- container_type m_dxt;
- container_type m_dxm;
- container_type m_xt;
+ state_type m_dxdt;
+ state_type m_dxt;
+ state_type m_dxm;
+ state_type m_xt;
 
         
 
@@ -70,12 +71,12 @@
         }
 
         // constructor, which adjusts the internal containers
- stepper_rk4_classical( const container_type &x )
+ stepper_rk4_classical( const state_type &x )
         {
             adjust_size( x );
         }
 
- void adjust_size( const container_type &x )
+ void adjust_size( const state_type &x )
         {
             traits_type::adjust_size( x , m_dxdt );
             traits_type::adjust_size( x , m_dxt );
@@ -85,8 +86,8 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
- const container_type &dxdt ,
+ state_type &x ,
+ const state_type &dxdt ,
                       time_type t ,
                       time_type dt )
         {
@@ -135,7 +136,7 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
+ state_type &x ,
                         time_type t ,
                         time_type dt )
         {

Modified: sandbox/odeint/boost/numeric/odeint/stepper_rk5_ck.hpp
==============================================================================
Binary files. No diff available.

Modified: sandbox/odeint/boost/numeric/odeint/stepper_rk78_fehlberg.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/stepper_rk78_fehlberg.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/stepper_rk78_fehlberg.hpp 2010-06-07 08:50:05 EDT (Mon, 07 Jun 2010)
@@ -33,6 +33,7 @@
         typedef Time time_type;
         typedef Traits traits_type;
         typedef typename traits_type::container_type container_type;
+ typedef container_type state_type;
         typedef typename traits_type::value_type value_type;
 // typedef typename traits_type::iterator iterator;
 // typedef typename traits_type::const_iterator const_iterator;
@@ -43,9 +44,9 @@
         // private members
     private:
 
- container_type m_dxdt;
- container_type m_xt;
- container_type m_k02 , m_k03 , m_k04 , m_k05 , m_k06 , m_k07 ,
+ state_type m_dxdt;
+ state_type m_xt;
+ state_type m_k02 , m_k03 , m_k04 , m_k05 , m_k06 , m_k07 ,
             m_k08 , m_k09 , m_k10 , m_k11 , m_k12 , m_k13;
 
 
@@ -72,13 +73,13 @@
 
 
         // constructor, which adjusts the internal containers
- stepper_rk78_fehlberg( const container_type &x )
+ stepper_rk78_fehlberg( const state_type &x )
         {
             adjust_size( x );
         }
 
 
- void adjust_size( const container_type &x )
+ void adjust_size( const state_type &x )
         {
             traits_type::adjust_size( x , m_dxdt );
             traits_type::adjust_size( x , m_xt );
@@ -98,8 +99,8 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
- const container_type &dxdt ,
+ state_type &x ,
+ const state_type &dxdt ,
                         time_type t ,
                         time_type dt )
         {
@@ -350,7 +351,7 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
+ state_type &x ,
                       time_type t ,
                       time_type dt )
         {
@@ -361,11 +362,11 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
- const container_type &dxdt ,
+ state_type &x ,
+ const state_type &dxdt ,
                       time_type t ,
                       time_type dt ,
- container_type &xerr )
+ state_type &xerr )
         {
             const time_type cc01 = static_cast<time_type>( 41.0 / 840.0 );
             const time_type cc06 = static_cast<time_type>( 34.0 / 105.0 );
@@ -397,10 +398,10 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
+ state_type &x ,
                       time_type t ,
                       time_type dt ,
- container_type &xerr )
+ state_type &xerr )
         {
             system( x , m_dxdt , t );
             do_step( system , x , m_dxdt , t , dt , xerr );

Modified: sandbox/odeint/boost/numeric/odeint/stepper_rk_generic.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/stepper_rk_generic.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/stepper_rk_generic.hpp 2010-06-07 08:50:05 EDT (Mon, 07 Jun 2010)
@@ -63,6 +63,7 @@
         typedef Time time_type;
         typedef Traits traits_type;
         typedef typename traits_type::container_type container_type;
+ typedef container_type state_type;
         typedef typename traits_type::value_type value_type;
         typedef typename traits_type::iterator iterator;
         typedef typename traits_type::const_iterator const_iterator;
@@ -74,14 +75,14 @@
         // private variables
     private:
 
- typedef std::vector< container_type > container_vector;
+ typedef std::vector< state_type > container_vector;
         typedef std::vector< iterator > container_iterator_vector;
         typedef std::vector< time_type > parameter_vector;
         typedef std::vector< parameter_vector > parameter_matrix;
 
         container_vector m_xvec;
         container_iterator_vector m_xiter_vec;
- container_type m_xtmp;
+ state_type m_xtmp;
         const parameter_vector m_a;
         const parameter_matrix m_b;
         const parameter_vector m_c;
@@ -192,8 +193,8 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
- container_type &dxdt ,
+ state_type &x ,
+ state_type &dxdt ,
                       time_type t ,
                       time_type dt )
         {
@@ -234,7 +235,7 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
+ state_type &x ,
                         time_type t ,
                         time_type dt )
         {
@@ -275,6 +276,7 @@
         typedef Time time_type;
         typedef Traits traits_type;
         typedef typename traits_type::container_type container_type;
+ typedef container_type state_type;
         typedef typename traits_type::value_type value_type;
         typedef typename traits_type::iterator iterator;
         typedef typename traits_type::const_iterator const_iterator;
@@ -282,14 +284,14 @@
         // private variables
     private:
 
- typedef std::vector< container_type > container_vector;
+ typedef std::vector< state_type > container_vector;
         typedef std::vector< iterator > container_iterator_vector;
         typedef std::vector< time_type > parameter_vector;
         typedef std::vector< parameter_vector > parameter_matrix;
 
         container_vector m_xvec;
         container_iterator_vector m_xiter_vec;
- container_type m_xtmp;
+ state_type m_xtmp;
         const time_type* m_a;
         const time_type* m_b;
         const time_type* m_c;
@@ -374,8 +376,8 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
- container_type &dxdt ,
+ state_type &x ,
+ state_type &dxdt ,
                         time_type t ,
                         time_type dt )
         {
@@ -420,7 +422,7 @@
 
         template< class DynamicalSystem >
         void do_step( DynamicalSystem &system ,
- container_type &x ,
+ state_type &x ,
                         time_type t ,
                         time_type dt )
         {


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