|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71911 - sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4
From: karsten.ahnert_at_[hidden]
Date: 2011-05-13 04:26:47
Author: karsten
Date: 2011-05-13 04:26:45 EDT (Fri, 13 May 2011)
New Revision: 71911
URL: http://svn.boost.org/trac/boost/changeset/71911
Log:
performance test taylor v4 now with absolute value
Text files modified:
sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_lorenz_evol_adaptive_statistics.cpp | 57 ++++++++++++++++++++++-----------------
1 files changed, 32 insertions(+), 25 deletions(-)
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_lorenz_evol_adaptive_statistics.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_lorenz_evol_adaptive_statistics.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/taylor/taylor_v4/taylor_lorenz_evol_adaptive_statistics.cpp 2011-05-13 04:26:45 EDT (Fri, 13 May 2011)
@@ -48,11 +48,12 @@
struct run
{
+ vector< double > m_eps_abs_values;
vector< double > m_eps_rel_values;
double m_t_end;
- run( const vector< double > &eps_rel_values , double t_end )
- : m_eps_rel_values( eps_rel_values ) , m_t_end( t_end ){ }
+ run( const vector< double > &eps_abs_values , const vector< double > &eps_rel_values , double t_end )
+ : m_eps_abs_values( eps_abs_values ) , m_eps_rel_values( eps_rel_values ) , m_t_end( t_end ){ }
template< class Order >
void operator()( Order ) const
@@ -66,33 +67,37 @@
sprintf( str , "dat/lorenz_taylor_%02d.dat" , int( order ) );
ofstream fout( str );
- for( size_t j=0 ; j<m_eps_rel_values.size() ; ++j )
+ for( size_t i=0 ; i<m_eps_abs_values.size() ; ++i )
{
- double eps_rel = m_eps_rel_values[j];
+ for( size_t j=0 ; j<m_eps_rel_values.size() ; ++j )
+ {
+ double eps_abs = m_eps_abs_values[i];
+ double eps_rel = m_eps_rel_values[j];
- taylor_type taylor( eps_rel );
+ taylor_type taylor( eps_rel , eps_abs );
- state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
- timer.restart();
- size_t steps_taylor = 0;
- double t = 0.0 , dt = 1.0;
- while( t < m_t_end )
- {
- taylor.try_step(
- fusion::make_vector
- (
- sigma * ( arg2 - arg1 ) ,
- R * arg1 - arg2 - arg1 * arg3 ,
- arg1 * arg2 - b * arg3
- ) , x , t , dt );
- steps_taylor++;
+ timer.restart();
+ size_t steps_taylor = 0;
+ double t = 0.0 , dt = 1.0;
+ while( t < m_t_end )
+ {
+ taylor.try_step(
+ fusion::make_vector
+ (
+ sigma * ( arg2 - arg1 ) ,
+ R * arg1 - arg2 - arg1 * arg3 ,
+ arg1 * arg2 - b * arg3
+ ) , x , t , dt );
+ steps_taylor++;
+ }
+ double time_taylor = timer.elapsed();
+
+ fout << i << tab << j << tab << eps_abs << tab << eps_rel << tab;
+ fout << steps_taylor << tab << time_taylor;
+ fout << endl;
}
- double time_taylor = timer.elapsed();
-
- fout << j << tab << eps_rel << tab;
- fout << steps_taylor << tab << time_taylor;
- fout << endl;
}
}
};
@@ -109,13 +114,15 @@
}
double t_end = atof( argv[1] );
+ vector< double > eps_abs_values;
vector< double > eps_rel_values;
+ eps_abs_values += 1.0e1 , 1.0 , 1.0e-1 , 1.0e-2 , 1.0e-3 , 1.0e-4 , 1.0e-5 , 1.0e-6 , 1.0e-7 , 1.0e-8 , 1.0e-9 , 1.0e-10 , 1.0e-11 , 1.0e-12 , 1.0e-13 , 1.0e-14;
eps_rel_values += 1.0e-1 , 1.0e-2 , 1.0e-3 , 1.0e-4 , 1.0e-5 , 1.0e-6 , 1.0e-7 , 1.0e-8 , 1.0e-9 , 1.0e-10 , 1.0e-11 , 1.0e-12 , 1.0e-13 , 1.0e-14;
typedef mpl::range_c< size_t , 5 , 30 > order_values;
- mpl::for_each< order_values >( run( eps_rel_values , t_end ) );
+ mpl::for_each< order_values >( run( eps_abs_values , eps_rel_values , t_end ) );
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