Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57258 - sandbox/odeint/boost/numeric/odeint
From: karsten.ahnert_at_[hidden]
Date: 2009-10-31 09:37:41


Author: karsten
Date: 2009-10-31 09:37:40 EDT (Sat, 31 Oct 2009)
New Revision: 57258
URL: http://svn.boost.org/trac/boost/changeset/57258

Log:
mini changes

Text files modified:
   sandbox/odeint/boost/numeric/odeint/euler.hpp | 60 ++++++++++++++++++----------------------
   sandbox/odeint/boost/numeric/odeint/integrator.hpp | 1
   2 files changed, 28 insertions(+), 33 deletions(-)

Modified: sandbox/odeint/boost/numeric/odeint/euler.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/euler.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/euler.hpp 2009-10-31 09:37:40 EDT (Sat, 31 Oct 2009)
@@ -38,9 +38,9 @@
         // check the concept of the ContainerType
         BOOST_CLASS_REQUIRE( ContainerType , boost::numeric::odeint, StateType );
 
- ContainerType dxdt;
- ContainerType xtemp;
- ResizeType resizer;
+ ContainerType m_dxdt;
+ ContainerType m_xtemp;
+ ResizeType m_resizer;
 
         typedef typename ContainerType::iterator iterator;
         typedef typename ContainerType::value_type value_type;
@@ -52,7 +52,7 @@
         template< class DynamicalSystem , class TimeType >
         void next_step( DynamicalSystem system ,
                         ContainerType &x ,
- ContainerType &dxdt ,
+ const ContainerType &dxdt ,
                         TimeType t ,
                         TimeType dt )
         {
@@ -65,55 +65,49 @@
                         TimeType t ,
                         TimeType dt )
         {
- resizer.adjust_size( x , dxdt );
- system( x , dxdt , t );
- next_step( system , x , dxdt , t , dt );
+ m_resizer.adjust_size( x , m_dxdt );
+ system( x , m_dxdt , t );
+ next_step( system , x , m_dxdt , t , dt );
         }
 
 
+
+
         template< class DynamicalSystem , class TimeType >
- void next_step( DynamicalSystem system ,
- ContainerType &x ,
- TimeType t ,
- TimeType dt ,
+ void next_step( DynamicalSystem system ,
+ ContainerType &x ,
+ const ContainerType &dxdt ,
+ TimeType t ,
+ TimeType dt ,
                         ContainerType &xerr )
         {
- resizer.adjust_size( x , dxdt );
- resizer.adjust_size( x , xerr );
+ m_resizer.adjust_size( x , xerr );
 
- xtemp = x;
- TimeType dt2 = 0.5*dt;
-
- system( x , dxdt , t );
+ m_xtemp = x;
+ TimeType dt2 = 0.5 * dt;
 
             next_step( system , x , dxdt , t , dt );
- next_step( system , xtemp , dxdt , t , dt2 );
- next_step( system , xtemp , t+dt2 , dt2 );
+ next_step( system , m_xtemp , dxdt , t , dt2 );
+ next_step( system , m_xtemp , t+dt2 , dt2 );
 
- detail::it_algebra::substract_and_assign( x.begin() , x.end() , xtemp.begin() , xerr.begin() );
+ detail::it_algebra::substract_and_assign( x.begin() , x.end() , m_xtemp.begin() , xerr.begin() );
         }
 
+
+
+
+
         template< class DynamicalSystem , class TimeType >
         void next_step( DynamicalSystem system ,
                         ContainerType &x ,
- ContainerType &dxdt ,
                         TimeType t ,
                         TimeType dt ,
                         ContainerType &xerr )
         {
- resizer.adjust_size( x , xerr );
-
- xtemp = x;
- TimeType dt2 = 0.5*dt;
-
- next_step( system , x , dxdt , t , dt );
- next_step( system , xtemp , dxdt , t , dt2 );
- next_step( system , xtemp , t+dt2 , dt2 );
-
- detail::it_algebra::substract_and_assign( x.begin() , x.end() , xtemp.begin() , xerr.begin() );
+ m_resizer.check_size_and_resize( x , m_dxdt );
+ system( x , m_dxdt , t );
+ next_step( system , x , m_dxdt , t , dt , xerr );
         }
-
-
     };
 
 } // namespace odeint

Modified: sandbox/odeint/boost/numeric/odeint/integrator.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/integrator.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/integrator.hpp 2009-10-31 09:37:40 EDT (Sat, 31 Oct 2009)
@@ -24,6 +24,7 @@
     class integrator {
 
     public:
+
         template< class StepType,
                   class DynamicalSystem,
                   class StateType,


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