|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72320 - in sandbox/odeint/branches/karsten: boost/numeric/odeint/stepper boost/numeric/odeint/stepper/detail libs/numeric/odeint/regression_test libs/numeric/odeint/test
From: karsten.ahnert_at_[hidden]
Date: 2011-06-01 05:16:33
Author: karsten
Date: 2011-06-01 05:16:28 EDT (Wed, 01 Jun 2011)
New Revision: 72320
URL: http://svn.boost.org/trac/boost/changeset/72320
Log:
adams bashforth
Text files modified:
sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adams_bashforth.hpp | 5 -----
sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp | 19 -------------------
sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp | 2 +-
sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp | 6 ++++--
sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/adams_bashforth.cpp | 6 ++++--
sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/adams_bashforth_moulton.cpp | 4 ++--
sandbox/odeint/branches/karsten/libs/numeric/odeint/test/adams_bashforth.cpp | 6 +++---
7 files changed, 14 insertions(+), 34 deletions(-)
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adams_bashforth.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adams_bashforth.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adams_bashforth.hpp 2011-06-01 05:16:28 EDT (Wed, 01 Jun 2011)
@@ -24,9 +24,6 @@
-
-
-
namespace boost {
namespace numeric {
namespace odeint {
@@ -34,8 +31,6 @@
/*
* Static explicit Adams-Bashforth multistep-solver without step size control and without dense output.
- *
- * # Define the number of steps
*/
template<
size_t Steps ,
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp 2011-06-01 05:16:28 EDT (Wed, 01 Jun 2011)
@@ -69,25 +69,6 @@
order_type order( void ) const { return order_value; }
-
-
- adams_bashforth_moulton( void )
- {
- }
-
- ~adams_bashforth_moulton( void )
- {
- }
-
- adams_bashforth_moulton( const adams_bashforth_moulton &stepper )
- {
- }
-
- adams_bashforth_moulton& operator=( const adams_bashforth_moulton &stepper )
- {
- return *this;
- }
-
template< class System , class StateInOut >
void do_step( System system , StateInOut &x , const time_type &t , const time_type &dt )
{
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp 2011-06-01 05:16:28 EDT (Wed, 01 Jun 2011)
@@ -52,7 +52,7 @@
{
typedef typename Coefficients::value_type value_type;
Algebra::for_each5( out , in , steps[0] , steps[1] , steps[2] ,
- typename Operations::template scale_sum4< value_type , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] ) );
+ typename Operations::template scale_sum4< value_type , Time , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] ) );
}
};
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp 2011-06-01 05:16:28 EDT (Wed, 01 Jun 2011)
@@ -70,8 +70,10 @@
void rotate( void )
{
- ++m_first;
- if( m_first == dim ) m_first = 0;
+ if( m_first == 0 )
+ m_first = dim-1;
+ else
+ --m_first;
}
protected:
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/adams_bashforth.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/adams_bashforth.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/adams_bashforth.cpp 2011-06-01 05:16:28 EDT (Wed, 01 Jun 2011)
@@ -9,6 +9,7 @@
#include <iostream>
#include <boost/array.hpp>
+#include <boost/numeric/odeint/stepper/explicit_euler.hpp>
#include <boost/numeric/odeint/stepper/adams_bashforth.hpp>
#include <boost/numeric/odeint/integrate/integrate_n_steps.hpp>
@@ -57,7 +58,8 @@
double t = 0.0;
adams_bashforth< 3 , state_type > stepper;
- stepper.initialize( lorenz() , x , t , dt );
+ explicit_euler< state_type > euler;
+ stepper.initialize( euler , lorenz() , x , t , dt );
- integrate_n_steps( stepper , lorenz() , x , t , dt , 10000 , writing_observer( cout ) );
+ integrate_n_steps( stepper , lorenz() , x , 0.0 , 0.01 , 10000 , writing_observer( cout ) );
}
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/adams_bashforth_moulton.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/adams_bashforth_moulton.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/adams_bashforth_moulton.cpp 2011-06-01 05:16:28 EDT (Wed, 01 Jun 2011)
@@ -56,8 +56,8 @@
const double dt = 0.01;
double t = 0.0;
- adams_bashforth_moulton< 3 , state_type > stepper;
+ adams_bashforth_moulton< 5 , state_type > stepper;
stepper.initialize( lorenz() , x , t , dt );
- integrate_n_steps( stepper , lorenz() , x , t , dt , 1000 , writing_observer( cout ) );
+ integrate_n_steps( stepper , lorenz() , x , t , dt , 10000 , writing_observer( cout ) );
}
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/adams_bashforth.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/adams_bashforth.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/adams_bashforth.cpp 2011-06-01 05:16:28 EDT (Wed, 01 Jun 2011)
@@ -73,9 +73,9 @@
buffer.rotate();
- for( size_t i=0 ; i<N-1 ; ++i )
- BOOST_CHECK_EQUAL( buffer[i] , i + 1 );
- BOOST_CHECK_EQUAL( buffer[N-1] , size_t( 0 ) );
+ for( size_t i=1 ; i<N ; ++i )
+ BOOST_CHECK_EQUAL( buffer[i] , i - 1 );
+ BOOST_CHECK_EQUAL( buffer[0] , size_t( N-1 ) );
}
BOOST_AUTO_TEST_CASE( test_copying )
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