diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-04-08 03:09:47 +0000 |
---|---|---|
committer | <> | 2015-05-05 14:37:32 +0000 |
commit | f2541bb90af059680aa7036f315f052175999355 (patch) | |
tree | a5b214744b256f07e1dc2bd7273035a7808c659f /libs/numeric/odeint/performance/rk_performance_test_case.hpp | |
parent | ed232fdd34968697a68783b3195b1da4226915b5 (diff) | |
download | boost-tarball-master.tar.gz |
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2.HEADboost_1_58_0master
Diffstat (limited to 'libs/numeric/odeint/performance/rk_performance_test_case.hpp')
-rw-r--r-- | libs/numeric/odeint/performance/rk_performance_test_case.hpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/libs/numeric/odeint/performance/rk_performance_test_case.hpp b/libs/numeric/odeint/performance/rk_performance_test_case.hpp deleted file mode 100644 index fa9988b7d..000000000 --- a/libs/numeric/odeint/performance/rk_performance_test_case.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * rk_performance_test_case.hpp - * - * Copyright 2011-2012 Mario Mulansky - * Copyright 2012 Karsten Ahnert - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#include <iostream> -#include <boost/accumulators/accumulators.hpp> -#include <boost/accumulators/statistics.hpp> -#include <boost/timer.hpp> - -#define tab "\t" - -using namespace std; -using namespace boost::accumulators; - -typedef accumulator_set< - double , stats< tag::mean , tag::variance > - > accumulator_type; - -ostream& operator<<( ostream& out , accumulator_type &acc ) -{ - out << boost::accumulators::mean( acc ) << tab; -// out << boost::accumulators::variance( acc ) << tab; - return out; -} - -typedef boost::timer timer_type; - - -template< class Stepper > -void run( Stepper &stepper , const size_t num_of_steps = 20000000 , const double dt = 1E-10 ) -{ - const size_t loops = 20; - - accumulator_type acc; - timer_type timer; - - srand( 12312354 ); - - // transient - //stepper.reset_init_cond( ); - //for( size_t i = 0 ; i < num_of_steps ; ++i ) - // stepper.do_step( dt ); - - for( size_t n=0 ; n<loops+1 ; ++n ) - { - stepper.reset_init_cond( ); - - timer.restart(); - for( size_t i = 0 ; i < num_of_steps ; ++i ) - stepper.do_step( dt ); - if( n>0 ) - { // take first run as transient - acc(timer.elapsed()); - clog.precision(8); - clog.width(10); - clog << acc << " " << stepper.state(0) << endl; - } - } - cout << acc << endl; -} |