Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68351 - in sandbox/odeint/branches/karsten: . boost/numeric/odeint/algebra boost/numeric/odeint/algebra/external boost/numeric/odeint/stepper boost/numeric/odeint/stepper/base libs/numeric/odeint/ideas/units libs/numeric/odeint/regression_test libs/numeric/odeint/test libs/numeric/odeint/test/gmp libs/numeric/odeint/test/gsl libs/numeric/odeint/test/mkl libs/numeric/odeint/test/thrust libs/numeric/odeint/test_external libs/numeric/odeint/test_external/gmp libs/numeric/odeint/test_external/gsl libs/numeric/odeint/test_external/mkl libs/numeric/odeint/test_external/thrust
From: karsten.ahnert_at_[hidden]
Date: 2011-01-21 11:50:32


Author: karsten
Date: 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
New Revision: 68351
URL: http://svn.boost.org/trac/boost/changeset/68351

Log:
* reorganizing tests
* changing algebra in order to work with boost.range
Added:
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/controlled_stepper_evolution.cpp (contents, props changed)
      - copied, changed from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/controlled_stepper_evolution.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_stepper_evolution.cpp (contents, props changed)
      - copied, changed from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_stepper_evolution.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_dopri5.cpp (contents, props changed)
      - copied, changed from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_dopri5.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_explicit_euler.cpp (contents, props changed)
      - copied, changed from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_explicit_euler.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/implicit_euler.cpp (contents, props changed)
      - copied, changed from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_implicit_euler.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp (contents, props changed)
      - copied, changed from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_resize.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_algebra.cpp (contents, props changed)
      - copied, changed from r68348, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_algebra.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_operations.cpp (contents, props changed)
      - copied, changed from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_operations.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp (contents, props changed)
      - copied, changed from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_stepper_concepts.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/
      - copied from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/gmp/
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/
      - copied from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/gsl/
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/mkl/
      - copied from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/mkl/
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/
      - copied from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/thrust/
Removed:
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_algebra.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_dopri5.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_explicit_euler.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_implicit_euler.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_operations.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_resize.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_stepper_concepts.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/controlled_stepper_evolution.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_stepper_evolution.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/gmp/
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/gsl/
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/mkl/
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/thrust/
Text files modified:
   sandbox/odeint/branches/karsten/Jamroot | 12 +
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/external/thrust_algebra.hpp | 80 +++++------
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_algebra.hpp | 268 +++++++++++++--------------------------
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_operations.hpp | 2
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/vector_space_algebra.hpp | 170 +++++++++++++++++-------
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp | 3
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp | 2
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_dopri5.hpp | 2
   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 | 5
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp | 14 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp | 14 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp | 3
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4.hpp | 8
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/explicit_euler_units.hpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile | 32 +---
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_dopri5.cpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_explicit_euler.cpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/implicit_euler.cpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp | 8
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_algebra.cpp | 76 ++++++++---
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_operations.cpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp | 8
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/Jamfile | 11 -
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/check_gmp.cpp | 4
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/Jamfile | 1
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/check_gsl.cpp | 4
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/mkl/Jamfile | 1
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/Makefile | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/check_thrust.cu | 2
   30 files changed, 375 insertions(+), 369 deletions(-)

Modified: sandbox/odeint/branches/karsten/Jamroot
==============================================================================
--- sandbox/odeint/branches/karsten/Jamroot (original)
+++ sandbox/odeint/branches/karsten/Jamroot 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -16,6 +16,14 @@
 
 build-project libs/numeric/odeint/test ;
 build-project libs/numeric/odeint/examples ;
+build-project libs/numeric/odeint/regression_test ;
+
+
+# additional tests with external libraries :
+build-project libs/numeric/odeint/test_external/gmp ;
+# build-project libs/numeric/odeint/test_external/mkl ;
+build-project libs/numeric/odeint/test_external/gsl ;
+
 
 
 
@@ -25,10 +33,6 @@
 build-project libs/numeric/odeint/ideas/rosenbrock4 ;
 build-project libs/numeric/odeint/ideas/units ;
 
-# additional tests with external libraries :
-build-project libs/numeric/odeint/test/gmp ;
-# build-project libs/numeric/odeint/test/mkl ;
-build-project libs/numeric/odeint/test/gsl ;
 
 # docs:
 # build-project libs/numeric/odeint/doc ;

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/external/thrust_algebra.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/external/thrust_algebra.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/external/thrust_algebra.hpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -17,6 +17,9 @@
 #include <thrust/iterator/zip_iterator.h>
 
 #include <boost/range.hpp>
+#define BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY 9
+#include <boost/functional/forward_adapter.hpp>
+
 
 namespace boost {
 namespace numeric {
@@ -32,60 +35,51 @@
 
 struct thrust_algebra
 {
- template< class StateType , class Operation >
- static void for_each1( StateType &s , Operation op )
- {
- thrust::for_each( boost::begin(s) , boost::begin(s) , op );
- }
-
- template< class StateType , class Operation >
- static void for_each1( const StateType &s , Operation op )
+ struct for_each1_impl
         {
- thrust::for_each( boost::begin(s) , boost::begin(s) , op );
- }
-
-
-
-
+ template< class StateType , class Operation >
+ void operator()( StateType &s , Operation op ) const
+ {
+ thrust::for_each( boost::begin(s) , boost::begin(s) , op );
+ }
+ typedef void result_type;
+ };
 
 
-
- template< class StateType1 , class StateType2 , class Operation >
- static void for_each2( StateType1 &s1 , StateType2 &s2 , Operation op )
- {
- thrust::for_each( thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , boost::begin(s2) ) ) ,
- thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , boost::end(s2) ) ) ,
- op);
- }
-
- template< class StateType1 , class StateType2 , class Operation >
- static void for_each2( const StateType1 &s1 , const StateType2 &s2 , Operation op )
+ struct for_each2_impl
         {
- thrust::for_each( thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , boost::begin(s2) ) ) ,
- thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , boost::end(s2) ) ) ,
- op);
- }
 
+ template< class StateType1 , class StateType2 , class Operation >
+ void operator()( StateType1 &s1 , StateType2 &s2 , Operation op ) const
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , boost::begin(s2) ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , boost::end(s2) ) ) ,
+ op);
+ }
+ typedef void result_type;
+ };
 
 
 
+ struct for_each3_impl
+ {
 
 
- template< class StateType1 , class StateType2 , class StateType3 , class Operation >
- static void for_each3( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , Operation op )
- {
- thrust::for_each( thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , boost::begin(s2) , boost::begin(s3) ) ) ,
- thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , boost::end(s2) , boost::begin(s3) ) ) ,
- op);
- }
+ template< class StateType1 , class StateType2 , class StateType3 , class Operation >
+ void operator()( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , Operation op ) const
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , boost::begin(s2) , boost::begin(s3) ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , boost::end(s2) , boost::begin(s3) ) ) ,
+ op);
+ }
+ typedef void result_type;
+ };
 
- template< class StateType1 , class StateType2 , class StateType3 , class Operation >
- static void for_each3( const StateType1 &s1 , const StateType2 &s2 , const StateType3 &s3 , Operation op )
- {
- thrust::for_each( thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , boost::begin(s2) , boost::begin(s3) ) ) ,
- thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , boost::end(s2) , boost::begin(s3) ) ) ,
- op);
- }
+ typedef boost::forward_adapter< for_each1_impl , 2 > for_each1;
+ typedef boost::forward_adapter< for_each2_impl , 3 > for_each2;
+ typedef boost::forward_adapter< for_each3_impl , 4 > for_each3;
 };
 
 

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 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -8,13 +8,14 @@
  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)
-*/
+ */
 
 #ifndef BOOST_BOOST_NUMERIC_ODEINT_STANDARD_ALGEBRA_HPP_INCLUDED
 #define BOOST_BOOST_NUMERIC_ODEINT_STANDARD_ALGEBRA_HPP_INCLUDED
 
-//boost range does not work with nvcc
 #include <boost/range.hpp>
+#define BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY 9
+#include <boost/functional/forward_adapter.hpp>
 
 #include <boost/numeric/odeint/algebra/detail/macros.hpp>
 #include <boost/numeric/odeint/algebra/detail/for_each.hpp>
@@ -24,233 +25,148 @@
 namespace numeric {
 namespace odeint {
 
-/*
- * Hints:
- *
- * 1. The const versions are needed for boost.range to work, i.e.
- * it allows you to do
- * for_each1( make_pair( vec1.begin() , vec1.begin() + 10 ) , op );
- *
- */
 struct standard_algebra
 {
- template< class StateType1 , class Operation >
- static void for_each1( StateType1 &s1 , Operation op )
+ struct for_each1_impl
         {
- detail::for_each1( boost::begin( s1 ) , boost::end( s1 ) ,
- op );
- }
+ template< class S1 , class Op >
+ void operator()( S1 &s1 , Op op ) const
+ {
+ detail::for_each1( boost::begin( s1 ) , boost::end( s1 ) ,
+ op );
+ }
+ typedef void result_type;
+ };
 
- template< class StateType1 , class Operation >
- static void for_each1( const StateType1 &s1 , Operation op )
+ struct for_each2_impl
         {
- detail::for_each1( boost::begin( s1 ) , boost::end( s1 ) ,
- op );
- }
-
-
+ template< class S1 , class S2 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , Op op ) const
+ {
+ detail::for_each2( boost::begin( s1 ) , boost::end( s1 ) ,
+ boost::begin( s2 ) , op );
+ }
+ typedef void result_type;
+ };
 
 
-
- template< class StateType1 , class StateType2 , class Operation >
- static void for_each2( StateType1 &s1 , StateType2 &s2 , Operation op )
+ struct for_each3_impl
         {
- detail::for_each2( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) , op );
- }
 
- template< class StateType1 , class StateType2 , class Operation >
- static void for_each2( const StateType1 &s1 , const StateType2 &s2 , Operation op )
- {
- detail::for_each2( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) , op );
- }
+ template< class S1 , class S2 , class S3 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , Op op ) const
+ {
+ detail::for_each3( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , op );
+ }
+ typedef void result_type;
+ };
 
 
 
 
 
- template< class StateType1 , class StateType2 , class StateType3 , class Operation >
- static void for_each3( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , Operation op )
+ struct for_each4_impl
         {
- detail::for_each3( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- op );
- }
 
- template< class StateType1 , class StateType2 , class StateType3 , class Operation >
- static void for_each3( const StateType1 &s1 , const StateType2 &s2 , const StateType3 &s3 , Operation op )
- {
- detail::for_each3( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- op );
- }
+ template< class S1 , class S2 , class S3 , class S4 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op ) const
+ {
+ detail::for_each4( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , op );
+ }
+ typedef void result_type;
+ };
 
 
 
 
-
-
- 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 )
+ struct for_each5_impl
         {
- detail::for_each4( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- boost::begin( s4 ) ,
- op );
- }
 
- template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , class Operation >
- static void for_each4( const StateType1 &s1 , const StateType2 &s2 , const StateType3 &s3 , const StateType4 &s4 , Operation op )
- {
- detail::for_each4( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- boost::begin( s4 ) ,
- op );
- }
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op ) const
+ {
+ detail::for_each5( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , op );
+ }
+ typedef void result_type;
+ };
 
 
 
 
 
- 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 )
- {
- detail::for_each5( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- boost::begin( s4 ) ,
- boost::begin( s5 ) ,
- op );
- }
 
