|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72379 - in sandbox/odeint/branches/karsten: boost/numeric/odeint/stepper libs/numeric/odeint/test
From: mario.mulansky_at_[hidden]
Date: 2011-06-03 12:39:39
Author: mariomulansky
Date: 2011-06-03 12:39:38 EDT (Fri, 03 Jun 2011)
New Revision: 72379
URL: http://svn.boost.org/trac/boost/changeset/72379
Log:
added resizing tests for generic stepper
Text files modified:
sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_generic_rk.hpp | 16 ++++++++++++++++
sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4_generic.hpp | 7 -------
sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp | 11 ++++++++++-
3 files changed, 26 insertions(+), 8 deletions(-)
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_generic_rk.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_generic_rk.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_generic_rk.hpp 2011-06-03 12:39:38 EDT (Fri, 03 Jun 2011)
@@ -301,9 +301,11 @@
void initialize( void )
{
boost::numeric::odeint::construct( m_x_tmp );
+ m_state_adjuster.register_state( 0 , m_x_tmp );
for( size_t i = 0 ; i < StageCount-1 ; ++i )
{
boost::numeric::odeint::construct( m_F[i] );
+ m_deriv_adjuster.register_state( i , m_F[i] );
}
}
@@ -355,10 +357,21 @@
template< class System , class StateIn , class DerivIn , class StateOut >
void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , const time_type &t , StateOut &out , const time_type &dt )
{
+ m_deriv_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
+ m_state_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
+
fusion::for_each( m_stages , calculate_stage< System , StateIn , DerivIn , StateOut >
( system , in , dxdt , out , m_x_tmp , m_F , t , dt ) );
}
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ m_deriv_adjuster.adjust_size( x );
+ m_state_adjuster.adjust_size( x );
+ stepper_base_type::adjust_size( x );
+ }
+
friend std::ostream& operator << <>( std::ostream &os , const explicit_generic_rk &rk );
private:
@@ -366,6 +379,9 @@
const stage_vector m_stages;
state_type m_x_tmp;
+ size_adjuster< deriv_type , StageCount-1 > m_deriv_adjuster;
+ size_adjuster< state_type , 1 > m_state_adjuster;
+
protected:
deriv_type m_F[StageCount-1];
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4_generic.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4_generic.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4_generic.hpp 2011-06-03 12:39:38 EDT (Fri, 03 Jun 2011)
@@ -67,13 +67,6 @@
constants_generic::rk4_b , constants_generic::rk4_c )
{ }
- explicit_rk4_generic& operator=( const explicit_rk4_generic &rk )
- {
- stepper_base_type::operator=( rk );
- return *this;
- }
-
-
};
}
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp 2011-06-03 12:39:38 EDT (Fri, 03 Jun 2011)
@@ -27,6 +27,7 @@
#include <boost/numeric/odeint/stepper/explicit_euler.hpp>
#include <boost/numeric/odeint/stepper/explicit_rk4.hpp>
+#include <boost/numeric/odeint/stepper/explicit_rk4_generic.hpp>
#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
using namespace boost::unit_test;
@@ -85,13 +86,21 @@
typedef explicit_rk4< test_array_type , double , test_array_type , double , range_algebra , default_operations , adjust_size_always_tag > rk4_always_type;
+typedef explicit_rk4_generic< test_array_type , double , test_array_type , double , range_algebra , default_operations , adjust_size_manually_tag > rk4_gen_manual_type;
+typedef explicit_rk4_generic< test_array_type , double , test_array_type , double , range_algebra , default_operations , adjust_size_initially_tag > rk4_gen_initially_type;
+typedef explicit_rk4_generic< test_array_type , double , test_array_type , double , range_algebra , default_operations , adjust_size_always_tag > rk4_gen_always_type;
+
+
typedef mpl::vector<
mpl::vector< euler_manual_type , mpl::int_<1> , mpl::int_<0> > ,
mpl::vector< euler_initially_type , mpl::int_<1> , mpl::int_<1> > ,
mpl::vector< euler_always_type , mpl::int_<1> , mpl::int_<3> > ,
mpl::vector< rk4_manual_type , mpl::int_<5> , mpl::int_<0> > ,
mpl::vector< rk4_initially_type , mpl::int_<5> , mpl::int_<1> > ,
- mpl::vector< rk4_always_type , mpl::int_<5> , mpl::int_<3> >
+ mpl::vector< rk4_always_type , mpl::int_<5> , mpl::int_<3> > ,
+ mpl::vector< rk4_gen_manual_type , mpl::int_<5> , mpl::int_<0> > ,
+ mpl::vector< rk4_gen_initially_type , mpl::int_<5> , mpl::int_<1> > ,
+ mpl::vector< rk4_gen_always_type , mpl::int_<5> , mpl::int_<3> >
>::type resize_check_types;
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