|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61978 - in sandbox/odeint: boost/numeric/odeint libs/numeric/odeint/examples
From: karsten.ahnert_at_[hidden]
Date: 2010-05-15 06:40:55
Author: karsten
Date: 2010-05-15 06:40:54 EDT (Sat, 15 May 2010)
New Revision: 61978
URL: http://svn.boost.org/trac/boost/changeset/61978
Log:
the observer are now calles by reference
Text files modified:
sandbox/odeint/boost/numeric/odeint/integrator_adaptive_stepsize.hpp | 2
sandbox/odeint/boost/numeric/odeint/integrator_constant_stepsize.hpp | 61 ++++++++++++++++++++-------------------
sandbox/odeint/boost/numeric/odeint/stepper_euler.hpp | 21 +++++--------
sandbox/odeint/libs/numeric/odeint/examples/lorenz_controlled.cpp | 5 +-
4 files changed, 43 insertions(+), 46 deletions(-)
Modified: sandbox/odeint/boost/numeric/odeint/integrator_adaptive_stepsize.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/integrator_adaptive_stepsize.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/integrator_adaptive_stepsize.hpp 2010-05-15 06:40:54 EDT (Sat, 15 May 2010)
@@ -35,7 +35,7 @@
typename ControlledStepper::time_type start_time,
typename ControlledStepper::time_type end_time,
typename ControlledStepper::time_type dt,
- Observer observer )
+ Observer &observer )
{
typedef typename ControlledStepper::time_type time_type;
Modified: sandbox/odeint/boost/numeric/odeint/integrator_constant_stepsize.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/integrator_constant_stepsize.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/integrator_constant_stepsize.hpp 2010-05-15 06:40:54 EDT (Sat, 15 May 2010)
@@ -25,14 +25,15 @@
class DynamicalSystem ,
class Observer
>
- size_t integrate_const(
- Stepper &stepper ,
- DynamicalSystem &system ,
- typename Stepper::container_type &state ,
- typename Stepper::time_type start_time ,
- typename Stepper::time_type end_time ,
- typename Stepper::time_type dt ,
- Observer observer
+ size_t integrate_const
+ (
+ Stepper &stepper ,
+ DynamicalSystem &system ,
+ typename Stepper::container_type &state ,
+ typename Stepper::time_type start_time ,
+ typename Stepper::time_type end_time ,
+ typename Stepper::time_type dt ,
+ Observer &observer
)
{
stepper.adjust_size( state );
@@ -56,12 +57,12 @@
class DynamicalSystem
>
size_t integrate_const(
- Stepper &stepper ,
- DynamicalSystem &system ,
- typename Stepper::container_type &state ,
- typename Stepper::time_type start_time ,
- typename Stepper::time_type end_time ,
- typename Stepper::time_type dt
+ Stepper &stepper ,
+ DynamicalSystem &system ,
+ typename Stepper::container_type &state ,
+ typename Stepper::time_type start_time ,
+ typename Stepper::time_type end_time ,
+ typename Stepper::time_type dt
)
{
return integrate_const(
@@ -80,14 +81,15 @@
class DynamicalSystem ,
class Observer
>
- typename Stepper::time_type integrate_const_steps(
- Stepper &stepper ,
- DynamicalSystem &system ,
- typename Stepper::container_type &state ,
- typename Stepper::time_type start_time ,
- typename Stepper::time_type dt ,
- size_t num_of_steps ,
- Observer &observer
+ typename Stepper::time_type integrate_const_steps
+ (
+ Stepper &stepper ,
+ DynamicalSystem &system ,
+ typename Stepper::container_type &state ,
+ typename Stepper::time_type start_time ,
+ typename Stepper::time_type dt ,
+ size_t num_of_steps ,
+ Observer &observer
)
{
stepper.adjust_size( state );
@@ -109,13 +111,14 @@
class Stepper ,
class DynamicalSystem
>
- typename Stepper::time_type integrate_const_steps(
- Stepper &stepper ,
- DynamicalSystem &system ,
- typename Stepper::container_type &state ,
- typename Stepper::time_type start_time ,
- typename Stepper::time_type dt ,
- size_t num_of_steps
+ typename Stepper::time_type integrate_const_steps
+ (
+ Stepper &stepper ,
+ DynamicalSystem &system ,
+ typename Stepper::container_type &state ,
+ typename Stepper::time_type start_time ,
+ typename Stepper::time_type dt ,
+ size_t num_of_steps
)
{
return integrate_const_steps(
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-05-15 06:40:54 EDT (Sat, 15 May 2010)
@@ -21,9 +21,6 @@
#include <boost/numeric/odeint/detail/iterator_algebra.hpp>
#include <boost/numeric/odeint/container_traits.hpp>
-// #include <boost/numeric/odeint/stepper_base.hpp>
-
-
namespace boost {
namespace numeric {
namespace odeint {
@@ -45,8 +42,6 @@
typedef Traits traits_type;
typedef typename traits_type::container_type container_type;
typedef typename traits_type::value_type value_type;
-// typedef typename traits_type::iterator iterator;
-// typedef typename traits_type::const_iterator const_iterator;
//
@@ -108,15 +103,15 @@
// performs one step
- template< class DynamicalSystem >
- void do_step( DynamicalSystem &system ,
- container_type &x ,
- time_type t ,
- time_type dt )
- {
- system( x , m_dxdt , t );
+ template< class DynamicalSystem >
+ void do_step( DynamicalSystem &system ,
+ container_type &x ,
+ time_type t ,
+ time_type dt )
+ {
+ system( x , m_dxdt , t );
do_step( system , x , m_dxdt , t , dt );
- }
+ }
};
Modified: sandbox/odeint/libs/numeric/odeint/examples/lorenz_controlled.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/examples/lorenz_controlled.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/examples/lorenz_controlled.cpp 2010-05-15 06:40:54 EDT (Sat, 15 May 2010)
@@ -22,7 +22,6 @@
#include <vector>
#include <list>
#include <tr1/array>
-#include <tr1/functional>
#include <boost/numeric/odeint.hpp>
#include <boost/numeric/odeint/container_traits_tr1_array.hpp>
@@ -91,7 +90,7 @@
stepper_rk5_ck< state_type > rk5;
controlled_stepper_standard< stepper_rk5_ck< state_type > > controlled_rk5( eps_abs , eps_rel, 1.0, 1.0 );
output_observer rk5_obs("lorenz_rk5.dat");
- size_t steps = integrate_adaptive( controlled_rk5, lorenz, x, 0.0, end_time, 1E-2, ref(rk5_obs) );
+ size_t steps = integrate_adaptive( controlled_rk5, lorenz, x, 0.0, end_time, 1E-2, rk5_obs );
clog << "RK5: " << steps << " steps. (" << function_calls << " function calls)" << endl;
@@ -104,7 +103,7 @@
controlled_stepper_bs< state_type > controlled_bs(eps_abs, eps_rel, 1.0, 1.0);
output_observer bs_obs("lorenz_bs.dat");
- steps = integrate_adaptive( controlled_bs, lorenz, x, 0.0, end_time, 1E-2, ref(bs_obs) );
+ steps = integrate_adaptive( controlled_bs, lorenz, x, 0.0, end_time, 1E-2, bs_obs );
clog << "BS: " << steps << " steps. (" << function_calls << " function calls)" << 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