- template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , class StateType5 , class Operation >
- static void for_each5( const StateType1 &s1 , const StateType2 &s2 , const StateType3 &s3 , const StateType4 &s4 , const StateType5 &s5 , Operation op )
+ struct for_each6_impl
         {
- detail::for_each5( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- boost::begin( s4 ) ,
- boost::begin( s5 ) ,
- op );
- }
-
 
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op ) const
+ {
+ detail::for_each6( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , op );
+ }
+ typedef void result_type;
+ };
 
 
 
 
 
- 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 )
- {
- detail::for_each6( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- boost::begin( s4 ) ,
- boost::begin( s5 ) ,
- boost::begin( s6 ) ,
- op );
- }
 
- template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , class StateType5 , class StateType6 , class Operation >
- static void for_each6( const StateType1 &s1 , const StateType2 &s2 , const StateType3 &s3 , const StateType4 &s4 , const StateType5 &s5 , const StateType6 &s6 , Operation op )
+ struct for_each7_impl
         {
- detail::for_each6( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- boost::begin( s4 ) ,
- boost::begin( s5 ) ,
- boost::begin( s6 ) ,
- op );
- }
 
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op ) const
+ {
+ detail::for_each7( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , op );
+ }
+ typedef void result_type;
+ };
 
 
 
 
 
 
- 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 )
+ struct for_each8_impl
         {
- detail::for_each7( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- boost::begin( s4 ) ,
- boost::begin( s5 ) ,
- boost::begin( s6 ) ,
- boost::begin( s7 ) ,
- op );
- }
-
- template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , class StateType5 , class StateType6 ,class StateType7 , class Operation >
- static void for_each7( const StateType1 &s1 , const StateType2 &s2 , const StateType3 &s3 , const StateType4 &s4 , const StateType5 &s5 , const StateType6 &s6 , const StateType7 &s7 , Operation op )
- {
- detail::for_each7( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- boost::begin( s4 ) ,
- boost::begin( s5 ) ,
- boost::begin( s6 ) ,
- boost::begin( s7 ) ,
- op );
- }
-
-
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op ) const
+ {
+ detail::for_each8( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , op );
+ }
+ typedef void result_type;
+ };
 
 
 
 
-
-
- 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 )
+ struct reduce
         {
- detail::for_each8( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- boost::begin( s4 ) ,
- boost::begin( s5 ) ,
- boost::begin( s6 ) ,
- boost::begin( s7 ) ,
- boost::begin( s8 ) ,
- op );
- }
+ template< class Value , class S , class Red >
+ Value operator()( const S &s , Red red , Value init) const
+ {
+ return detail::reduce( boost::begin( s ) , boost::end( s ) , red , init );
+ }
 
- template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , class StateType5 , class StateType6 ,class StateType7 , class StateType8 , class Operation >
- static void for_each8( const StateType1 &s1 , const StateType2 &s2 , const StateType3 &s3 , const StateType4 &s4 , const StateType5 &s5 , const StateType6 &s6 , const StateType7 &s7 , const StateType8 &s8 , Operation op )
- {
- detail::for_each8( boost::begin( s1 ) , boost::end( s1 ) ,
- boost::begin( s2 ) ,
- boost::begin( s3 ) ,
- boost::begin( s4 ) ,
- boost::begin( s5 ) ,
- boost::begin( s6 ) ,
- boost::begin( s7 ) ,
- boost::begin( s8 ) ,
- op );
- }
+// template< class T > struct result;
+//
+// template< class F , class T1 , class T2 , class T3 >
+// struct result< F( T1 , T2 , T3 ) >
+// {
+// typedef T3 type;
+// };
+ };
 
 
-
-
-
- template< class ValueType , class StateType , class Reduction >
- static ValueType reduce( StateType &s , Reduction red , ValueType init)
- {
- return detail::reduce( boost::begin( s ) , boost::end( s ) , red , init );
- }
-
- template< class ValueType , class StateType , class Reduction >
- static ValueType reduce( const StateType &s , Reduction red , ValueType init)
- {
- return detail::reduce( boost::begin( s ) , boost::end( s ) , red , init );
- }
+ typedef boost::forward_adapter< for_each1_impl , 2 > for_each1;
+ typedef boost::forward_adapter< for_each2_impl , 3 > for_each2;
+ typedef boost::forward_adapter< for_each3_impl , 4 > for_each3;
+ typedef boost::forward_adapter< for_each4_impl , 5 > for_each4;
+ typedef boost::forward_adapter< for_each5_impl , 6 > for_each5;
+ typedef boost::forward_adapter< for_each6_impl , 7 > for_each6;
+ typedef boost::forward_adapter< for_each7_impl , 8 > for_each7;
+ typedef boost::forward_adapter< for_each8_impl , 9 > for_each8;
+// typedef boost::forward_adapter< reduce_impl , 3 > reduce;
 
 };
 

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 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -34,7 +34,7 @@
                 scale_sum1( const Fac1 &alpha1 ) : m_alpha1( alpha1 ) { }
 
                 template< class T1 , class T2 >
- void operator()( T1 &t1 , const T2 &t2 )
+ void operator()( T1 &t1 , const T2 &t2 ) const
                 {
                         t1 = m_alpha1 * t2;
                 }

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/vector_space_algebra.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/vector_space_algebra.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/vector_space_algebra.hpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -8,12 +8,14 @@
  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)
-*/
+ */
 
 #ifndef BOOST_BOOST_NUMERIC_ODEINT_VECTOR_SPACE_ALGEBRA_HPP_INCLUDED
 #define BOOST_BOOST_NUMERIC_ODEINT_VECTOR_SPACE_ALGEBRA_HPP_INCLUDED
 
 #include <boost/numeric/odeint/algebra/vector_space_reduce.hpp>
+#define BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY 9
+#include <boost/functional/forward_adapter.hpp>
 
 namespace boost {
 namespace numeric {
@@ -22,61 +24,123 @@
 
 struct vector_space_algebra
 {
- template< class StateType1 , class StateType2 , class Operation >
- static void for_each2( StateType1 &s1 , StateType2 &s2 , Operation op )
+ struct for_each1_impl
         {
- // ToDo : build checks, that the +-*/ operators are well defined
- op( s1 , s2 );
- }
+ template< class S1 , class Op >
+ void operator()( S1 &s1 , Op op ) const
+ {
+ // ToDo : build checks, that the +-*/ operators are well defined
+ op( s1 );
+ }
+ typedef void result_type;
+ };
+
+ struct for_each2_impl
+ {
+ template< class S1 , class S2 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , Op op ) const
+ {
+ op( s1 , s2 );
+ }
+ typedef void result_type;
+ };
+
+ struct for_each3_impl
+ {
+
+ template< class S1 , class S2 , class S3 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , Op op ) const
+ {
+ op( s1 , s2 , s3 );
+ }
+ typedef void result_type;
+ };
+
+ struct for_each4_impl
+ {
+
+ template< class S1 , class S2 , class S3 , class S4 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op ) const
+ {
+ op( s1 , s2 , s3 , s4 );
+ }
+ typedef void result_type;
+ };
+
+ struct for_each5_impl
+ {
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op ) const
+ {
+ op( s1 , s2 , s3 , s4 , s5 );
+ }
+ typedef void result_type;
+ };
+
+ struct for_each6_impl
+ {
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op ) const
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 );
+ }
+ typedef void result_type;
+ };
+
+ struct for_each7_impl
+ {
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op ) const
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 );
+ }
+ typedef void result_type;
+ };
+
+ struct for_each8_impl
+ {
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class Op >
+ void operator()( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op ) const
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 );
+ }
+ typedef void result_type;
+ };
+
+
+ struct reduce
+ {
+ template< class Value , class S , class Red >
+ Value operator()( const S &s , Red red , Value init ) const
+ {
+ boost::numeric::odeint::vector_space_reduce< S > r;
+ return r( s , red , init );
+ }
+
+// template< class T > struct result;
+// template< class F , class T1 , class T2 , class T3 >
+// struct result< F( T1 , T2 , T3 ) >
+// {
+// typedef T3 type;
+// };
+ };
+
+
+ typedef boost::forward_adapter< for_each1_impl , 2 > for_each1;
+ typedef boost::forward_adapter< for_each2_impl , 3 > for_each2;
+ typedef boost::forward_adapter< for_each3_impl , 4 > for_each3;
+ typedef boost::forward_adapter< for_each4_impl , 5 > for_each4;
+ typedef boost::forward_adapter< for_each5_impl , 6 > for_each5;
+ typedef boost::forward_adapter< for_each6_impl , 7 > for_each6;
+ typedef boost::forward_adapter< for_each7_impl , 8 > for_each7;
+ typedef boost::forward_adapter< for_each8_impl , 9 > for_each8;
+// typedef boost::forward_adapter< reduce_impl , 3 > reduce;
 
 
- template< class StateType1 , class StateType2 , class StateType3 , class Operation >
- static void for_each3( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , Operation op )
- {
- op( s1 , s2 , s3 );
- }
-
-
- 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 )
- {
- op( s1 , s2 , s3 , s4 );
- }
-
-
- 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 )
- {
- op( s1 , s2 , s3 , s4 , s5 );
- }
-
-
- 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 )
- {
- op( s1 , s2 , s3 , s4 , s5 , s6 );
- }
-
-
- 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 )
- {
- op( s1 , s2 , s3 , s4 , s5 , s6 , s7 );
- }
-
- 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 )
- {
- op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 );
- }
-
-
- template< class ValueType , class StateType , class Reduction>
- static ValueType reduce( StateType &s , Reduction red , ValueType init )
- {
- boost::numeric::odeint::vector_space_reduce< StateType > r;
- return r( s , red , init );
- }
 };
 
 

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -65,7 +65,8 @@
 
     order_type error_order( void ) const
     {
- return error_order_value; }
+ return error_order_value;
+ }
 
 
 

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -129,7 +129,7 @@
         {
                 typename boost::unwrap_reference< System >::type &sys = system;
                 m_dxdt_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
- system( in , m_dxdt , t );
+ sys( in , m_dxdt , t );
                 return try_step( system , in , m_dxdt , t , out , dt );
         }
 

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_dopri5.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_dopri5.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_dopri5.hpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -183,7 +183,7 @@
                 const state_type &k6 = dopri5().m_k6;
                 const state_type &k7 = *m_current_deriv;
 
