Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58355 - in sandbox/odeint: boost/numeric/odeint libs/numeric/odeint/examples libs/numeric/odeint/stuff/test
From: mario.mulansky_at_[hidden]
Date: 2009-12-13 11:18:14


Author: mariomulansky
Date: 2009-12-13 11:18:13 EST (Sun, 13 Dec 2009)
New Revision: 58355
URL: http://svn.boost.org/trac/boost/changeset/58355

Log:
begin() -> end() bugfixes
Text files modified:
   sandbox/odeint/boost/numeric/odeint/error_checker_standard.hpp | 6 +++---
   sandbox/odeint/boost/numeric/odeint/stepper_half_step.hpp | 2 +-
   sandbox/odeint/boost/numeric/odeint/stepper_midpoint.hpp | 4 ++--
   sandbox/odeint/libs/numeric/odeint/examples/lorenz_cmp_rk4_rk_generic.cpp | 7 ++++---
   sandbox/odeint/libs/numeric/odeint/stuff/test/stepper_bs.cpp | 4 ++--
   5 files changed, 12 insertions(+), 11 deletions(-)

Modified: sandbox/odeint/boost/numeric/odeint/error_checker_standard.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/error_checker_standard.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/error_checker_standard.hpp 2009-12-13 11:18:13 EST (Sun, 13 Dec 2009)
@@ -35,9 +35,9 @@
 
     private:
                time_type m_eps_abs;
- time_type m_eps_rel;
- time_type m_a_x;
- time_type m_a_dxdt;
+ time_type m_eps_rel;
+ time_type m_a_x;
+ time_type m_a_dxdt;
 
     public:
         // constructor

Modified: sandbox/odeint/boost/numeric/odeint/stepper_half_step.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/stepper_half_step.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/stepper_half_step.hpp 2009-12-13 11:18:13 EST (Sun, 13 Dec 2009)
@@ -104,7 +104,7 @@
             do_step( system , x , t+dt2 , dt2 );
 
             detail::it_algebra::assign_diff( traits_type::begin(xerr) ,
- traits_type::begin(xerr) ,
+ traits_type::end(xerr) ,
                                              traits_type::begin(m_xtemp) ,
                                              traits_type::begin(x) );
         }

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 2009-12-13 11:18:13 EST (Sun, 13 Dec 2009)
@@ -100,7 +100,7 @@
 
             using namespace detail::it_algebra;
 
- // m_x0 = x + h*dxdt
+ // m_x1 = x + h*dxdt
             scale_sum( traits_type::begin(m_x1), traits_type::end(m_x1),
                        t_1, traits_type::begin(x),
                        h, traits_type::begin(dxdt) );
@@ -114,7 +114,7 @@
             while( i != m_stepcount )
             { // general step
                 //tmp = m_x1; m_x1 = m_x0 + h2*m_dxdt; m_x0 = tmp
- scale_sum_swap( traits_type::begin(m_x1), traits_type::begin(m_x1),
+ scale_sum_swap( traits_type::begin(m_x1), traits_type::end(m_x1),
                                 traits_type::begin(m_x0),
                                 h2, traits_type::begin(m_dxdt) );
                 th += h;

Modified: sandbox/odeint/libs/numeric/odeint/examples/lorenz_cmp_rk4_rk_generic.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/examples/lorenz_cmp_rk4_rk_generic.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/examples/lorenz_cmp_rk4_rk_generic.cpp 2009-12-13 11:18:13 EST (Sun, 13 Dec 2009)
@@ -50,6 +50,7 @@
     state_type x1 = {{1.0, 0.0, 0.0}};
     state_type x2 = {{1.0, 0.0, 0.0}};
     state_type x3 = {{1.0, 0.0, 0.0}};
+ state_type x4 = {{1.0, 0.0, 0.0}};
 
     stepper_rk4< state_type > stepper_rk4;
     stepper_rk4_classical< state_type > stepper_rk4_classical;
@@ -137,12 +138,12 @@
     t = 0.0;
     start= clock();
     for( size_t oi=1 ; oi<olen ; ++oi,t+=dt ) {
- stepper_rk4_classical.do_step( lorenz , x3 , t , dt );
+ stepper_rk4_classical.do_step( lorenz , x4 , t , dt );
         if( oi < 5 )
- cout << "x after step "<<oi<<": "<<x3[0]<<tab<<x3[1]<<tab<<x3[2]<<endl;
+ cout << "x after step "<<oi<<": "<<x4[0]<<tab<<x4[1]<<tab<<x4[2]<<endl;
     }
     end = clock();
- cout << "x after "<<olen<<" steps: "<<x3[0]<<tab<<x3[1]<<tab<<x3[2]<<endl;
+ cout << "x after "<<olen<<" steps: "<<x4[0]<<tab<<x4[1]<<tab<<x4[2]<<endl;
     cout << "Time for "<<olen<<" steps: " << double ( end - start ) / double( CLOCKS_PER_SEC ) << endl;
 
     return 0;

Modified: sandbox/odeint/libs/numeric/odeint/stuff/test/stepper_bs.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/stuff/test/stepper_bs.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/stuff/test/stepper_bs.cpp 2009-12-13 11:18:13 EST (Sun, 13 Dec 2009)
@@ -37,9 +37,9 @@
     clog.precision(16);
     for( size_t step=0; step < step_count; step++ )
     {
- stepper_bs.try_step(harmonic_oscillator, x1, t, dt);
+ controlled_step_result res = stepper_bs.try_step(harmonic_oscillator, x1, t, dt);
         //clog << " ####################################################### " << endl;
- cout << t << tab << dt << tab << x1[0] << tab << x1[1] << endl;
+ cout << t << tab << dt << tab << x1[0] << tab << x1[1] << tab << res << endl;
         //clog << " ####################################################### " << endl;
     }
 }


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