Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63926 - in sandbox/odeint/branches/karsten/boost/numeric/odeint: algebra stepper
From: mario.mulansky_at_[hidden]
Date: 2010-07-12 10:44:24


Author: mariomulansky
Date: 2010-07-12 10:44:23 EDT (Mon, 12 Jul 2010)
New Revision: 63926
URL: http://svn.boost.org/trac/boost/changeset/63926

Log:
named adjust_size2 back to adjust_size
Text files modified:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_algebra.hpp | 27 +++++++++++++++++++++++++++
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_operations.hpp | 14 ++++++++++++++
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_resize.hpp | 2 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp | 2 +-
   4 files changed, 43 insertions(+), 2 deletions(-)

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_algebra.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_algebra.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_algebra.hpp 2010-07-12 10:44:23 EDT (Mon, 12 Jul 2010)
@@ -45,6 +45,33 @@
                 for( ; first1 != last1 ; )
                         op( *first1++ , *first2++ );
         }
+
+
+ template< class StateType1 , class StateType2 , class StateType3 , class Operation >
+ static void transform3( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , Operation op )
+ {
+ // ToDo : check that number of arguments of the operation is equal 3
+
+ // ToDo : generate macro
+ BOOST_STATIC_ASSERT(( boost::is_same< typename boost::remove_const< StateType1 >::type , container_type >::value ));
+ BOOST_STATIC_ASSERT(( boost::is_same< typename boost::remove_const< StateType2 >::type , container_type >::value ));
+ BOOST_STATIC_ASSERT(( boost::is_same< typename boost::remove_const< StateType3 >::type , container_type >::value ));
+
+ // ToDo : pack into detail namespace
+ transform2( boost::begin( s1 ) , boost::end( s1 ) ,
+ boost::begin( s2 ) ,
+ boost::begin( s3 ) ,
+ op );
+ }
+
+ // ToDo : pack into namespace detail
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Operation >
+ static void transform3( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ );
+ }
+
 };
 
 } // odeint

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_operations.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_operations.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_operations.hpp 2010-07-12 10:44:23 EDT (Mon, 12 Jul 2010)
@@ -38,6 +38,20 @@
                         t1 += m_dt * t2;
                 }
         };
+
+ struct scale_sum2
+ {
+ time_type m_alpha1;
+ time_type m_alpha2;
+
+ scale_sum2( time_type alpha1 , time_type alpha2 ) : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { }
+
+ template< class T1 , class T2 , class T3 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3;
+ }
+ };
 };
 
 

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_resize.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_resize.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_resize.hpp 2010-07-12 10:44:23 EDT (Mon, 12 Jul 2010)
@@ -40,7 +40,7 @@
 }
 
 template< class Container >
-void adjust_size2( const Container &x1 , Container &x2 )
+void adjust_size( const Container &x1 , Container &x2 )
 {
         if( !same_size( x1 , x2 ) ) resize( x1 , x2 );
 }

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp 2010-07-12 10:44:23 EDT (Mon, 12 Jul 2010)
@@ -73,7 +73,7 @@
 
         void adjust_size_impl( const state_type &x )
         {
- adjust_size2( x , m_dxdt );
+ adjust_size( x , m_dxdt );
         }
 
 


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