- algebra_type::for_each8( x , *m_old_state , k1 , k3 , k4 , k5 , k6 , k7 ,
+ typename algebra_type::for_each8()( x , *m_old_state , k1 , k3 , k4 , k5 , k6 , k7 ,
                         typename operations_type::template scale_sum7< time_type , time_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt * b1_theta , dt * b3_theta , dt * b4_theta , dt * b5_theta , dt * b6_theta , dt * b7_theta ) );
         }
 

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 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -84,7 +84,7 @@
         void calc_state( time_type t , state_type &x )
         {
                 time_type delta = t - m_t_old;
- algebra_type::for_each3( x , *m_old_state , m_euler.m_dxdt , typename operations_type::template scale_sum2< time_type , time_type >( 1.0 , delta ) );
+ typename algebra_type::for_each3()( x , *m_old_state , m_euler.m_dxdt , typename operations_type::template scale_sum2< time_type , time_type >( 1.0 , delta ) );
         }
 
         void adjust_size( const state_type &x )

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 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -48,10 +48,11 @@
         time_type error( const state_type &x_old , const state_type &dxdt_old , state_type &x_err , const time_type &dt )
         {
                 // this overwrites x_err !
- algebra_type::for_each3( x_old , dxdt_old , x_err ,
+ typename algebra_type::for_each3()( x_old , dxdt_old , x_err ,
                                                      typename operations_type::template rel_error< time_type >( m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt*dt ) );
 
- return algebra_type::template reduce< time_type >( x_err , typename operations_type::template maximum< time_type >() , 0.0 );
+ time_type res = typename algebra_type::reduce()( x_err , typename operations_type::template maximum< time_type >() , 0.0 );
+ return res;
         }
 
 private:

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 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -125,29 +125,29 @@
                 typename boost::unwrap_reference< System >::type &sys = system;
 
         //m_x_tmp = x + dt*b21*dxdt
- algebra_type::for_each3( m_x_tmp , in , dxdt_in ,
+ typename algebra_type::for_each3()( m_x_tmp , in , dxdt_in ,
                         typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt*b21 ) );
 
         sys( m_x_tmp , m_k2 , t + dt*a2 );
         // m_x_tmp = x + dt*b31*dxdt + dt*b32*m_k2
- algebra_type::for_each4( m_x_tmp , in , dxdt_in , m_k2 ,
+ typename algebra_type::for_each4()( m_x_tmp , in , dxdt_in , m_k2 ,
                         typename operations_type::template scale_sum3< value_type , time_type , time_type >( 1.0 , dt*b31 , dt*b32 ));
 
         sys( m_x_tmp , m_k3 , t + dt*a3 );
         // m_x_tmp = x + dt * (b41*dxdt + b42*m_k2 + b43*m_k3)
- algebra_type::for_each5( m_x_tmp , in , dxdt_in , m_k2 , m_k3 ,
+ typename algebra_type::for_each5()( m_x_tmp , in , dxdt_in , m_k2 , m_k3 ,
                         typename operations_type::template scale_sum4< value_type , time_type , time_type , time_type >( 1.0 , dt*b41 , dt*b42 , dt*b43 ));
 
         sys( m_x_tmp, m_k4 , t + dt*a4 );
- algebra_type::for_each6( m_x_tmp , in , dxdt_in , m_k2 , m_k3 , m_k4 ,
+ typename algebra_type::for_each6()( m_x_tmp , in , dxdt_in , m_k2 , m_k3 , m_k4 ,
                         typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b51 , dt*b52 , dt*b53 , dt*b54 ));
 
         sys( m_x_tmp , m_k5 , t + dt*a5 );
- algebra_type::for_each7( m_x_tmp , in , dxdt_in , m_k2 , m_k3 , m_k4 , m_k5 ,
+ typename algebra_type::for_each7()( m_x_tmp , in , dxdt_in , m_k2 , m_k3 , m_k4 , m_k5 ,
                         typename operations_type::template scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b61 , dt*b62 , dt*b63 , dt*b64 , dt*b65 ));
 
         sys( m_x_tmp , m_k6 , t + dt );
- algebra_type::for_each7( out , in , dxdt_in , m_k3 , m_k4 , m_k5 , m_k6 ,
+ typename algebra_type::for_each7()( out , in , dxdt_in , m_k3 , m_k4 , m_k5 , m_k6 ,
                         typename operations_type::template scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt*c1 , dt*c3 , dt*c4 , dt*c5 , dt*c6 ));
 
         // the new derivative
@@ -175,7 +175,7 @@
         do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt );
 
         //error estimate
- algebra_type::for_each7( xerr , dxdt_in , m_k3 , m_k4 , m_k5 , m_k6 , dxdt_out ,
+ typename algebra_type::for_each7()( xerr , dxdt_in , m_k3 , m_k4 , m_k5 , m_k6 , dxdt_out ,
                     typename operations_type::template scale_sum6< time_type , time_type , time_type , time_type , time_type , time_type >( dt*dc1 , dt*dc3 , dt*dc4 , dt*dc5 , dt*dc6 , dt*dc7 ) );
         }
 

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 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -99,7 +99,7 @@
                 do_step_impl( system , in , dxdt , t , out , dt );
 
                 //error estimate
- algebra_type::for_each6( xerr , dxdt , m_k3 , m_k4 , m_k5 , m_k6 ,
+ typename algebra_type::for_each6()( xerr , dxdt , m_k3 , m_k4 , m_k5 , m_k6 ,
                                 typename operations_type::template scale_sum5< time_type , time_type , time_type , time_type , time_type >( dt*dc1 , dt*dc3 , dt*dc4 , dt*dc5 , dt*dc6 ));
 
         }
@@ -142,29 +142,29 @@
                 typename boost::unwrap_reference< System >::type &sys = system;
 
                 //m_x1 = x + dt*b21*dxdt
- algebra_type::for_each3( m_x_tmp , in , dxdt ,
+ typename algebra_type::for_each3()( m_x_tmp , in , dxdt ,
                                 typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt*b21 ) );
 
                 sys( m_x_tmp , m_k2 , t + dt*a2 );
                 // m_x_tmp = x + dt*b31*dxdt + dt*b32*m_x2
- algebra_type::for_each4( m_x_tmp , in , dxdt , m_k2 ,
+ typename algebra_type::for_each4()( m_x_tmp , in , dxdt , m_k2 ,
                                 typename operations_type::template scale_sum3< value_type , time_type , time_type >( 1.0 , dt*b31 , dt*b32 ));
 
                 sys( m_x_tmp , m_k3 , t + dt*a3 );
                 // m_x_tmp = x + dt * (b41*dxdt + b42*m_x2 + b43*m_x3)
- algebra_type::for_each5( m_x_tmp , in , dxdt , m_k2 , m_k3 ,
+ typename algebra_type::for_each5()( m_x_tmp , in , dxdt , m_k2 , m_k3 ,
                                 typename operations_type::template scale_sum4< value_type , time_type , time_type , time_type >( 1.0 , dt*b41 , dt*b42 , dt*b43 ));
 
                 sys( m_x_tmp, m_k4 , t + dt*a4 );
- algebra_type::for_each6( m_x_tmp , in , dxdt , m_k2 , m_k3 , m_k4 ,
+ typename algebra_type::for_each6()( m_x_tmp , in , dxdt , m_k2 , m_k3 , m_k4 ,
                                 typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b51 , dt*b52 , dt*b53 , dt*b54 ));
 
                 sys( m_x_tmp , m_k5 , t + dt*a5 );
- algebra_type::for_each7( m_x_tmp , in , dxdt , m_k2 , m_k3 , m_k4 , m_k5 ,
+ typename algebra_type::for_each7()( m_x_tmp , in , dxdt , m_k2 , m_k3 , m_k4 , m_k5 ,
                                 typename operations_type::template scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b61 , dt*b62 , dt*b63 , dt*b64 , dt*b65 ));
 
                 sys( m_x_tmp , m_k6 , t + dt*a6 );
- algebra_type::for_each6( out , in , dxdt , m_k3 , m_k4 , m_k6 ,
+ typename algebra_type::for_each6()( out , in , dxdt , m_k3 , m_k4 , m_k6 ,
                                 typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt*c1 , dt*c3 , dt*c4 , dt*c6 ));
 
         }

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 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -49,7 +49,8 @@
         template< class System , class StateIn , class DerivIn , class StateOut >
         void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , const time_type &t , StateOut &out , const time_type &dt )
         {
- algebra_type::for_each3( out , in , dxdt , typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt ) );
+ typename algebra_type::for_each3()( out , in , dxdt , typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt ) );
+
         }
 };
 

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 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -84,7 +84,7 @@
 
         // dt * dxdt = k1
         // m_x_tmp = x + dh*dxdt
