|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57967 - sandbox/odeint/boost/numeric/odeint
From: mario.mulansky_at_[hidden]
Date: 2009-11-27 05:26:24
Author: mariomulansky
Date: 2009-11-27 05:26:23 EST (Fri, 27 Nov 2009)
New Revision: 57967
URL: http://svn.boost.org/trac/boost/changeset/57967
Log:
some changes in midpoint
Text files modified:
sandbox/odeint/boost/numeric/odeint/controlled_stepper_standard.hpp | 3 +++
sandbox/odeint/boost/numeric/odeint/stepper_midpoint.hpp | 20 +++++++++++++++++---
2 files changed, 20 insertions(+), 3 deletions(-)
Modified: sandbox/odeint/boost/numeric/odeint/controlled_stepper_standard.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/controlled_stepper_standard.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/controlled_stepper_standard.hpp 2009-11-27 05:26:23 EST (Fri, 27 Nov 2009)
@@ -70,6 +70,8 @@
typedef typename container_type::value_type value_type;
typedef typename container_type::iterator iterator;
+ typedef unsigned short order_type;
+
// private members
private:
@@ -127,6 +129,7 @@
m_a_dxdt(factor_dxdt)
{ }
+ order_type order() { return m_stepper.order(); }
/* Tries a controlled step with the given stepsize dt. If dt is too large,
x remains unchanged, an appropriate stepsize is assigned to dt and
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-11-27 05:26:23 EST (Fri, 27 Nov 2009)
@@ -79,7 +79,8 @@
m_stepcount = stepcount;
}
- unsigned short get_step_count() const { return m_stepcount; }
+ unsigned short get_stepcount() const { return m_stepcount; }
+
template< class DynamicalSystem >
void do_step(
@@ -87,7 +88,8 @@
container_type &x ,
container_type &dxdt ,
time_type t ,
- time_type dt )
+ time_type dt ,
+ container_type &x_out )
{
const time_type t_1 = static_cast<time_type>( 1.0 );
const time_type t_05 = static_cast<time_type>( 0.5 );
@@ -124,12 +126,24 @@
// last step
// x = 0.5*( m_x0 + m_x1 + h*m_dxdt
- scale_sum( x.begin(), x.end(),
+ scale_sum( x_out.begin(), x_out.end(),
t_05, m_x0.begin(),
t_05, m_x1.begin(),
t_05*h, m_dxdt.begin() );
}
+ template< class DynamicalSystem >
+ void do_step(
+ DynamicalSystem &system ,
+ container_type &x ,
+ container_type &dxdt ,
+ time_type t ,
+ time_type dt )
+ {
+ do_step( system, x, dxdt, t, dt, x );
+ }
+
+
template< class DynamicalSystem >
void do_step(
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