|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57522 - in sandbox/odeint: boost/numeric/odeint libs/numeric/odeint/stuff/gsl_compare
From: karsten.ahnert_at_[hidden]
Date: 2009-11-09 13:27:50
Author: karsten
Date: 2009-11-09 13:27:49 EST (Mon, 09 Nov 2009)
New Revision: 57522
URL: http://svn.boost.org/trac/boost/changeset/57522
Log:
small changes, calling next_step now with reference to system
Text files modified:
sandbox/odeint/boost/numeric/odeint/euler.hpp | 4 ++--
sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp | 4 ++--
sandbox/odeint/boost/numeric/odeint/stepper_half_step.hpp | 18 +++++++++---------
sandbox/odeint/libs/numeric/odeint/stuff/gsl_compare/lorenz_stepper_cmp.cpp | 5 +++--
4 files changed, 16 insertions(+), 15 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-11-09 13:27:49 EST (Mon, 09 Nov 2009)
@@ -78,7 +78,7 @@
template< class DynamicalSystem >
- void next_step( DynamicalSystem system ,
+ void next_step( DynamicalSystem &system ,
container_type &x ,
const container_type &dxdt ,
time_type t ,
@@ -89,7 +89,7 @@
}
template< class DynamicalSystem >
- void next_step( DynamicalSystem system ,
+ void next_step( DynamicalSystem &system ,
container_type &x ,
time_type t ,
time_type dt )
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-11-09 13:27:49 EST (Mon, 09 Nov 2009)
@@ -78,7 +78,7 @@
order_type order() const { return 4; }
template< class DynamicalSystem >
- void next_step( DynamicalSystem system ,
+ void next_step( DynamicalSystem &system ,
container_type &x ,
const container_type &dxdt ,
time_type t ,
@@ -117,7 +117,7 @@
template< class DynamicalSystem >
- void next_step( DynamicalSystem system ,
+ void next_step( DynamicalSystem &system ,
container_type &x ,
time_type t ,
time_type dt )
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-11-09 13:27:49 EST (Mon, 09 Nov 2009)
@@ -68,7 +68,7 @@
template< class DynamicalSystem >
- void next_step( DynamicalSystem system ,
+ void next_step( DynamicalSystem &system ,
container_type &x ,
const container_type &dxdt ,
time_type t ,
@@ -80,7 +80,7 @@
template< class DynamicalSystem >
- void next_step( DynamicalSystem system ,
+ void next_step( DynamicalSystem &system ,
container_type &x ,
time_type t ,
time_type dt )
@@ -89,7 +89,7 @@
}
template< class DynamicalSystem >
- void next_step( DynamicalSystem system ,
+ void next_step( DynamicalSystem &system ,
container_type &x ,
const container_type &dxdt ,
time_type t ,
@@ -101,21 +101,21 @@
m_xtemp = x;
time_type dt2 = 0.5 * dt;
- next_step( system , x , dxdt , t , dt );
- next_step( system , m_xtemp , dxdt , t , dt2 );
- next_step( system , m_xtemp , t+dt2 , dt2 );
+ next_step( system , m_xtemp , dxdt , t , dt );
+ next_step( system , x , dxdt , t , dt2 );
+ next_step( system , x , t+dt2 , dt2 );
detail::it_algebra::assign_diff(
xerr.begin() ,
xerr.end() ,
- x.begin() ,
- m_xtemp.begin() );
+ m_xtemp.begin() ,
+ x.begin() );
}
template< class DynamicalSystem >
- void next_step( DynamicalSystem system ,
+ void next_step( DynamicalSystem &system ,
container_type &x ,
time_type t ,
time_type dt ,
Modified: sandbox/odeint/libs/numeric/odeint/stuff/gsl_compare/lorenz_stepper_cmp.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/stuff/gsl_compare/lorenz_stepper_cmp.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/stuff/gsl_compare/lorenz_stepper_cmp.cpp 2009-11-09 13:27:49 EST (Mon, 09 Nov 2009)
@@ -141,9 +141,10 @@
t = 0.0;
for( size_t i=0 ; i<tslen ; ++i,t+=dt )
{
- stepper.next_step( lorenz , x1 , t , dt );
+ stepper.next_step( lorenz , x1 , t , dt , x1_err );
gsl_odeiv_step_apply ( s , t , dt , x2 , x2_err , 0 , 0 , &sys );
- rk4_lorenz( x3 , dt );
+ rk4_lorenz( x3 , 0.5*dt );
+ rk4_lorenz( x3 , 0.5*dt );
cout << t << tab << x1[0] << tab << x2[0] << tab << x3[0] << 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