- algebra_type::for_each3( m_x_tmp , in , dxdt ,
+ typename algebra_type::for_each3()( m_x_tmp , in , dxdt ,
                         typename operations_type::template scale_sum2< value_type , time_type >( val1 , dh ) );
 
 
@@ -92,14 +92,14 @@
         sys( m_x_tmp , m_dxt , th );
 
         // m_x_tmp = x + dh*m_dxt
- algebra_type::for_each3( m_x_tmp , in , m_dxt ,
+ typename algebra_type::for_each3()( m_x_tmp , in , m_dxt ,
                         typename operations_type::template scale_sum2< value_type , time_type >( val1 , dh ) );
 
 
         // dt * m_dxm = k3
         sys( m_x_tmp , m_dxm , th );
         //m_x_tmp = x + dt*m_dxm
- algebra_type::for_each3( m_x_tmp , in , m_dxm ,
+ typename algebra_type::for_each3()( m_x_tmp , in , m_dxm ,
                         typename operations_type::template scale_sum2< value_type , time_type >( val1 , dt ) );
 
 
@@ -108,7 +108,7 @@
         //x += dt/6 * ( m_dxdt + m_dxt + val2*m_dxm )
         time_type dt6 = dt / static_cast< value_type >( 6.0 );
         time_type dt3 = dt / static_cast< value_type >( 3.0 );
- algebra_type::for_each6( out , in , dxdt , m_dxt , m_dxm , m_dxh ,
+ typename algebra_type::for_each6()( out , in , dxdt , m_dxt , m_dxm , m_dxh ,
                         typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt6 , dt3 , dt3 , dt6 ) );
         }
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/explicit_euler_units.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/explicit_euler_units.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/explicit_euler_units.hpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -52,7 +52,7 @@
         template< class System , class State >
         void do_step_impl( System system , const State &in , const deriv_type &dxdt , const time_type t , State & out , const time_type dt )
         {
- algebra_type::for_each3( out , in , dxdt , operations_type::make_scale_sum2( static_cast< value_type >( 1.0 ) , dt ) );
+ typename algebra_type::for_each3()( out , in , dxdt , operations_type::make_scale_sum2( static_cast< value_type >( 1.0 ) , dt ) );
         }
 };
 

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/controlled_stepper_evolution.cpp (from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/controlled_stepper_evolution.cpp)
==============================================================================

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_stepper_evolution.cpp (from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_stepper_evolution.cpp)
==============================================================================

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -11,28 +11,18 @@
     : requirements
       <define>BOOST_ALL_NO_LIB=1
       <include>../../../..
- <include>$(BOOST_ROOT)
+ <library>/boost/test//boost_unit_test_framework
+ <link>static
     ;
 
-
 
-unit-test basic_test
- : check_stepper_concepts.cpp
- check_resize.cpp
- check_operations.cpp
- check_algebra.cpp
- check_implicit_euler.cpp
- check_dense_output_explicit_euler.cpp
- check_dense_output_dopri5.cpp
+test-suite "odeint"
         :
- : <library>/boost/test//boost_unit_test_framework
- <link>static
- ;
-
-exe controlled_stepper_evolution
- : controlled_stepper_evolution.cpp
- ;
-
-exe dense_output_stepper_evolution
- : dense_output_stepper_evolution.cpp
- ;
\ No newline at end of file
+ [ run stepper_concepts.cpp ]
+ [ run resizing.cpp ]
+ [ run standard_operations.cpp ]
+ [ run standard_algebra.cpp ]
+ [ run implicit_euler.cpp ]
+ [ run dense_output_explicit_euler.cpp ]
+ [ run dense_output_dopri5.cpp ]
+ ;

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_algebra.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_algebra.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,99 +0,0 @@
-/*
- * check_operations.cpp
- *
- * Created on: Jan 20, 2011
- * Author: karsten
- */
-
-#include <cmath>
-#include <complex>
-#include <utility>
-#include <tr1/array>
-
-#include <boost/test/unit_test.hpp>
-#include <boost/test/floating_point_comparison.hpp>
-
-#include <boost/range.hpp>
-
-#include <boost/numeric/odeint/algebra/standard_operations.hpp>
-#include <boost/numeric/odeint/algebra/standard_algebra.hpp>
-
-using boost::numeric::odeint::standard_operations;
-using boost::numeric::odeint::standard_algebra;
-
-
-
-BOOST_AUTO_TEST_SUITE( standard_algebra_test )
-
-BOOST_AUTO_TEST_CASE( test_for_each2 )
-{
- std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }};
- standard_algebra::for_each2( x1 , x2 , standard_operations::scale_sum1<>( 1.0 ) );
- BOOST_CHECK_CLOSE( x1[0] , 2.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 2.0 , 1.0e-10 );
-}
-
-BOOST_AUTO_TEST_CASE( test_for_each3 )
-{
- std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }};
- standard_algebra::for_each3( x1 , x2 , x3 , standard_operations::scale_sum2<>( 1.0 , 2.0 ) );
- BOOST_CHECK_CLOSE( x1[0] , 8.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 8.0 , 1.0e-10 );
-}
-
-BOOST_AUTO_TEST_CASE( test_for_each4 )
-{
- std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }};
- standard_algebra::for_each4( x1 , x2 , x3 , x4 , standard_operations::scale_sum3<>( 1.0 , 2.0 , 3.0 ) );
- BOOST_CHECK_CLOSE( x1[0] , 20.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 20.0 , 1.0e-10 );
-}
-
-BOOST_AUTO_TEST_CASE( test_for_each5 )
-{
- std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }};
- standard_algebra::for_each5( x1 , x2 , x3 , x4 , x5 , standard_operations::scale_sum4<>( 1.0 , 2.0 , 3.0 , 4.0 ) );
- BOOST_CHECK_CLOSE( x1[0] , 40.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 40.0 , 1.0e-10 );
-}
-
-BOOST_AUTO_TEST_CASE( test_for_each6 )
-{
- std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }};
- standard_algebra::for_each6( x1 , x2 , x3 , x4 , x5 , x6 ,standard_operations::scale_sum5<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ) );
- BOOST_CHECK_CLOSE( x1[0] , 70.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 70.0 , 1.0e-10 );
-}
-
-BOOST_AUTO_TEST_CASE( test_for_each7 )
-{
- std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }} , x7 = {{ 7.0 , 7.0 }};
- standard_algebra::for_each7( x1 , x2 , x3 , x4 , x5 , x6 , x7 , standard_operations::scale_sum6<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ) );
- BOOST_CHECK_CLOSE( x1[0] , 112.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 112.0 , 1.0e-10 );
-}
-
-BOOST_AUTO_TEST_CASE( test_for_each8 )
-{
- std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }} , x7 = {{ 7.0 , 7.0 }} , x8 = {{ 8.0 , 8.0 }};
- standard_algebra::for_each8( x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , standard_operations::scale_sum7<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 ) );
- BOOST_CHECK_CLOSE( x1[0] , 168.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 168.0 , 1.0e-10 );
-}
-
-
-BOOST_AUTO_TEST_CASE( test_for_each2_with_range )
-{
-// std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }};
-// std::tr1::array< double , 4 > x2 = {{ 2.0 , 3.0 , 4.0 , 5.0 }};
-// standard_algebra::for_each2( x1 , std::make_pair( x2.begin() + 1 , x2.begin() + 3 ) , standard_operations::scale_sum1<>( 1.0 ) );
-// BOOST_CHECK_CLOSE( x1[0] , 3.0 , 1.0e-10 );
-// BOOST_CHECK_CLOSE( x1[1] , 4.0 , 1.0e-10 );
-}
-
-
-
-
-
-
-BOOST_AUTO_TEST_SUITE_END()

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_dopri5.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_dopri5.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,85 +0,0 @@
-/*
- * check_dense_output_dopri5.cpp
- *
- * Created on: Nov 1, 2010
- * Author: karsten
- */
-
-#include <tr1/array>
-#include <fstream>
-#include <iostream>
-
-#include <boost/test/unit_test.hpp>
-
-#include <boost/numeric/odeint.hpp>
-#include <boost/numeric/odeint/stepper/implicit_euler.hpp>
-
-using namespace boost::unit_test;
-using namespace boost::numeric::odeint;
-
-typedef double value_type;
-typedef std::tr1::array< double , 2 > state_type;
-
-inline std::ostream& operator<<( std::ostream &out , const state_type &x )
-{
- out << x[0] << "\t" << x[1];
- return out;
-}
-
-inline void sys( const state_type &x , state_type &dxdt , const value_type t )
-{
- dxdt[0] = x[1];
- dxdt[1] = -x[0];
-}
-
-
-BOOST_AUTO_TEST_SUITE( dense_output_dopri5_test )
-
-BOOST_AUTO_TEST_CASE( test_dopri5 )
-{
- using std::abs;
-
- typedef explicit_error_dopri5< state_type > dopri5_type;
- typedef controlled_error_stepper< dopri5_type > controlled_stepper_type;
- dopri5_type dopri5;
- controlled_stepper_type controlled_stepper( dopri5 );
- dense_output_dopri5< controlled_stepper_type > stepper( controlled_stepper );
-
- state_type x0;
- x0[0] = 0.0;
- x0[1] = 1.0;
-
- stepper.initialize( x0 , 0.0 , 0.1 );
-// stepper.do_step( sys );
-
- std::ofstream stepper_out( "dopri5_stepper_states.dat" );
- std::ofstream states_out( "dopri5_states.dat" );
-
-
- double t = stepper.current_time();
- double t_end = 10.0;
- double dt = 0.02;
- state_type x;
- while( t < t_end )
- {
- if( t < stepper.current_time() )
- {
- stepper.calc_state( t , x );
- states_out << t << "\t" << x << std::endl;
- }
- else
- {
- stepper.do_step( sys );
- stepper_out << stepper.current_time() << "\t" << stepper.current_state() << std::endl;
- continue;
- }
- t += dt;
- }
-
-// // compare with analytic solution of above system
-// BOOST_CHECK_MESSAGE( abs( x(0) - 20.0/81.0 ) < eps , x(0) - 20.0/81.0 );
-// BOOST_CHECK_MESSAGE( abs( x(1) - 10.0/9.0 ) < eps , x(0) - 10.0/9.0 );
-
-}
-
-BOOST_AUTO_TEST_SUITE_END()

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_explicit_euler.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_explicit_euler.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,85 +0,0 @@
-/* Boost check_implicit_euler.cpp test file
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
-
- This file tests the use of the euler stepper
-
- 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 <tr1/array>
-#include <fstream>
-#include <iostream>
-
-#include <boost/test/unit_test.hpp>
-
-#include <boost/numeric/odeint.hpp>
-#include <boost/numeric/odeint/stepper/implicit_euler.hpp>
-
-using namespace boost::unit_test;
-using namespace boost::numeric::odeint;
-
-typedef double value_type;
-typedef std::tr1::array< double , 2 > state_type;
-
-inline std::ostream& operator<<( std::ostream &out , const state_type &x )
-{
- out << x[0] << "\t" << x[1];
- return out;
-}
-
-inline void sys( const state_type &x , state_type &dxdt , const value_type t )
-{
- dxdt[0] = x[1];
- dxdt[1] = -x[0];
-}
-
-
-BOOST_AUTO_TEST_SUITE( dense_output_explicit_euler_test )
-
-BOOST_AUTO_TEST_CASE( test_euler )
-{
- using std::abs;
-
- dense_output_explicit_euler< state_type > stepper;
- state_type x0;
- x0[0] = 0.0;
- x0[1] = 1.0;
-
- stepper.initialize( x0 , 0.0 , 0.1 );
-// stepper.do_step( sys );
-
- std::ofstream stepper_out( "stepper_states.dat" );
- std::ofstream states_out( "states.dat" );
-
-
- double t = stepper.current_time();
- double t_end = 10.0;
- double dt = 0.02;
- state_type x;
- while( t < t_end )
- {
- if( t < stepper.current_time() )
- {
- stepper.calc_state( t , x );
- states_out << t << "\t" << x << std::endl;
- }
- else
- {
- stepper.do_step( sys );
- stepper_out << stepper.current_time() << "\t" << stepper.current_state() << std::endl;
- continue;
- }
- t += dt;
- }
-
-// // compare with analytic solution of above system
-// BOOST_CHECK_MESSAGE( abs( x(0) - 20.0/81.0 ) < eps , x(0) - 20.0/81.0 );
-// BOOST_CHECK_MESSAGE( abs( x(1) - 10.0/9.0 ) < eps , x(0) - 10.0/9.0 );
-
-}
-
-BOOST_AUTO_TEST_SUITE_END()

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_implicit_euler.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_implicit_euler.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,64 +0,0 @@
-/* Boost check_implicit_euler.cpp test file
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
-
- This file tests the use of the euler stepper
-
- 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 <boost/test/unit_test.hpp>
-
-#include <boost/numeric/odeint.hpp>
-#include <boost/numeric/odeint/stepper/implicit_euler.hpp>
-#include <boost/numeric/odeint/algebra/external/ublas_resize.hpp>
-
-#include <boost/numeric/ublas/vector.hpp>
-#include <boost/numeric/ublas/matrix.hpp>
-
-using namespace boost::unit_test;
-using namespace boost::numeric::odeint;
-
-typedef double value_type;
-typedef boost::numeric::ublas::vector< value_type > state_type;
-typedef boost::numeric::ublas::matrix< value_type > matrix_type;
-
-
-void sys( const state_type &x , state_type &dxdt , const value_type t )
-{
- dxdt( 0 ) = x( 0 ) + 2 * x( 1 );
- dxdt( 1 ) = x( 1 );
-}
-
-void jacobi( const state_type &x , matrix_type &jacobi , const value_type t )
-{
- jacobi( 0 , 0 ) = 1;
- jacobi( 0 , 1 ) = 2;
- jacobi( 1 , 0 ) = 0;
- jacobi( 1 , 1 ) = 1;
-}
-
-BOOST_AUTO_TEST_SUITE( implicit_euler_test )
-
-BOOST_AUTO_TEST_CASE( test_euler )
-{
- implicit_euler< value_type > stepper;
- state_type x( 2 );
- x(0) = 0.0; x(1) = 1.0;
-
- value_type eps = 1E-12;
-
- stepper.do_step( sys , jacobi , x , 0.0 , 0.1 );
-
- using std::abs;
-
- // compare with analytic solution of above system
- BOOST_CHECK_MESSAGE( abs( x(0) - 20.0/81.0 ) < eps , x(0) - 20.0/81.0 );
- BOOST_CHECK_MESSAGE( abs( x(1) - 10.0/9.0 ) < eps , x(0) - 10.0/9.0 );
-
-}
-
-BOOST_AUTO_TEST_SUITE_END()

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_operations.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_operations.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,256 +0,0 @@
-/*
- * check_operations.cpp
- *
- * Created on: Jan 20, 2011
- * Author: karsten
- */
-
-#include <cmath>
-#include <complex>
-
-#include <boost/test/unit_test.hpp>
-#include <boost/test/floating_point_comparison.hpp>
-
-#include <boost/units/systems/si/length.hpp>
-#include <boost/units/systems/si/time.hpp>
-#include <boost/units/systems/si/velocity.hpp>
-#include <boost/units/systems/si/acceleration.hpp>
-#include <boost/units/systems/si/io.hpp>
-
-#include <boost/mpl/list.hpp>
-
-#include <boost/numeric/odeint/algebra/standard_operations.hpp>
-
-namespace units = boost::units;
-namespace si = boost::units::si;
-namespace mpl = boost::mpl;
-using boost::numeric::odeint::standard_operations;
-
-
-template< class Value > struct internal_value_type { typedef Value type; };
-template< class T > struct internal_value_type< std::complex< T > > { typedef T type; };
-
-template< class T > struct default_eps;
-template<> struct default_eps< double > { static double def_eps( void ) { return 1.0e-10; } };
-template<> struct default_eps< float > { static float def_eps( void ) { return 1.0e-5; } };
-
-
-typedef units::unit< units::derived_dimension< units::time_base_dimension , 2 >::type , si::system > time_2;
-typedef units::unit< units::derived_dimension< units::time_base_dimension , 3 >::type , si::system > time_3;
-typedef units::unit< units::derived_dimension< units::time_base_dimension , 4 >::type , si::system > time_4;
-typedef units::unit< units::derived_dimension< units::time_base_dimension , 5 >::type , si::system > time_5;
-typedef units::unit< units::derived_dimension< units::time_base_dimension , 6 >::type , si::system > time_6;
-typedef units::unit< units::derived_dimension< units::time_base_dimension , 7 >::type , si::system > time_7;
-
-const time_2 second2 = si::second * si::second;
-const time_3 second3 = second2 * si::second;
-const time_4 second4 = second3 * si::second;
-const time_5 second5 = second4 * si::second;
-const time_6 second6 = second5 * si::second;
-const time_7 second7 = second6 * si::second;
-
-
-
-
-template< class Value , class Compare = typename internal_value_type< Value >::type >
-struct double_fixture
-{
- typedef Value value_type;
- typedef Compare compare_type;
-
- double_fixture( const compare_type &eps_ = default_eps< compare_type >::def_eps() )
- : m_eps( eps_ ) , res( 0.0 ) , x1( 1.0 ) , x2( 2.0 ) , x3( 3.0 ) , x4( 4.0 ) , x5( 5.0 ) , x6( 6.0 ) , x7( 7.0 ) , x8( 8.0 )
- {}
-
- ~double_fixture( void )
- {
- using std::abs;
- BOOST_CHECK_SMALL( abs( x1 - value_type( 1.0 ) ) , m_eps );
- BOOST_CHECK_SMALL( abs( x2 - value_type( 2.0 ) ) , m_eps );
- BOOST_CHECK_SMALL( abs( x3 - value_type( 3.0 ) ) , m_eps );
- BOOST_CHECK_SMALL( abs( x4 - value_type( 4.0 ) ) , m_eps );
- BOOST_CHECK_SMALL( abs( x5 - value_type( 5.0 ) ) , m_eps );
- BOOST_CHECK_SMALL( abs( x6 - value_type( 6.0 ) ) , m_eps );
- BOOST_CHECK_SMALL( abs( x7 - value_type( 7.0 ) ) , m_eps );
- }
-
- const compare_type m_eps;
- value_type res;
- value_type x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8;
-};
-
-template< class Value , class Compare = typename internal_value_type< Value >::type >
-struct unit_fixture
-{
- typedef Value value_type;
- typedef Compare compare_type;
- typedef units::quantity< si::length , value_type > length_type;
-
- typedef units::quantity< si::time , value_type > time_type;
- typedef units::quantity< time_2 , value_type > time_2_type;
- typedef units::quantity< time_3 , value_type > time_3_type;
- typedef units::quantity< time_4 , value_type > time_4_type;
- typedef units::quantity< time_5 , value_type > time_5_type;
- typedef units::quantity< time_6 , value_type > time_6_type;
- typedef units::quantity< time_7 , value_type > time_7_type;
-
- typedef units::quantity< si::velocity , value_type > velocity_type;
- typedef units::quantity< si::acceleration , value_type > acceleration_type;
-
- unit_fixture( const compare_type &eps_ = default_eps< compare_type >::def_eps() )
- : m_eps( eps_ )
- , res( 0.0 * si::meter )
- , x( 1.0 * si::meter )
- , d1x( 2.0 * si::meter / si::second )
- , d2x( 3.0 * si::meter / si::second / si::second )
- {}
-
- ~unit_fixture( void )
- {
- using std::abs;
- BOOST_CHECK_SMALL( abs( x.value() - value_type( 1.0 ) ) , m_eps );
- BOOST_CHECK_SMALL( abs( d1x.value() - value_type( 2.0 ) ) , m_eps );
- BOOST_CHECK_SMALL( abs( d2x.value() - value_type( 3.0 ) ) , m_eps );
- }
-
- compare_type m_eps;
- length_type res;
- length_type x;
- velocity_type d1x;
- acceleration_type d2x;
-};
-
-
-typedef mpl::list< float , double , std::complex< double > > test_types;
-
-BOOST_AUTO_TEST_SUITE( check_operations_test )
-
-using std::abs;
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum2_test , T , test_types )
-{
- typedef double_fixture< T > fix_type;
- fix_type f;
- typedef typename standard_operations::scale_sum2< T , T > Op;
- Op op( 1.25 , 9.81 );
- op( f.res , f.x1 , f.x2 );
- BOOST_CHECK_SMALL( abs( f.res - T( 20.87 ) ) , f.m_eps );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum3_test , T , test_types )
-{
- typedef double_fixture< T > fix_type;
- fix_type f;
- typedef standard_operations::scale_sum3< T , T , T > Op;
- Op op( 1.25 , 9.81 , 0.87 );
- op( f.res , f.x1 , f.x2 , f.x3 );
- BOOST_CHECK_SMALL( abs( f.res - T( 23.48 ) ) , f.m_eps );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum4_test , T , test_types )
-{
- typedef double_fixture< T > fix_type;
- fix_type f;
- typedef standard_operations::scale_sum4< T , T , T , T > Op;
- Op op( 1.25 , 9.81 , 0.87 , -0.15 );
- op( f.res , f.x1 , f.x2 , f.x3 , f.x4 );
- BOOST_CHECK_SMALL( abs( f.res - T( 22.88 ) ) , f.m_eps );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum5_test , T , test_types )
-{
- typedef double_fixture< T > fix_type;
- fix_type f;
- typedef standard_operations::scale_sum5< T , T , T , T , T > Op;
- Op op( 1.25 , 9.81 , 0.87 , -0.15 , -3.3 );
- op( f.res , f.x1 , f.x2 , f.x3 , f.x4 , f.x5 );
- BOOST_CHECK_SMALL( abs( f.res - T( 6.38 ) ) , f.m_eps );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum6_test , T , test_types )
-{
- typedef double_fixture< T > fix_type;
- fix_type f;
- typedef standard_operations::scale_sum6< T , T , T , T , T , T > Op;
- Op op( 1.25 , 9.81 , 0.87 , -0.15 , -3.3 , 4.2 );
- op( f.res , f.x1 , f.x2 , f.x3 , f.x4 , f.x5 , f.x6 );
- BOOST_CHECK_SMALL( abs( f.res - T( 31.58 ) ) , f.m_eps );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum7_test , T , test_types )
-{
- typedef double_fixture< T > fix_type;
- fix_type f;
- typedef standard_operations::scale_sum7< T , T , T , T , T , T , T > Op;
- Op op( 1.25 , 9.81 , 0.87 , -0.15 , -3.3 , 4.2 , -0.22 );
- op( f.res , f.x1 , f.x2 , f.x3 , f.x4 , f.x5 , f.x6 , f.x7 );
- BOOST_CHECK_SMALL( abs( f.res - T( 30.04 ) ) , f.m_eps );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( rel_error_test , T , test_types )
-{
- typedef double_fixture< T > fix_type;
- fix_type f;
- f.res = -1.1;
- typedef standard_operations::rel_error< T > Op;
- Op op( 0.1 , 0.2 , 0.15 , 0.12 );
- op( -f.x1 , -f.x2 , f.res );
- BOOST_CHECK_SMALL( abs( f.res - T( 6.17978 ) ) , typename fix_type::compare_type( 1.0e-4 ) );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( maximum_test , T , test_types )
-{
- typedef double_fixture< T > fix_type;
- fix_type f;
- typedef standard_operations::maximum< typename fix_type::compare_type > Op;
- Op op;
- f.res = op( f.x1 , f.x2 );
- BOOST_CHECK_SMALL( abs( f.res - T( 2.0 ) ) , f.m_eps );
-}
-
-
-
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum2_units_test , T , test_types )
-{
- typedef unit_fixture< T > fix_type;
- typedef typename fix_type::value_type value_type;
- typedef typename fix_type::time_type time_type;
- typedef typename fix_type::time_2_type time_2_type;
- typedef typename fix_type::time_3_type time_3_type;
- typedef typename fix_type::time_4_type time_4_type;
- typedef typename fix_type::time_5_type time_5_type;
- typedef typename fix_type::time_6_type time_6_type;
- typedef typename fix_type::time_7_type time_7_type;
-
- fix_type f;
- typedef standard_operations::scale_sum2< value_type , time_type > Op;
- Op op( 1.0 , time_type( 1.0 * si::second ) );
- op( f.res , f.x , f.d1x );
- BOOST_CHECK_SMALL( abs( f.res.value() - T( 3.0 ) ) , f.m_eps );
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum3_units_test , T , test_types )
-{
- typedef unit_fixture< T > fix_type;
- typedef typename fix_type::value_type value_type;
- typedef typename fix_type::time_type time_type;
- typedef typename fix_type::time_2_type time_2_type;
- typedef typename fix_type::time_3_type time_3_type;
- typedef typename fix_type::time_4_type time_4_type;
- typedef typename fix_type::time_5_type time_5_type;
- typedef typename fix_type::time_6_type time_6_type;
- typedef typename fix_type::time_7_type time_7_type;
-
- fix_type f;
- typedef standard_operations::scale_sum3< value_type , time_type , time_2_type > Op;
- Op op( 1.0 , time_type( 1.0 * si::second ) , time_2_type( 1.0 * second2 ) );
- op( f.res , f.x , f.d1x , f.d2x );
- BOOST_CHECK_SMALL( abs( f.res.value() - T( 6.0 ) ) , f.m_eps );
-}
-
-
-
-
-BOOST_AUTO_TEST_SUITE_END()

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_resize.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_resize.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,101 +0,0 @@
-/* Boost stepper_euler.cpp test file
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
-
- This file tests the use of the euler stepper
-
- 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 <vector>
-#include <cmath>
-
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/utility.hpp>
-
-#include <boost/test/unit_test.hpp>
-
-#include <boost/mpl/vector.hpp>
-#include <boost/mpl/int.hpp>
-#include <boost/mpl/at.hpp>
-
-#include <boost/numeric/odeint.hpp>
-#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
-
-using namespace boost::unit_test;
-using namespace boost::numeric::odeint;
-
-namespace mpl = boost::mpl;
-
-size_t adjust_size_count;
-
-typedef boost::array< double , 1 > test_array_type;
-
-namespace boost { namespace numeric { namespace odeint {
-
-
- template<> struct is_resizeable< test_array_type >
- {
- struct type : public boost::true_type { };
- const static bool value = type::value;
- };
-
-
- template<> bool adjust_size( const test_array_type &x1 , test_array_type &x2 )
- {
- adjust_size_count++;
- return false;
- }
-
-} } }
-
-
-
-void constant_system( const test_array_type &x , test_array_type &dxdt , double t ) { dxdt[0] = 1.0; }
-
-
-BOOST_AUTO_TEST_SUITE( check_resize_test )
-
-
-typedef explicit_euler< test_array_type , double , test_array_type , double , standard_algebra , standard_operations , adjust_size_manually_tag > euler_manual_type;
-typedef explicit_euler< test_array_type , double , test_array_type , double , standard_algebra , standard_operations , adjust_size_initially_tag > euler_initially_type;
-typedef explicit_euler< test_array_type , double , test_array_type , double , standard_algebra , standard_operations , adjust_size_always_tag > euler_always_type;
-
-typedef explicit_rk4< test_array_type , double , test_array_type , double , standard_algebra , standard_operations , adjust_size_manually_tag > rk4_manual_type;
-typedef explicit_rk4< test_array_type , double , test_array_type , double , standard_algebra , standard_operations , adjust_size_initially_tag > rk4_initially_type;
-typedef explicit_rk4< test_array_type , double , test_array_type , double , standard_algebra , standard_operations , adjust_size_always_tag > rk4_always_type;
-
-
-typedef mpl::vector<
- mpl::vector< euler_manual_type , mpl::int_<1> , mpl::int_<0> > ,
- mpl::vector< euler_initially_type , mpl::int_<1> , mpl::int_<1> > ,
- mpl::vector< euler_always_type , mpl::int_<1> , mpl::int_<3> > ,
- mpl::vector< rk4_manual_type , mpl::int_<5> , mpl::int_<0> > ,
- mpl::vector< rk4_initially_type , mpl::int_<5> , mpl::int_<1> > ,
- mpl::vector< rk4_always_type , mpl::int_<5> , mpl::int_<3> >
->::type resize_check_types;
-
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( test_resize , T, resize_check_types )
-{
- typedef typename mpl::at< T , mpl::int_< 0 > >::type stepper_type;
- const size_t resize_calls = mpl::at< T , mpl::int_< 1 > >::type::value;
- const size_t multiplicity = mpl::at< T , mpl::int_< 2 > >::type::value;
- adjust_size_count = 0;
-
- stepper_type stepper;
- test_array_type x;
- stepper.do_step( constant_system , x , 0.0 , 0.1 );
- stepper.do_step( constant_system , x , 0.0 , 0.1 );
- stepper.do_step( constant_system , x , 0.0 , 0.1 );
-
- BOOST_TEST_MESSAGE( "adjust_size_count : " << adjust_size_count );
- BOOST_CHECK_MESSAGE( adjust_size_count == resize_calls * multiplicity , "adjust_size_count : " << adjust_size_count );
-}
-
-
-BOOST_AUTO_TEST_SUITE_END()

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_stepper_concepts.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_stepper_concepts.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,407 +0,0 @@
-/* Boost stepper_euler.cpp test file
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
-
- This file tests the use of the all different steppers with several state types:
- std::vector< double >
- vector_space_1d< double > (see vector_space_1d.hpp)
- std::tr1::array< double , 1 >
-
- 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)
-*/
-
-#define BOOST_TEST_MODULE odeint_basic_test
-
-#include <vector>
-#include <cmath>
-#include <iostream>
-
-#include <tr1/array>
-
-#include <boost/test/unit_test.hpp>
-
-#include <boost/ref.hpp>
-#include <boost/bind.hpp>
-#include <boost/utility.hpp>
-#include <boost/type_traits/add_reference.hpp>
-
-#include <boost/mpl/vector.hpp>
-#include <boost/mpl/for_each.hpp>
-#include <boost/mpl/insert_range.hpp>
-#include <boost/mpl/end.hpp>
-#include <boost/mpl/copy.hpp>
-#include <boost/mpl/placeholders.hpp>
-#include <boost/mpl/inserter.hpp>
-
-#include <boost/numeric/odeint.hpp>
-#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
-
-#include "vector_space_1d.hpp"
-
-
-using std::vector;
-
-using namespace boost::unit_test;
-using namespace boost::numeric::odeint;
-namespace mpl = boost::mpl;
-
-
-typedef std::vector< double > vector_type;
-typedef vector_space_1d< double > vector_space_type;
-typedef std::tr1::array< double , 1 > array_type;
-
-
-const double result = 2.2;
-
-typedef mpl::vector< vector_type , vector_space_type , array_type >::type container_types;
-
-
-template< class State > struct algebra_dispatcher { typedef standard_algebra type; };
-template<> struct algebra_dispatcher< vector_space_type > { typedef vector_space_algebra type; };
-template<> struct algebra_dispatcher< double > { typedef vector_space_algebra type; };
-
-struct constant_system_vector_class
-{
- void operator()( const vector_type &x , vector_type &dxdt , double t ) const
- {
- dxdt[0] = 1.0;
- }
-};
-
-struct constant_system_vector_space_class
-{
- void operator()( const vector_space_type &x , vector_space_type &dxdt , double t ) const
- {
- dxdt.m_x = 1.0;
- }
-};
-
-struct constant_system_array_class
-{
- void operator()( const array_type &x , array_type &dxdt , double t ) const
- {
- dxdt[0] = 1.0;
- }
-};
-
-void constant_system_vector( const vector_type &x , vector_type &dxdt , double t ) { dxdt[0] = 1.0; }
-void constant_system_vector_space( const vector_space_type &x , vector_space_type &dxdt , double t ) { dxdt.m_x = 1.0; }
-void constant_system_array( const array_type &x , array_type &dxdt , double t ) { dxdt[0] = 1.0; }
-
-const double eps = 1.0e-14;
-
-template< class Stepper , class System >
-void check_stepper_concept( Stepper &stepper , System system , typename Stepper::deriv_type &x )
-{
- typedef Stepper stepper_type;
- typedef typename stepper_type::deriv_type container_type;
- typedef typename stepper_type::order_type order_type;
- typedef typename stepper_type::time_type time_type;
-
- stepper.do_step( system , x , 0.0 , 0.1 );
-}
-
-template< class Stepper , class System >
-void check_error_stepper_concept( Stepper &stepper , System system , typename Stepper::state_type &x , typename Stepper::state_type &xerr )
-{
- typedef Stepper stepper_type;
- typedef typename stepper_type::deriv_type container_type;
- typedef typename stepper_type::order_type order_type;
- typedef typename stepper_type::time_type time_type;
-
- stepper.do_step( system , typename boost::add_reference< container_type>::type( x ), 0.0 , 0.1 , typename boost::add_reference< container_type>::type( xerr ) );
-}
-
-template< class Stepper , class System >
-void check_controlled_stepper_concept( Stepper &stepper , System system , typename Stepper::state_type &x )
-{
- typedef Stepper stepper_type;
- typedef typename stepper_type::deriv_type container_type;
- typedef typename stepper_type::order_type order_type;
- typedef typename stepper_type::time_type time_type;
-
- time_type t = 0.0 , dt = 0.1;
- controlled_step_result step_result = stepper.try_step( system , x , t , dt );
- BOOST_CHECK_MESSAGE( step_result == success_step_size_increased , "step result: " << step_result ); // error = 0 for constant system -> step size is always too small
-}
-
-
-
-
-
-template< class Stepper , class State > struct perform_stepper_test;
-
-template< class Stepper >
-struct perform_stepper_test< Stepper , vector_type >
-{
- void operator()( void )
- {
- vector_type x( 1 , 2.0 );
- Stepper stepper;
- check_stepper_concept( stepper , constant_system_vector , x );
- check_stepper_concept( stepper , boost::cref( constant_system_vector_class() ) , x );
- BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
- }
-};
-
-template< class Stepper >
-struct perform_stepper_test< Stepper , vector_space_type >
-{
- void operator()( void ) const
- {
- vector_space_type x;
- x.m_x = 2.0;
- Stepper stepper;
- check_stepper_concept( stepper , constant_system_vector_space , x );
- check_stepper_concept( stepper , boost::cref( constant_system_vector_space_class() ) , x );
- BOOST_CHECK_SMALL( fabs( x.m_x - result ) , eps );
- }
-};
-
-template< class Stepper >
-struct perform_stepper_test< Stepper , array_type >
-{
- void operator()( void )
- {
- array_type x;
- x[0] = 2.0;
- Stepper stepper;
- check_stepper_concept( stepper , constant_system_array , x );
- check_stepper_concept( stepper , boost::cref( constant_system_array_class() ) , x );
- BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
- }
-};
-
-
-template< class State > class stepper_methods : public mpl::vector<
- explicit_euler< State , double , State , double , typename algebra_dispatcher< State >::type > ,
- explicit_rk4< State , double , State , double , typename algebra_dispatcher< State >::type > ,
- explicit_error_rk54_ck< State , double , State , double , typename algebra_dispatcher< State >::type > ,
- explicit_error_dopri5< State , double , State , double , typename algebra_dispatcher< State >::type >
-> { };
-
-
-
-typedef mpl::copy
-<
- container_types ,
- mpl::inserter
- <
- mpl::vector0<> ,
- mpl::insert_range
- <
- mpl::_1 ,
- mpl::end< mpl::_1 > ,
- stepper_methods< mpl::_2 >
- >
- >
->::type all_stepper_methods;
-
-
-
-BOOST_AUTO_TEST_SUITE( stepper_concept_test )
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_test , Stepper, all_stepper_methods )
-{
- perform_stepper_test< Stepper , typename Stepper::deriv_type > tester;
- tester();
-}
-
-
-BOOST_AUTO_TEST_SUITE_END()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-template< class Stepper , class State > struct perform_error_stepper_test;
-
-template< class Stepper >
-struct perform_error_stepper_test< Stepper , vector_type >
-{
- void operator()( void )
- {
- vector_type x( 1 , 2.0 ) , xerr( 1 );
- Stepper stepper;
- check_error_stepper_concept( stepper , constant_system_vector , x , xerr );
- check_error_stepper_concept( stepper , boost::cref( constant_system_vector_class() ) , x , xerr );
- BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
- }
-};
-
-
-template< class Stepper >
-struct perform_error_stepper_test< Stepper , vector_space_type >
-{
- void operator()( void ) const
- {
- vector_space_type x , xerr;
- x.m_x = 2.0;
- Stepper stepper;
- check_error_stepper_concept( stepper , constant_system_vector_space , x , xerr );
- check_error_stepper_concept( stepper , boost::cref( constant_system_vector_space_class() ) , x , xerr );
- BOOST_CHECK_SMALL( fabs( x.m_x - result ) , eps );
- }
-};
-
-template< class Stepper >
-struct perform_error_stepper_test< Stepper , array_type >
-{
- void operator()( void )
- {
- array_type x , xerr;
- x[0] = 2.0;
- Stepper stepper;
- check_error_stepper_concept( stepper , constant_system_array , x , xerr );
- check_error_stepper_concept( stepper , boost::cref( constant_system_array_class() ) , x , xerr );
- BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
- }
-};
-
-
-template< class State > class error_stepper_methods : public mpl::vector<
- explicit_error_rk54_ck< State , double , State , double , typename algebra_dispatcher< State >::type > ,
- explicit_error_dopri5< State , double , State , double , typename algebra_dispatcher< State >::type >
-> { };
-
-
-typedef mpl::copy
-<
- container_types ,
- mpl::inserter
- <
- mpl::vector0<> ,
- mpl::insert_range
- <
- mpl::_1 ,
- mpl::end< mpl::_1 > ,
- error_stepper_methods< mpl::_2 >
- >
- >
->::type all_error_stepper_methods;
-
-
-BOOST_AUTO_TEST_SUITE( error_stepper_concept_test )
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( error_stepper_test , Stepper , all_error_stepper_methods )
-{
- perform_error_stepper_test< Stepper , typename Stepper::state_type > tester;
- tester();
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/* ToDO: check actual results of controlled step... */
-
-
-template< class ControlledStepper , class State > struct perform_controlled_stepper_test;
-
-template< class ControlledStepper >
-struct perform_controlled_stepper_test< ControlledStepper , vector_type >
-{
- void operator()( void )
- {
- vector_type x( 1 , 2.0 );
- typename ControlledStepper::stepper_type error_stepper;
- error_checker_standard< typename ControlledStepper::state_type , typename ControlledStepper::time_type > error_checker;
- ControlledStepper controlled_stepper( error_stepper , error_checker );
- check_controlled_stepper_concept( controlled_stepper , constant_system_vector , x );
- check_controlled_stepper_concept( controlled_stepper , boost::cref( constant_system_vector_class() ) , x );
- BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
- }
-};
-
-template< class ControlledStepper >
-struct perform_controlled_stepper_test< ControlledStepper , vector_space_type >
-{
- void operator()( void ) const
- {
- vector_space_type x;
- x.m_x = 2.0;
- typename ControlledStepper::stepper_type error_stepper;
- error_checker_standard< typename ControlledStepper::state_type , typename ControlledStepper::time_type , vector_space_algebra > error_checker;
- ControlledStepper controlled_stepper( error_stepper , error_checker );
- check_controlled_stepper_concept( controlled_stepper , constant_system_vector_space , x );
- check_controlled_stepper_concept( controlled_stepper , boost::cref( constant_system_vector_space_class() ) , x );
- BOOST_CHECK_SMALL( fabs( x.m_x - result ) , eps );
- }
-};
-
-template< class ControlledStepper >
-struct perform_controlled_stepper_test< ControlledStepper , array_type >
-{
- void operator()( void )
- {
- array_type x;
- x[0] = 2.0;
- typename ControlledStepper::stepper_type error_stepper;
- error_checker_standard< typename ControlledStepper::state_type , typename ControlledStepper::time_type > error_checker;
- ControlledStepper controlled_stepper( error_stepper , error_checker );
- check_controlled_stepper_concept( controlled_stepper , constant_system_array , x );
- check_controlled_stepper_concept( controlled_stepper , boost::cref( constant_system_array_class() ) , x );
- BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
- }
-};
-
-template< class State > class controlled_stepper_methods : public mpl::vector<
- controlled_error_stepper< explicit_error_rk54_ck< State , double , State , double , typename algebra_dispatcher< State >::type > > ,
- controlled_error_stepper< explicit_error_dopri5< State , double , State , double , typename algebra_dispatcher< State >::type > >
-> { };
-
-typedef mpl::copy
-<
- container_types ,
- mpl::inserter
- <
- mpl::vector0<> ,
- mpl::insert_range
- <
- mpl::_1 ,
- mpl::end< mpl::_1 > ,
- controlled_stepper_methods< mpl::_2 >
- >
- >
->::type all_controlled_stepper_methods;
-
-
-
-
-BOOST_AUTO_TEST_SUITE( controlled_stepper_concept_test )
-
-BOOST_AUTO_TEST_CASE_TEMPLATE( controlled_stepper_test , ControlledStepper , all_controlled_stepper_methods )
-{
- perform_controlled_stepper_test< ControlledStepper , typename ControlledStepper::state_type > tester;
- tester();
-}
-
-BOOST_AUTO_TEST_SUITE_END()

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/controlled_stepper_evolution.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/controlled_stepper_evolution.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,77 +0,0 @@
-/*
- * controlled_stepper_evolution.cpp
- *
- * Created on: Nov 2, 2010
- * Author: karsten
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <tr1/array>
-
-#include <boost/numeric/odeint.hpp>
-
-#define tab "\t"
-
-using namespace std;
-using namespace boost::numeric::odeint;
-
-
-typedef std::tr1::array< double , 2 > state_type;
-
-ostream& operator<<( ostream &out , const state_type &x )
-{
- out << x[0] << tab << x[1];
- return out;
-}
-
-void sys( const state_type &x , state_type &dxdt , double t )
-{
- dxdt[0] = x[1];
- dxdt[1] = -x[0];
-}
-
-state_type sys_solution( double t , const state_type &x0 )
-{
- state_type sol = {{ 0.0 , 0.0 }};
- sol[0] = x0[0] * cos( t ) + x0[1] * sin( t );
- sol[1] = -x0[0] * sin( t ) + x0[1] * cos( t );
- return sol;
-}
-
-
-
-template< class Stepper >
-void evolution( Stepper &stepper , double t_end , const state_type &x0 , const string &filename )
-{
- ofstream fout( filename.c_str() );
- state_type x = x0;
- double t = 0.0 , dt = 0.01;
- while( t < t_end )
- {
- state_type orig = sys_solution( t , x0 );
- state_type diff = {{ orig[0] - x[0] , orig[1] - x[1] }};
- double diff_abs = sqrt( diff[0] * diff[0] + diff[1] * diff[1] );
- fout << t << tab << orig << tab << x << tab << diff << tab << diff_abs << endl;
- stepper.try_step( sys , x , t , dt );
- }
-}
-
-
-int main( int argc , char **argv )
-{
- typedef explicit_error_rk54_ck< state_type > rk54_type;
- typedef explicit_error_dopri5< state_type > dopri5_type;
-
- rk54_type rk54;
- dopri5_type dopri5;
- controlled_error_stepper< rk54_type > rk54_controlled( rk54 );
- controlled_error_stepper< dopri5_type > dopri5_controlled( dopri5 );
-
- state_type x0 = {{ 1.25 , 0.43 }};
- evolution( rk54_controlled , 100.0 , x0 , "rk54.dat" );
- evolution( dopri5_controlled , 100.0 , x0 , "dopri5.dat" );
-
- return 0;
-}

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_dopri5.cpp (from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_dopri5.cpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_dopri5.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_dopri5.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -5,6 +5,8 @@
  * Author: karsten
  */
 
+#define BOOST_TEST_MODULE odeint_dense_output_dopri5
+
 #include <tr1/array>
 #include <fstream>
 #include <iostream>

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_explicit_euler.cpp (from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_explicit_euler.cpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_dense_output_explicit_euler.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_explicit_euler.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -10,6 +10,8 @@
  copy at http://www.boost.org/LICENSE_1_0.txt)
 */
 
+#define BOOST_TEST_MODULE odeint_dense_output_explicit_euler
+
 #include <tr1/array>
 #include <fstream>
 #include <iostream>

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_stepper_evolution.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_stepper_evolution.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,96 +0,0 @@
-/*
- * dense_output_stepper_evolution.cpp
- *
- * Created on: Nov 2, 2010
- * Author: karsten
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <tr1/array>
-
-#include <boost/numeric/odeint.hpp>
-
-#define tab "\t"
-
-using namespace std;
-using namespace boost::numeric::odeint;
-
-typedef std::tr1::array< double , 2 > state_type;
-
-ostream& operator<<( ostream &out , const state_type &x )
-{
- out << x[0] << tab << x[1];
- return out;
-}
-
-void sys( const state_type &x , state_type &dxdt , double t )
-{
- dxdt[0] = x[1];
- dxdt[1] = -x[0];
-}
-
-state_type sys_solution( double t , const state_type &x0 )
-{
- state_type sol = {{ 0.0 , 0.0 }};
- sol[0] = x0[0] * cos( t ) + x0[1] * sin( t );
- sol[1] = -x0[0] * sin( t ) + x0[1] * cos( t );
- return sol;
-}
-
-
-
-template< class Stepper >
-void evolution( Stepper &stepper , double t_end , const state_type &x0 , const string &stepper_filename , const string &state_filename )
-{
- ofstream state_out( state_filename.c_str() );
- ofstream stepper_out( stepper_filename.c_str() );
-
- stepper.initialize( x0 , 0.0 , 0.01 );
-
- state_type x = x0;
- double t = 0.0;
- double dt = 0.001;
- while( t < t_end )
- {
- if( t < stepper.current_time() )
- {
- stepper.calc_state( t , x );
- state_type orig = sys_solution( t , x0 );
- state_type diff = {{ orig[0] - x[0] , orig[1] - x[1] }};
- double diff_abs = sqrt( diff[0] * diff[0] + diff[1] * diff[1] );
- state_out << t << tab << x << tab << orig << tab << diff << tab << diff_abs << endl;
- }
- else
- {
- stepper.do_step( sys );
- state_type orig = sys_solution( stepper.current_time() , x0 );
- const state_type &xx = stepper.current_state();
- state_type diff = {{ orig[0] - xx[0] , orig[1] - xx[1] }};
- double diff_abs = sqrt( diff[0] * diff[0] + diff[1] * diff[1] );
- stepper_out << stepper.current_time() << "\t" << xx << tab << orig << tab << diff << tab << diff_abs << std::endl;
- continue;
- }
- t += dt;
-
- }
-}
-
-
-int main( int argc , char **argv )
-{
- typedef explicit_error_dopri5< state_type > dopri5_type;
- typedef controlled_error_stepper< dopri5_type > controlled_dopri5_type;
-
- dopri5_type dopri5;
- controlled_dopri5_type controlled_dopri5( dopri5 );
-
- dense_output_explicit_euler< state_type > dense_euler;
- dense_output_dopri5< controlled_dopri5_type > dense_dopri5( controlled_dopri5 );
-
- state_type x0 = {{ 1.25 , 0.43 }};
- evolution( dense_euler , 100.0 , x0 , "dense_euler_stepper.dat" , "dense_euler_state.dat" );
- evolution( dense_dopri5 , 100.0 , x0 , "dense_dopri5_stepper.dat" , "dense_dopri5_state.dat" );
-
-}

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/implicit_euler.cpp (from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_implicit_euler.cpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_implicit_euler.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/implicit_euler.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -10,6 +10,8 @@
  copy at http://www.boost.org/LICENSE_1_0.txt)
 */
 
+#define BOOST_TEST_MODULE odeint_implicit_euler
+
 #include <boost/test/unit_test.hpp>
 
 #include <boost/numeric/odeint.hpp>

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp (from r68346, /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/resizing.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -1,15 +1,17 @@
 /* Boost stepper_euler.cpp test file
-
+
  Copyright 2009 Karsten Ahnert
  Copyright 2009 Mario Mulansky
-
+
  This file tests the use of the euler stepper
-
+
  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)
 */
 
+#define BOOST_TEST_MODULE odeint_resize
+
 #include <vector>
 #include <cmath>
 

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_algebra.cpp (from r68348, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_algebra.cpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_algebra.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_algebra.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -5,9 +5,12 @@
  * Author: karsten
  */
 
+#define BOOST_TEST_MODULE odeint_dense_output_dopri5
+
 #include <cmath>
 #include <complex>
 #include <utility>
+#include <functional>
 #include <tr1/array>
 
 #include <boost/test/unit_test.hpp>
@@ -15,9 +18,17 @@
 
 #include <boost/range.hpp>
 
+#include <boost/units/systems/si/length.hpp>
+#include <boost/units/systems/si/time.hpp>
+#include <boost/units/systems/si/velocity.hpp>
+#include <boost/units/systems/si/io.hpp>
+
 #include <boost/numeric/odeint/algebra/standard_operations.hpp>
 #include <boost/numeric/odeint/algebra/standard_algebra.hpp>
 
+namespace units = boost::units;
+namespace si = boost::units::si;
+
 using boost::numeric::odeint::standard_operations;
 using boost::numeric::odeint::standard_algebra;
 
@@ -25,75 +36,98 @@
 
 BOOST_AUTO_TEST_SUITE( standard_algebra_test )
 
-BOOST_AUTO_TEST_CASE( test_for_each2 )
+BOOST_AUTO_TEST_CASE( for_each2 )
 {
         std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }};
- standard_algebra::for_each2( x1 , x2 , standard_operations::scale_sum1<>( 1.0 ) );
+ standard_algebra::for_each2()( x1 , x2 , standard_operations::scale_sum1<>( 1.0 ) );
         BOOST_CHECK_CLOSE( x1[0] , 2.0 , 1.0e-10 );
         BOOST_CHECK_CLOSE( x1[1] , 2.0 , 1.0e-10 );
 }
 
-BOOST_AUTO_TEST_CASE( test_for_each3 )
+BOOST_AUTO_TEST_CASE( for_each3 )
 {
         std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }};
- standard_algebra::for_each3( x1 , x2 , x3 , standard_operations::scale_sum2<>( 1.0 , 2.0 ) );
+ standard_algebra::for_each3()( x1 , x2 , x3 , standard_operations::scale_sum2<>( 1.0 , 2.0 ) );
         BOOST_CHECK_CLOSE( x1[0] , 8.0 , 1.0e-10 );
         BOOST_CHECK_CLOSE( x1[1] , 8.0 , 1.0e-10 );
 }
 
