Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66942 - in sandbox/odeint/branches/karsten: boost/numeric/odeint/algebra boost/numeric/odeint/algebra/detail boost/numeric/odeint/stepper libs/numeric/odeint/test
From: karsten.ahnert_at_[hidden]
Date: 2010-12-01 07:51:34


Author: karsten
Date: 2010-12-01 07:51:28 EST (Wed, 01 Dec 2010)
New Revision: 66942
URL: http://svn.boost.org/trac/boost/changeset/66942

Log:
* removing the dependency of standard_algebra on the container_type
Text files modified:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/detail/for_each.hpp | 7 +++++
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_algebra.hpp | 53 ++++++---------------------------------
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_explicit_euler.hpp | 2
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/error_checker.hpp | 2
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp | 2
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp | 2
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp | 2
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4.hpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_resize.cpp | 14 +++++-----
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_stepper_concepts.cpp | 2
   10 files changed, 29 insertions(+), 59 deletions(-)

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/detail/for_each.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/detail/for_each.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/detail/for_each.hpp 2010-12-01 07:51:28 EST (Wed, 01 Dec 2010)
@@ -19,6 +19,13 @@
 namespace detail {
 
 
+template< class Iterator1 , class Operation >
+inline void for_each1( Iterator1 first1 , Iterator1 last1 , Operation op )
+{
+ for( ; first1 != last1 ; )
+ op( *first1++ );
+}
+
 
 template< class Iterator1 , class Iterator2 , class Operation >
 inline void for_each2( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Operation op )

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-12-01 07:51:28 EST (Wed, 01 Dec 2010)
@@ -26,21 +26,23 @@
 namespace numeric {
 namespace odeint {
 
-template< class Container >
 struct standard_algebra
 {
     // leave standard algebra empty when using nvcc cause we don't habe boost::range then
     // for using thrust and compiling with nvcc thrust_algebra should be used
 #ifndef __CUDACC__
- typedef Container container_type;
+
+ template< class StateType1 , class Operation >
+ static void for_each1( StateType1 &s1 , Operation op )
+ {
+ detail::for_each1( boost::begin( s1 ) , boost::end( s1 ) ,
+ op );
+ }
+
 
         template< class StateType1 , class StateType2 , class Operation >
         static void for_each2( StateType1 &s1 , StateType2 &s2 , Operation op )
         {
- // ToDo : check that number of arguments of the operation is equal 2
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType1 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType2 , container_type );
-
                 detail::for_each2( boost::begin( s1 ) , boost::end( s1 ) ,
                                    boost::begin( s2 ) , op );
         }
@@ -50,10 +52,6 @@
         template< class StateType1 , class StateType2 , class StateType3 , class Operation >
         static void for_each3( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , Operation op )
         {
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType1 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType2 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType3 , container_type );
-
                 detail::for_each3( boost::begin( s1 ) , boost::end( s1 ) ,
                                                    boost::begin( s2 ) ,
                                                    boost::begin( s3 ) ,
@@ -66,11 +64,6 @@
         template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , class Operation >
         static void for_each4( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 , Operation op )
         {
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType1 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType2 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType3 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType4 , container_type );
-
                 detail::for_each4( boost::begin( s1 ) , boost::end( s1 ) ,
                                                    boost::begin( s2 ) ,
                                                    boost::begin( s3 ) ,
@@ -84,12 +77,6 @@
         template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , class StateType5 , class Operation >
         static void for_each5( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 , StateType5 &s5 , Operation op )
         {
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType1 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType2 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType3 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType4 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType5 , container_type );
-
                 detail::for_each5( boost::begin( s1 ) , boost::end( s1 ) ,
                                                    boost::begin( s2 ) ,
                                                    boost::begin( s3 ) ,
@@ -104,13 +91,6 @@
         template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , class StateType5 , class StateType6 , class Operation >
         static void for_each6( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 , StateType5 &s5 , StateType6 &s6 , Operation op )
         {
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType1 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType2 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType3 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType4 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType5 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType6 , container_type );
-
                 detail::for_each6( boost::begin( s1 ) , boost::end( s1 ) ,
                                                    boost::begin( s2 ) ,
                                                    boost::begin( s3 ) ,
@@ -125,14 +105,6 @@
         template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , class StateType5 , class StateType6 ,class StateType7 , class Operation >
         static void for_each7( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 , StateType5 &s5 , StateType6 &s6 , StateType7 &s7 , Operation op )
         {
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType1 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType2 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType3 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType4 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType5 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType6 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType7 , container_type );
-
                 detail::for_each7( boost::begin( s1 ) , boost::end( s1 ) ,
                                                    boost::begin( s2 ) ,
                                                    boost::begin( s3 ) ,
@@ -146,15 +118,6 @@
         template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , class StateType5 , class StateType6 ,class StateType7 , class StateType8 , class Operation >
         static void for_each8( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 , StateType5 &s5 , StateType6 &s6 , StateType7 &s7 , StateType8 &s8 , Operation op )
         {
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType1 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType2 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType3 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType4 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType5 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType6 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType7 , container_type );
- BOOST_ODEINT_CHECK_CONTAINER_TYPE( StateType8 , container_type );
-
                 detail::for_each8( boost::begin( s1 ) , boost::end( s1 ) ,
                                                    boost::begin( s2 ) ,
                                                    boost::begin( s3 ) ,

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_explicit_euler.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_explicit_euler.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_explicit_euler.hpp 2010-12-01 07:51:28 EST (Wed, 01 Dec 2010)
@@ -23,7 +23,7 @@
 template<
     class State ,
     class Time = double ,
- class Algebra = standard_algebra< State > ,
+ class Algebra = standard_algebra ,
         class Operations = standard_operations< Time > ,
         class AdjustSizePolicy = adjust_size_initially_tag
>

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/error_checker.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/error_checker.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/error_checker.hpp 2010-12-01 07:51:28 EST (Wed, 01 Dec 2010)
@@ -23,7 +23,7 @@
 
 template< class State ,
                    class Time ,
- class Algebra = standard_algebra< State > ,
+ class Algebra = standard_algebra ,
                    class Operations = standard_operations< Time > >
 class error_checker_standard
 {

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp 2010-12-01 07:51:28 EST (Wed, 01 Dec 2010)
@@ -30,7 +30,7 @@
 template<
     class State ,
     class Time = double ,
- class Algebra = standard_algebra< State > ,
+ class Algebra = standard_algebra ,
         class Operations = standard_operations< Time > ,
         class AdjustSizePolicy = adjust_size_initially_tag
>

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp 2010-12-01 07:51:28 EST (Wed, 01 Dec 2010)
@@ -36,7 +36,7 @@
 template<
     class State ,
     class Time = double ,
- class Algebra = standard_algebra< State > ,
+ class Algebra = standard_algebra ,
         class Operations = standard_operations< Time > ,
         class AdjustSizePolicy = adjust_size_initially_tag
>

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-12-01 07:51:28 EST (Wed, 01 Dec 2010)
@@ -29,7 +29,7 @@
 template<
     class State ,
     class Time = double ,
- class Algebra = standard_algebra< State > ,
+ class Algebra = standard_algebra ,
         class Operations = standard_operations< Time > ,
         class AdjustSizePolicy = adjust_size_initially_tag
>

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4.hpp 2010-12-01 07:51:28 EST (Wed, 01 Dec 2010)
@@ -29,7 +29,7 @@
 template<
     class State ,
     class Time = double ,
- class Algebra = standard_algebra< State > ,
+ class Algebra = standard_algebra ,
         class Operations = standard_operations< Time > ,
         class AdjustSizePolicy = adjust_size_initially_tag
>

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_resize.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_resize.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_resize.cpp 2010-12-01 07:51:28 EST (Wed, 01 Dec 2010)
@@ -61,13 +61,13 @@
 BOOST_AUTO_TEST_SUITE( check_resize_test )
 
 
-typedef explicit_euler< test_array_type , double , standard_algebra< test_array_type > , standard_operations< double > , adjust_size_manually_tag > euler_manual_type;
-typedef explicit_euler< test_array_type , double , standard_algebra< test_array_type > , standard_operations< double > , adjust_size_initially_tag > euler_initially_type;
-typedef explicit_euler< test_array_type , double , standard_algebra< test_array_type > , standard_operations< double > , adjust_size_always_tag > euler_always_type;
-
-typedef explicit_rk4< test_array_type , double , standard_algebra< test_array_type > , standard_operations< double > , adjust_size_manually_tag > rk4_manual_type;
-typedef explicit_rk4< test_array_type , double , standard_algebra< test_array_type > , standard_operations< double > , adjust_size_initially_tag > rk4_initially_type;
-typedef explicit_rk4< test_array_type , double , standard_algebra< test_array_type > , standard_operations< double > , adjust_size_always_tag > rk4_always_type;
+typedef explicit_euler< test_array_type , double , standard_algebra , standard_operations< double > , adjust_size_manually_tag > euler_manual_type;
+typedef explicit_euler< test_array_type , double , standard_algebra , standard_operations< double > , adjust_size_initially_tag > euler_initially_type;
+typedef explicit_euler< test_array_type , double , standard_algebra , standard_operations< double > , adjust_size_always_tag > euler_always_type;
+
+typedef explicit_rk4< test_array_type , double , standard_algebra , standard_operations< double > , adjust_size_manually_tag > rk4_manual_type;
+typedef explicit_rk4< test_array_type , double , standard_algebra , standard_operations< double > , adjust_size_initially_tag > rk4_initially_type;
+typedef explicit_rk4< test_array_type , double , standard_algebra , standard_operations< double > , adjust_size_always_tag > rk4_always_type;
 
 
 typedef mpl::vector<

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_stepper_concepts.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_stepper_concepts.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_stepper_concepts.cpp 2010-12-01 07:51:28 EST (Wed, 01 Dec 2010)
@@ -53,7 +53,7 @@
 typedef mpl::vector< vector_type , vector_space_type , array_type >::type container_types;
 
 
-template< class State > struct algebra_dispatcher { typedef standard_algebra< State > type; };
+template< class State > struct algebra_dispatcher { typedef standard_algebra type; };
 template<> struct algebra_dispatcher< vector_space_type > { typedef vector_space_algebra type; };
 
 


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