Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57158 - sandbox/odeint/boost/numeric/odeint
From: karsten.ahnert_at_[hidden]
Date: 2009-10-26 06:01:41


Author: karsten
Date: 2009-10-26 06:01:40 EDT (Mon, 26 Oct 2009)
New Revision: 57158
URL: http://svn.boost.org/trac/boost/changeset/57158

Log:
type conversion

Text files modified:
   sandbox/odeint/boost/numeric/odeint/euler.hpp | 3 ++-
   sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp | 11 +++++------
   2 files changed, 7 insertions(+), 7 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-26 06:01:40 EDT (Mon, 26 Oct 2009)
@@ -38,7 +38,8 @@
         ResizeType resizer;
 
         typedef typename ContainerType::iterator iterator;
-
+ typedef typename ContainerType::value_type value_type;
+
     public:
 
         template< class DynamicalSystem , class TimeType>

Modified: sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp 2009-10-26 06:01:40 EDT (Mon, 26 Oct 2009)
@@ -53,17 +53,16 @@
                         TimeType t ,
                         TimeType dt )
         {
- const value_type val2 = value_type( 2.0 );
+ const TimeType val2 = TimeType( 2.0 );
 
             if( ! resizer.same_size( x , dxdt ) ) resizer.resize( x , dxdt );
             if( ! resizer.same_size( x , dxt ) ) resizer.resize( x , dxt );
             if( ! resizer.same_size( x , dxm ) ) resizer.resize( x , dxm );
             if( ! resizer.same_size( x , xt ) ) resizer.resize( x , xt );
 
- value_type dt_val = value_type( dt );
- value_type dh = dt_val * value_type( 0.5 );
- value_type d6 = dt_val / value_type( 6.0 );
- value_type th = dh + value_type( t );
+ TimeType dh = TimeType( 0.5 ) * dt;
+ TimeType d6 = dt / TimeType( 6.0 );
+ TimeType th = t + dh;
 
             iterator iter1 , iter2 ,iter3 , iter4;
             iterator x_end = x.end() , xt_end = xt.end();
@@ -82,7 +81,7 @@
             iter1 = xt.begin() ; iter2 = x.begin() ; iter3 = dxm.begin() ; iter4 = dxt.begin();
             while( iter1 != xt_end )
             {
- (*iter1++) = (*iter2++) + dt_val * (*iter3);
+ (*iter1++) = (*iter2++) + dt * (*iter3);
                 (*iter3++) += (*iter4++);
             }
 


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