-BOOST_AUTO_TEST_CASE( test_for_each4 )
+BOOST_AUTO_TEST_CASE( for_each4 )
 {
         std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }};
- standard_algebra::for_each4( x1 , x2 , x3 , x4 , standard_operations::scale_sum3<>( 1.0 , 2.0 , 3.0 ) );
+ standard_algebra::for_each4()( x1 , x2 , x3 , x4 , standard_operations::scale_sum3<>( 1.0 , 2.0 , 3.0 ) );
         BOOST_CHECK_CLOSE( x1[0] , 20.0 , 1.0e-10 );
         BOOST_CHECK_CLOSE( x1[1] , 20.0 , 1.0e-10 );
 }
 
-BOOST_AUTO_TEST_CASE( test_for_each5 )
+BOOST_AUTO_TEST_CASE( for_each5 )
 {
         std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }};
- standard_algebra::for_each5( x1 , x2 , x3 , x4 , x5 , standard_operations::scale_sum4<>( 1.0 , 2.0 , 3.0 , 4.0 ) );
+ standard_algebra::for_each5()( x1 , x2 , x3 , x4 , x5 , standard_operations::scale_sum4<>( 1.0 , 2.0 , 3.0 , 4.0 ) );
         BOOST_CHECK_CLOSE( x1[0] , 40.0 , 1.0e-10 );
         BOOST_CHECK_CLOSE( x1[1] , 40.0 , 1.0e-10 );
 }
 
-BOOST_AUTO_TEST_CASE( test_for_each6 )
+BOOST_AUTO_TEST_CASE( for_each6 )
 {
         std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }};
- standard_algebra::for_each6( x1 , x2 , x3 , x4 , x5 , x6 ,standard_operations::scale_sum5<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ) );
+ standard_algebra::for_each6()( x1 , x2 , x3 , x4 , x5 , x6 ,standard_operations::scale_sum5<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ) );
         BOOST_CHECK_CLOSE( x1[0] , 70.0 , 1.0e-10 );
         BOOST_CHECK_CLOSE( x1[1] , 70.0 , 1.0e-10 );
 }
 
-BOOST_AUTO_TEST_CASE( test_for_each7 )
+BOOST_AUTO_TEST_CASE( for_each7 )
 {
         std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }} , x7 = {{ 7.0 , 7.0 }};
- standard_algebra::for_each7( x1 , x2 , x3 , x4 , x5 , x6 , x7 , standard_operations::scale_sum6<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ) );
+ standard_algebra::for_each7()( x1 , x2 , x3 , x4 , x5 , x6 , x7 , standard_operations::scale_sum6<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ) );
         BOOST_CHECK_CLOSE( x1[0] , 112.0 , 1.0e-10 );
         BOOST_CHECK_CLOSE( x1[1] , 112.0 , 1.0e-10 );
 }
 
-BOOST_AUTO_TEST_CASE( test_for_each8 )
+BOOST_AUTO_TEST_CASE( for_each8 )
 {
         std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }} , x7 = {{ 7.0 , 7.0 }} , x8 = {{ 8.0 , 8.0 }};
- standard_algebra::for_each8( x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , standard_operations::scale_sum7<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 ) );
+ standard_algebra::for_each8()( x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , standard_operations::scale_sum7<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 ) );
         BOOST_CHECK_CLOSE( x1[0] , 168.0 , 1.0e-10 );
         BOOST_CHECK_CLOSE( x1[1] , 168.0 , 1.0e-10 );
 }
 
-
-BOOST_AUTO_TEST_CASE( test_for_each2_with_range )
+BOOST_AUTO_TEST_CASE( reduce )
 {
-// std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }};
-// std::tr1::array< double , 4 > x2 = {{ 2.0 , 3.0 , 4.0 , 5.0 }};
-// standard_algebra::for_each2( x1 , std::make_pair( x2.begin() + 1 , x2.begin() + 3 ) , standard_operations::scale_sum1<>( 1.0 ) );
-// BOOST_CHECK_CLOSE( x1[0] , 3.0 , 1.0e-10 );
-// BOOST_CHECK_CLOSE( x1[1] , 4.0 , 1.0e-10 );
+ std::tr1::array< double , 2 > x = {{ 1.25 , 2.25 }};
+ double sum = standard_algebra::reduce()( x , std::plus< double >() , 0.0 );
+ BOOST_CHECK_CLOSE( sum , 3.5 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( x[0] , 1.25 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( x[1] , 2.25 , 1.0e-10 );
 }
 
 
+BOOST_AUTO_TEST_CASE( for_each2_with_range )
+{
+ std::tr1::array< double , 2 > x1 = {{ 1.0 , 1.0 }};
+ std::tr1::array< double , 4 > x2 = {{ 2.0 , 3.0 , 4.0 , 5.0 }};
+ standard_algebra::for_each2()( x1 , std::make_pair( x2.begin() + 1 , x2.begin() + 3 ) , standard_operations::scale_sum1<>( 1.0 ) );
+ BOOST_CHECK_CLOSE( x1[0] , 3.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( x1[1] , 4.0 , 1.0e-10 );
 
+ standard_algebra::for_each2()( std::make_pair( x2.begin() , x2.begin() + 2 ) , std::make_pair( x2.begin() + 2 ,x2.begin() + 4 ) , standard_operations::scale_sum1<>( 2.0 ) );
+ BOOST_CHECK_CLOSE( x2[0] , 8.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( x2[1] , 10.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( x2[2] , 4.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( x2[3] , 5.0 , 1.0e-10 );
+}
 
+BOOST_AUTO_TEST_CASE( for_each2_with_units )
+{
+ typedef units::quantity< si::time , double > time_type;
+ typedef units::quantity< si::length , double > length_type;
+ typedef units::quantity< si::velocity , double > velocity_type;
+ std::tr1::array< length_type , 2 > x1 = {{ 1.0 * si::meter , 1.0 * si::meter }};
+ std::tr1::array< velocity_type , 2 > x2 = {{ 2.0 * si::meter / si::seconds , 2.0 * si::meter / si::seconds }};
+ standard_algebra::for_each2()( x1 , x2 , standard_operations::scale_sum1< time_type >( 0.1 * si::second ) );
+ BOOST_CHECK_CLOSE( x1[0].value() , 0.2 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( x1[1].value() , 0.2 , 1.0e-10 );
+}
 
 
 BOOST_AUTO_TEST_SUITE_END()

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_operations.cpp (from r68346, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_operations.cpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_operations.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_operations.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -5,6 +5,8 @@
  * Author: karsten
  */
 
+#define BOOST_TEST_MODULE odeint_standard_operations
+
 #include <cmath>
 #include <complex>
 

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp (from r68346, /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/stepper_concepts.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -1,19 +1,19 @@
 /* Boost stepper_euler.cpp test file
-
+
  Copyright 2009 Karsten Ahnert
  Copyright 2009 Mario Mulansky
-
+
  This file tests the use of the all different steppers with several state types:
  std::vector< double >
  vector_space_1d< double > (see vector_space_1d.hpp)
  std::tr1::array< double , 1 >
-
+
  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)
 */
 
-#define BOOST_TEST_MODULE odeint_basic_test
+#define BOOST_TEST_MODULE odeint_stepper_concepts
 
 #include <vector>
 #include <cmath>

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/Jamfile
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/gmp/Jamfile (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/Jamfile 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -6,13 +6,10 @@
 
 import testing ;
 
-project
+project gmp
     : requirements
       <library>/boost/test//boost_unit_test_framework
-# <link>static
-# <link>shared:<define>BOOST_TEST_DYN_LINK=1
       <include>../../../../..
- <include>$BOOST_ROOT
     ;
     
     
@@ -21,11 +18,7 @@
 
 test-suite "gmp"
     :
- [ run check_gmp.cpp libgmpxx libgmp
- :
- :
- : <link>shared:<define>BOOST_TEST_DYN_LINK=1
- ]
+ [ run check_gmp.cpp libgmpxx libgmp : : : <link>shared:<define>BOOST_TEST_DYN_LINK=1 ]
     ;
 
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/check_gmp.cpp
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/gmp/check_gmp.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/check_gmp.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -10,7 +10,7 @@
  copy at http://www.boost.org/LICENSE_1_0.txt)
 */
 
-#define BOOST_TEST_MODULE test_gmp
+#define BOOST_TEST_MODULE odeint_gmp
 
 #include <gmpxx.h>
 
@@ -34,7 +34,7 @@
 }
 
 
-BOOST_AUTO_TEST_CASE( test_gmp )
+BOOST_AUTO_TEST_CASE( gmp )
 {
         /* We have to specify the desired precision in advance! */
         mpf_set_default_prec( precision );

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/Jamfile
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/gsl/Jamfile (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/Jamfile 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -10,7 +10,6 @@
     : requirements
       <library>/boost/test//boost_unit_test_framework
       <include>../../../../..
- <include>$BOOST_ROOT
     ;
     
     

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/check_gsl.cpp
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/gsl/check_gsl.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/check_gsl.cpp 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -10,7 +10,7 @@
  copy at http://www.boost.org/LICENSE_1_0.txt)
 */
 
-#define BOOST_TEST_MODULE test_gsl
+#define BOOST_TEST_MODULE odeint_gsl
 
 #include <gsl/gsl_vector.h>
 
@@ -23,6 +23,6 @@
 
 
 
-BOOST_AUTO_TEST_CASE( test_gsl )
+BOOST_AUTO_TEST_CASE( gsl )
 {
 }

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/mkl/Jamfile
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/mkl/Jamfile (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/mkl/Jamfile 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -10,7 +10,6 @@
     : requirements
       <library>/boost/test//boost_unit_test_framework
       <include>../../../../..
- <include>$BOOST_ROOT
     ;
     
     

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/Makefile
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/thrust/Makefile (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/Makefile 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -4,7 +4,7 @@
 CXX = g++
 NVCC = $(CUDA_ROOT)/bin/nvcc
 
-INCLUDES += -I$(BOOST_ROOT) -I$(THRUST_ROOT) -I$(CUDA_ROOT)/include -I../../../../..
+INCLUDES += -I$(BOOST_ROOT) -I$(THRUST_ROOT) -I$(CUDA_ROOT)/include -I../../../..
 
 NVCCFLAGS = -O3 $(INCLUDES) --compiler-bindir=/usr/bin/g++
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/check_thrust.cu
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/thrust/check_thrust.cu (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/check_thrust.cu 2011-01-21 11:50:13 EST (Fri, 21 Jan 2011)
@@ -53,7 +53,7 @@
 {
         state_type x(1);
         thrust::fill( x.begin() , x.end() , static_cast<base_type>(0.0) );
- explicit_euler< state_type , base_type , thrust_algebra ,thrust_operations > euler;
+ explicit_euler< state_type , base_type , state_type , base_type , thrust_algebra ,thrust_operations > euler;
         check_stepper_concept( euler , constant_system , x );
 
 


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