Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68453 - in sandbox/odeint/branches/karsten: . boost/numeric boost/numeric/odeint/algebra boost/numeric/odeint/algebra/external boost/numeric/odeint/stepper boost/numeric/odeint/stepper/base libs/numeric/odeint/examples libs/numeric/odeint/ideas libs/numeric/odeint/ideas/butcher libs/numeric/odeint/ideas/generic_stepper libs/numeric/odeint/ideas/units libs/numeric/odeint/test
From: karsten.ahnert_at_[hidden]
Date: 2011-01-26 07:46:02


Author: karsten
Date: 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
New Revision: 68453
URL: http://svn.boost.org/trac/boost/changeset/68453

Log:
* some refactoring, renaming names ....
* changing size_adjuster
* bringing implict_euler in shape
Added:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/default_operations.hpp (contents, props changed)
      - copied, changed from r68408, /sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_operations.hpp
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/default_resize.hpp (contents, props changed)
      - copied, changed from r68400, /sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_resize.hpp
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/range_algebra.hpp (contents, props changed)
      - copied, changed from r68371, /sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_algebra.hpp
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/size_adjuster.hpp (contents, props changed)
      - copied, changed from r68362, /sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adjust_size.hpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/default_operations.cpp (contents, props changed)
      - copied, changed from r68362, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_operations.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/range_algebra.cpp (contents, props changed)
      - copied, changed from r68371, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_algebra.cpp
Removed:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_algebra.hpp
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_operations.hpp
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_resize.hpp
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/vector_space_reduce.hpp
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adjust_size.hpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_algebra.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_operations.cpp
Text files modified:
   sandbox/odeint/branches/karsten/TODO | 2
   sandbox/odeint/branches/karsten/boost/numeric/odeint.hpp | 5 +
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/default_operations.hpp | 6 -
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/default_resize.hpp | 154 +++++++++++++++++++++++++++++++++------
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/external/ublas_resize.hpp | 38 +++++++++
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/range_algebra.hpp | 6
   sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/vector_space_algebra.hpp | 43 ++++++++--
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp | 4
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp | 4
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_fsal_base.hpp | 4
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp | 4
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp | 2
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_explicit_euler.hpp | 4
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/error_checker.hpp | 8 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp | 10 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp | 10 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp | 8 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4.hpp | 10 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/implicit_euler.hpp | 111 +++++++++++++++++++++-------
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/size_adjuster.hpp | 34 +++++--
   sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/stiff_system.cpp | 19 +++-
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/algebra_dispatcher.hpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/butcher/algebra.hpp | 20 ++--
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/generic_stepper/fusion_algebra.hpp | 20 ++--
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/operations_dispatcher.hpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/adjust_size_units.hpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/explicit_euler_units.hpp | 4
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/explicit_stepper_base_units.hpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile | 4
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/default_operations.cpp | 24 +++---
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/fusion_algebra.cpp | 18 ++--
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/implicit_euler.cpp | 4
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/range_algebra.cpp | 30 +++---
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp | 14 +-
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_with_units.cpp | 1
   36 files changed, 437 insertions(+), 198 deletions(-)

Modified: sandbox/odeint/branches/karsten/TODO
==============================================================================
--- sandbox/odeint/branches/karsten/TODO (original)
+++ sandbox/odeint/branches/karsten/TODO 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -26,6 +26,8 @@
   * create dense_output_explicit_controlled_fsal
   * maybe remove dense_output_explicit
 * split check_concepts into check_stepper_concept, check_error_stepper_concept, check_controlled_stepper_concept
+* split resizing and copy/destruct/construct in different files
+OK * change resizing concept, in order to word within the implicit steppers
 
 * Integrate functions
 * skript for setting the include defines according to the position in file system an writing a general copyright comment at the beginning

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -28,6 +28,9 @@
 #include <boost/numeric/odeint/stepper/dense_output_explicit_euler.hpp>
 #include <boost/numeric/odeint/stepper/dense_output_dopri5.hpp>
 
-#include <boost/numeric/odeint/algebra/fusion_algebra.hpp>
+/*
+ * Including this algebra slows down the compilation time
+ */
+// #include <boost/numeric/odeint/algebra/fusion_algebra.hpp>
 
 #endif // BOOST_NUMERIC_ODEINT_HPP

Copied: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/default_operations.hpp (from r68408, /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/default_operations.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -70,7 +70,7 @@
  *
  * * the results structs are needed in order to work with fusion_algebra
  */
-struct standard_operations
+struct default_operations
 {
 
         template< class Fac1 = double >
@@ -225,10 +225,6 @@
 
 
 
-
-
-
-
         /*
          * for usage in for_each2
          *

Copied: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/default_resize.hpp (from r68400, /sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_resize.hpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_resize.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/default_resize.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -16,6 +16,8 @@
 #include <vector>
 #include <list>
 
+#include <boost/range.hpp>
+
 #include <boost/type_traits/integral_constant.hpp> //for true_type and false_type
 
 namespace boost {
@@ -23,6 +25,70 @@
 namespace odeint {
 
 
+/*
+ * Default implementation for constructing a container does nothing
+ * gsl_vector must be construct explicitly
+ */
+template< class Container >
+struct construct_impl
+{
+ static void construct( Container &x )
+ {
+ }
+};
+
+
+template< class Container >
+void construct( Container &x )
+{
+ construct_impl< Container >::construct( x );
+}
+
+
+/*
+ * Default implementation for destruction of a container does nothing
+ * gsl_vector must be destroyed explicitly
+ */
+template< class Container >
+struct destruct_impl
+{
+ static void destruct( Container &x )
+ {
+ }
+};
+
+template< class Container >
+void destruct( Container &x )
+{
+ destruct_impl< Container >::destruct( x );
+}
+
+
+
+/*
+ * Default implementation of the copy operation used the assign operator
+ * gsl_vector must copied differently
+ */
+template< class Container1, class Container2 >
+struct copy_impl
+{
+ static void copy( const Container1 &from , Container2 &to )
+ {
+ to = from;
+ }
+};
+
+template< class Container1 , class Container2 >
+void copy( const Container1 &from , Container2 &to )
+{
+ copy_impl< Container1 , Container2 >::copy( from , to );
+}
+
+
+
+
+
+
 
 /*
  * by default any type is not resizable
@@ -44,7 +110,6 @@
         const static bool value = type::value;
 };
 
-
 /*
  * specialization for std::list
  */
@@ -57,50 +122,87 @@
 
 
 
-template< class Container >
-void construct( Container &x )
+
+
+
+/*
+ * Default implementation of resize functionality.
+ * This struct has to be specialized in order to work with ublas::matrix, etc.
+ */
+template< class Container1 , class Container2 >
+struct resize_impl
 {
-}
+ static void resize( const Container1 &x1 , Container2 &x2 )
+ {
+ x2.resize( boost::size( x1 ) );
+ }
+};
 
-template< class Container >
-void destruct( Container &x )
+template< class Container1 , class Container2 >
+void resize( const Container1 &x1 , Container2 &x2 )
 {
+ resize_impl< Container1 , Container2 >::resize( x1 , x2 );
 }
 
-template< class Container , class Deriv >
-void resize( const Container &x , Deriv &dxdt )
+
+
+
+/*
+ * Default implementation of same_size functionality.
+ * This struct has to be specialized in order to work with ublas::matrix, etc.
+ */
+template< class Container1 , class Container2 >
+struct same_size_impl
 {
- dxdt.resize( x.size() );
-}
+ static bool same_size( const Container1 &x1 , const Container2 &x2 )
+ {
+ return ( boost::size( x1 ) == boost::size( x2 ) );
+ }
+};
 
-template< class Container , class Deriv >
-bool same_size( const Container &x1 , const Deriv &x2 )
+template< class Container1 , class Container2 >
+bool same_size( const Container1 &x1 , const Container2 &x2 )
 {
- return ( x1.size() == x2.size() );
+ return same_size_impl< Container1 , Container2 >::same_size( x1 , x2 );
 }
 
-template< class Container , class Deriv >
-bool adjust_size( const Container &x1 , Deriv &x2 )
+
+
+
+
+/*
+ * Default implementation of adjust size functionality.
+ * This struct can be specialized.
+ *
+ * Return true or false if the container has been resized.
+ */
+template< class Container1 , class Container2 >
+struct adjust_size_impl
 {
- if( !same_size( x1 , x2 ) )
- {
- resize( x1 , x2 );
- return true;
- }
- else
+ static bool adjust_size( const Container1 &x1 , Container2 &x2 )
         {
- return false;
+ if( !same_size( x1 , x2 ) )
+ {
+ resize( x1 , x2 );
+ return true;
+ }
+ else
+ {
+ return false;
+ }
         }
-}
+};
 
-template< class Container , class Deriv >
-void copy( const Container &from , Deriv &to )
+
+template< class Container1 , class Container2 >
+bool adjust_size( const Container1 &x1 , Container2 &x2 )
 {
- to = from;
+ return adjust_size_impl< Container1 , Container2 >::adjust_size( x1 , x2 );
 }
 
 
 
+
 } // odeint
 } // numeric
 } // boost

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/external/ublas_resize.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/external/ublas_resize.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/external/ublas_resize.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -13,6 +13,7 @@
 #define BOOST_NUMERIC_ODEINT_UBLAS_RESIZE_HPP_INCLUDED
 
 #include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
 
 #include <boost/type_traits/integral_constant.hpp> //for true_type and false_type
 
@@ -23,13 +24,46 @@
 /*
  * specialization for boost::numeric::ublas::vector
  */
-template< class T >
-struct is_resizeable< boost::numeric::ublas::vector< T > >
+template< class T , class A >
+struct is_resizeable< boost::numeric::ublas::vector< T , A > >
 {
     struct type : public boost::true_type { };
     const static bool value = type::value;
 };
 
+
+/*
+ * specialization for boost::numeric::ublas::matrix
+ */
+template< class T , class L , class A >
+struct is_resizeable< boost::numeric::ublas::matrix< T , L , A > >
+{
+ struct type : public boost::true_type { };
+ const static bool value = type::value;
+};
+
+template< class T , class L , class A >
+struct resize_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::matrix< T , L , A > >
+{
+ static void resize( const boost::numeric::ublas::matrix< T , L , A > &x1 , boost::numeric::ublas::matrix< T , L , A > &x2 )
+ {
+ x2.resize( x1.size1() , x1.size2() );
+ }
+};
+
+template< class T , class L , class A >
+struct same_size_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::matrix< T , L , A > >
+{
+ static bool same_size( const boost::numeric::ublas::matrix< T , L , A > &x1 , boost::numeric::ublas::matrix< T , L , A > &x2 )
+ {
+ return ( ( x1.size1() == x2.size1() ) && ( x1.size2() == x2.size2() ) );
+ }
+};
+
+
+
+
+
 } // odeint
 } // numeric
 } // boost

Copied: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/range_algebra.hpp (from r68371, /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/range_algebra.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -1,5 +1,5 @@
 /*
- boost header: BOOST_NUMERIC_ODEINT/standard_algebra.hpp
+ boost header: BOOST_NUMERIC_ODEINT/range_algebra.hpp
 
  Copyright 2009 Karsten Ahnert
  Copyright 2009 Mario Mulansky
@@ -17,7 +17,7 @@
 #define BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY 9
 #include <boost/functional/forward_adapter.hpp>
 
-#include <boost/type_traits.hpp>
+#include <boost/type_traits/remove_reference.hpp>
 
 #include <boost/numeric/odeint/algebra/detail/macros.hpp>
 #include <boost/numeric/odeint/algebra/detail/for_each.hpp>
@@ -27,7 +27,7 @@
 namespace numeric {
 namespace odeint {
 
-struct standard_algebra
+struct range_algebra
 {
         struct for_each1_impl
         {

Deleted: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_algebra.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_algebra.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
+++ (empty file)
@@ -1,190 +0,0 @@
-/*
- boost header: BOOST_NUMERIC_ODEINT/standard_algebra.hpp
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
- Copyright 2009 Andre Bergner
-
- 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
-
-#include <boost/range.hpp>
-#define BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY 9
-#include <boost/functional/forward_adapter.hpp>
-
-#include <boost/type_traits.hpp>
-
-#include <boost/numeric/odeint/algebra/detail/macros.hpp>
-#include <boost/numeric/odeint/algebra/detail/for_each.hpp>
-#include <boost/numeric/odeint/algebra/detail/reduce.hpp>
-
-namespace boost {
-namespace numeric {
-namespace odeint {
-
-struct standard_algebra
-{
- struct for_each1_impl
- {
- 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;
- };
-
- struct for_each2_impl
- {
- 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;
- };
-
-
- struct for_each3_impl
- {
-
- 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;
- };
-
-
-
-
-
- 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
- {
- detail::for_each4( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , op );
- }
- 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
- {
- 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;
- };
-
-
-
-
-
-
- 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
- {
- 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;
- };
-
-
-
-
-
-
- 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
- {
- 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;
- };
-
-
-
-
-
-
- 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
- {
- 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;
- };
-
-
-// struct reduce
-// {
-// 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 );
-// }
-// };
-
- struct reduce_impl
- {
- 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 T > struct result;
- template< class F , class T1 , class T2 , class T3 >
- struct result< F( T1 , T2 , T3 ) >
- {
- /*
- * typedef T3 type would result in warnings
- */
- typedef typename boost::remove_reference< T3 >::type 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;
-
-};
-
-} // odeint
-} // numeric
-} // boost
-
-
-#endif //BOOST_BOOST_NUMERIC_ODEINT_STANDARD_ALGEBRA_HPP_INCLUDED

Deleted: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_operations.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_operations.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
+++ (empty file)
@@ -1,288 +0,0 @@
-/*
- boost header: BOOST_NUMERIC_ODEINT/standard_operations.hpp
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
- Copyright 2009 Andre Bergner
-
- 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_OPERATIONS_HPP_INCLUDED
-#define BOOST_BOOST_NUMERIC_ODEINT_STANDARD_OPERATIONS_HPP_INCLUDED
-
-#include <algorithm>
-#include <cmath> // for std::max
-
-#include <boost/utility/result_of.hpp>
-#include <boost/units/quantity.hpp>
-
-namespace boost {
-namespace numeric {
-namespace odeint {
-
-/*
- * Conversion of boost::units for use in standard_operations::rel_error and standard_operations::maximum
- */
-namespace detail
-{
- template< class T >
- struct get_value_impl
- {
- static T value( const T &t ) { return t; }
- typedef T result_type;
- };
-
- template< class Unit , class T >
- struct get_value_impl< boost::units::quantity< Unit , T > >
- {
- static T value( const boost::units::quantity< Unit , T > &t ) { return t.value(); }
- typedef T result_type;
- };
-
- template< class T >
- typename get_value_impl< T >::result_type get_value( const T &t ) { return get_value_impl< T >::value( t ); }
-
-
-
- template< class T , class V >
- struct set_value_impl
- {
- static void set_value( T &t , const V &v ) { t = v; }
- };
-
- template< class Unit , class T , class V >
- struct set_value_impl< boost::units::quantity< Unit , T > , V >
- {
- static void set_value( boost::units::quantity< Unit , T > &t , const V &v ) { t = boost::units::quantity< Unit , T >::from_value( v ); }
- };
-
- template< class T , class V >
- void set_value( T &t , const V &v ) { return set_value_impl< T , V >::set_value( t , v ); }
-}
-
-
-
-/*
- * Notes:
- *
- * * the results structs are needed in order to work with fusion_algebra
- */
-struct standard_operations
-{
-
- template< class Fac1 = double >
- struct scale_sum1
- {
- const Fac1 m_alpha1;
-
- scale_sum1( const Fac1 &alpha1 ) : m_alpha1( alpha1 ) { }
-
- template< class T1 , class T2 >
- void operator()( T1 &t1 , const T2 &t2 ) const
- {
- t1 = m_alpha1 * t2;
- }
-
- typedef void result_type;
- };
-
-
- template< class Fac1 = double , class Fac2 = Fac1 >
- struct scale_sum2
- {
- const Fac1 m_alpha1;
- const Fac2 m_alpha2;
-
- scale_sum2( const Fac1 &alpha1 , const Fac2 &alpha2 ) : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { }
-
- template< class T1 , class T2 , class T3 >
- void operator()( T1 &t1 , const T2 &t2 , const T3 &t3) const
- {
- t1 = m_alpha1 * t2 + m_alpha2 * t3;
- }
-
- typedef void result_type;
- };
-
-
- template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 >
- struct scale_sum3
- {
- const Fac1 m_alpha1;
- const Fac2 m_alpha2;
- const Fac3 m_alpha3;
-
- scale_sum3( const Fac1 &alpha1 , const Fac2 &alpha2 , const Fac3 &alpha3 )
- : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) { }
-
- template< class T1 , class T2 , class T3 , class T4 >
- void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 ) const
- {
- t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4;
- }
-
- typedef void result_type;
- };
-
-
- template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 >
- struct scale_sum4
- {
- const Fac1 m_alpha1;
- const Fac2 m_alpha2;
- const Fac3 m_alpha3;
- const Fac4 m_alpha4;
-
- scale_sum4( const Fac1 &alpha1 , const Fac2 &alpha2 , const Fac3 &alpha3 , const Fac4 &alpha4 )
- : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) { }
-
- template< class T1 , class T2 , class T3 , class T4 , class T5 >
- void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5) const
- {
- t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5;
- }
-
- typedef void result_type;
- };
-
-
- template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 >
- struct scale_sum5
- {
- const Fac1 m_alpha1;
- const Fac2 m_alpha2;
- const Fac3 m_alpha3;
- const Fac4 m_alpha4;
- const Fac5 m_alpha5;
-
- scale_sum5( const Fac1 &alpha1 , const Fac2 &alpha2 , const Fac3 &alpha3 , const Fac4 &alpha4 , const Fac5 &alpha5 )
- : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { }
-
- template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
- void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6) const
- {
- t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6;
- }
-
- typedef void result_type;
- };
-
-
- template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 >
- struct scale_sum6
- {
- const Fac1 m_alpha1;
- const Fac2 m_alpha2;
- const Fac3 m_alpha3;
- const Fac4 m_alpha4;
- const Fac5 m_alpha5;
- const Fac6 m_alpha6;
-
- scale_sum6( const Fac1 &alpha1 , const Fac2 &alpha2 , const Fac3 &alpha3 , const Fac4 &alpha4 , const Fac5 &alpha5 , const Fac6 &alpha6 )
- : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ){ }
-
- template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
- void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 ,const T7 &t7) const
- {
- t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7;
- }
-
- typedef void result_type;
- };
-
-
- template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 >
- struct scale_sum7
- {
- const Fac1 m_alpha1;
- const Fac2 m_alpha2;
- const Fac3 m_alpha3;
- const Fac4 m_alpha4;
- const Fac5 m_alpha5;
- const Fac6 m_alpha6;
- const Fac7 m_alpha7;
-
- scale_sum7( const Fac1 &alpha1 , const Fac2 &alpha2 , const Fac3 &alpha3 , const Fac4 &alpha4 ,
- const Fac5 &alpha5 , const Fac6 &alpha6 , const Fac7 &alpha7 )
- : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) { }
-
- template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 >
- void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 ) const
- {
- t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8;
- }
-
- typedef void result_type;
- };
-
-
-
-
-
-
-
-
-
-
-
-
- /*
- * for usage in for_each2
- *
- * Works with boost::units by eliminating the unit
- */
- template< class Fac1 = double >
- struct rel_error
- {
- const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt;
-
- rel_error( const Fac1 &eps_abs , const Fac1 &eps_rel , const Fac1 &a_x , const Fac1 &a_dxdt )
- : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt ) { }
-
-
- template< class T1 , class T2 , class T3 >
- void operator()( const T1 &t1 , const T2 &t2 , T3 &t3 ) const
- {
- using std::abs;
- using detail::get_value;
- using detail::set_value;
- set_value( t3 , abs( get_value( t3 ) ) / ( m_eps_abs + m_eps_rel * ( m_a_x * abs( get_value( t1 ) ) + m_a_dxdt * abs( get_value( t2 ) ) ) ) );
- }
-
- typedef void result_type;
- };
-
-
- /*
- * for usage in reduce
- */
-
- template< class Value >
- struct maximum
- {
- template< class Fac1 , class Fac2 >
- Value operator()( const Fac1 &t1 , const Fac2 &t2 ) const
- {
- using std::max;
- using std::abs;
- using detail::get_value;
- Value a1 = abs( get_value( t1 ) ) , a2 = abs( get_value( t2 ) );
- return ( a1 < a2 ) ? a2 : a1 ;
- }
-
- typedef Value result_type;
- };
-
-
-};
-
-
-} // odeint
-} // numeric
-} // boost
-
-
-#endif //BOOST_BOOST_NUMERIC_ODEINT_STANDARD_OPERATIONS_HPP_INCLUDED

Deleted: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_resize.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/standard_resize.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
+++ (empty file)
@@ -1,109 +0,0 @@
-/*
- boost header: BOOST_NUMERIC_ODEINT/standard_resize.hpp
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
- Copyright 2009 Andre Bergner
-
- 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_NUMERIC_ODEINT_STANDARD_RESIZE_HPP_INCLUDED
-#define BOOST_NUMERIC_ODEINT_STANDARD_RESIZE_HPP_INCLUDED
-
-#include <vector>
-#include <list>
-
-#include <boost/type_traits/integral_constant.hpp> //for true_type and false_type
-
-namespace boost {
-namespace numeric {
-namespace odeint {
-
-
-
-/*
- * by default any type is not resizable
- */
-template< class Container >
-struct is_resizeable
-{
- struct type : public boost::false_type { };
- const static bool value = type::value;
-};
-
-/*
- * specialization for std::vector
- */
-template< class V, class A >
-struct is_resizeable< std::vector< V , A > >
-{
- struct type : public boost::true_type { };
- const static bool value = type::value;
-};
-
-
-/*
- * specialization for std::list
- */
-template< class V , class A >
-struct is_resizeable< std::list< V , A > >
-{
- struct type : public boost::true_type { };
- const static bool value = type::value;
-};
-
-
-
-template< class Container >
-void construct( Container &x )
-{
-}
-
-template< class Container >
-void destruct( Container &x )
-{
-}
-
-template< class Container , class Deriv >
-void resize( const Container &x , Deriv &dxdt )
-{
- dxdt.resize( x.size() );
-}
-
-template< class Container , class Deriv >
-bool same_size( const Container &x1 , const Deriv &x2 )
-{
- return ( x1.size() == x2.size() );
-}
-
-template< class Container , class Deriv >
-bool adjust_size( const Container &x1 , Deriv &x2 )
-{
- if( !same_size( x1 , x2 ) )
- {
- resize( x1 , x2 );
- return true;
- }
- else
- {
- return false;
- }
-}
-
-template< class Container , class Deriv >
-void copy( const Container &from , Deriv &to )
-{
- to = from;
-}
-
-
-
-} // odeint
-} // numeric
-} // boost
-
-
-#endif //BOOST_NUMERIC_ODEINT_STANDARD_RESIZE_HPP_INCLUDED

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-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -13,15 +13,40 @@
 #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>
 
+#include <boost/type_traits/remove_reference.hpp>
+
+
 namespace boost {
 namespace numeric {
 namespace odeint {
 
 
+/*
+ * This class template has to be overload in order to call vector_space_algebra::reduce
+ */
+template< class State > struct vector_space_reduce;
+
+/*
+ * Example:
+ */
+//template< class LorenzState >
+//class vector_space_reduce
+//{
+// template< class Value , class Op >
+// Value operator()( const LorenzState &s , Op op , Value init ) const
+// {
+// init = op( init , s.x );
+// init = op( init , s.y );
+// init = op( init , s.z );
+// return init;
+// }
+//};
+
+
+
 struct vector_space_algebra
 {
         struct for_each1_impl
@@ -112,7 +137,7 @@
         };
 
 
- struct reduce
+ struct reduce_impl
         {
                 template< class Value , class S , class Red >
                 Value operator()( const S &s , Red red , Value init ) const
@@ -121,12 +146,12 @@
                         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;
-// };
+ template< class T > struct result;
+ template< class F , class T1 , class T2 , class T3 >
+ struct result< F( T1 , T2 , T3 ) >
+ {
+ typedef typename boost::remove_reference< T3 >::type type;
+ };
         };
 
 
@@ -138,7 +163,7 @@
         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;
+ typedef boost::forward_adapter< reduce_impl , 3 > reduce;
 
 
 };

Deleted: sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/vector_space_reduce.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/algebra/vector_space_reduce.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
+++ (empty file)
@@ -1,35 +0,0 @@
-/*
- * vector_space_reduce.hpp
- *
- * Created on: Jan 19, 2011
- * Author: karsten
- */
-
-#ifndef VECTOR_SPACE_REDUCE_HPP_
-#define VECTOR_SPACE_REDUCE_HPP_
-
-namespace boost {
-namespace numeric {
-namespace odeint {
-
-template< class State > struct vector_space_reduce;
-
-//template< class LorenzState >
-//class vector_space_reduce
-//{
-// template< class Value , class Op >
-// Value operator()( const LorenzState &s , Op op , Value init ) const
-// {
-// init = op( init , s.x );
-// init = op( init , s.y );
-// init = op( init , s.z );
-// return init;
-// }
-//};
-
-} // odeint
-} // numeric
-} // boost
-
-
-#endif /* VECTOR_SPACE_REDUCE_HPP_ */

Deleted: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adjust_size.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adjust_size.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
+++ (empty file)
@@ -1,196 +0,0 @@
-/*
- boost header: NUMERIC_ODEINT/adjust_size.hpp
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
- Copyright 2009 Andre Bergner
-
- 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_NUMERIC_ODEINT_ADJUST_SIZE_HPP_INCLUDED
-#define BOOST_NUMERIC_ODEINT_ADJUST_SIZE_HPP_INCLUDED
-
-#include <algorithm>
-
-#include <boost/noncopyable.hpp>
-#include <boost/array.hpp>
-
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
-
-
-namespace boost {
-namespace numeric {
-namespace odeint {
-
-
-
-/*
- * Tags to specify resize behavior of steppers
- */
-struct adjust_size_manually_tag {};
-struct adjust_size_initially_tag {};
-struct adjust_size_always_tag {};
-
-
-
-
-
-
-/*
- * Adjust size functionality with policies and resizeability
- */
-template< class Deriv , size_t Dim >
-class size_adjuster : boost::noncopyable
-{
-public:
-
- size_adjuster() : m_is_initialized( false ) , m_states()
- {
- std::fill( m_states.begin() , m_states.end() , static_cast< Deriv* >( 0 ) );
- }
-
- template< class State >
- bool adjust_size( const State &x )
- {
- return adjust_size_by_resizeability( x , typename is_resizeable< Deriv >::type() );
- }
-
- template< class State >
- bool adjust_size_by_policy( const State &x , adjust_size_manually_tag )
- {
- return false;
- }
-
- template< class State >
- bool adjust_size_by_policy( const State &x , adjust_size_initially_tag )
- {
- if( !m_is_initialized )
- {
- m_is_initialized = true;
- return adjust_size_by_resizeability( x , typename is_resizeable< Deriv >::type() );
- }
- else
- {
- return false;
- }
- }
-
- template< class State >
- bool adjust_size_by_policy( const State &x , adjust_size_always_tag )
- {
- return adjust_size_by_resizeability( x , typename is_resizeable< Deriv >::type() );
- }
-
- void register_state( size_t idx , Deriv &x )
- {
- m_states[idx] = &x;
- }
-
-
-private:
-
- template< class State >
- bool adjust_size_by_resizeability( const State &x , boost::true_type )
- {
- for( size_t i=0 ; i<Dim ; ++i )
- {
- boost::numeric::odeint::adjust_size( x , *(m_states[i]) );
- }
- return ( Dim > 0 );
- }
-
- template< class State >
- bool adjust_size_by_resizeability( const State &x , boost::false_type )
- {
- return false;
- }
-
-
-private :
-
- bool m_is_initialized;
- boost::array< Deriv* , Dim > m_states;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*
- * really old stuff
- */
-//template< class State , class AdjustSizeImpl >
-//class size_adjuster
-//{
-//public:
-//
-// size_adjuster( AdjustSizeImpl &adjust_size_impl ) : m_is_initialized( false ) , m_adjust_size_impl( adjust_size_impl ) { }
-//
-// void adjust_size( const State &x )
-// {
-// adjust_size_by_resizeability( x , typename is_resizeable< State >::type() );
-// }
-//
-// void adjust_size_by_policy( const State &x , adjust_size_manually_tag )
-// {
-// }
-//
-// void adjust_size_by_policy( const State &x , adjust_size_initially_tag )
-// {
-// if( !m_is_initialized )
-// {
-// adjust_size_by_resizeability( x , typename is_resizeable< State >::type() );
-// m_is_initialized = true;
-// }
-// }
-//
-// void adjust_size_by_policy( const State &x , adjust_size_always_tag )
-// {
-// adjust_size_by_resizeability( x , typename is_resizeable< State >::type() );
-// }
-//
-//
-//private:
-//
-//
-// void adjust_size_by_resizeability( const State &x , boost::true_type )
-// {
-// m_adjust_size_impl( x );
-// }
-//
-// void adjust_size_by_resizeability( const State &x , boost::false_type )
-// {
-// }
-//
-//
-//private :
-//
-// bool m_is_initialized;
-// AdjustSizeImpl &m_adjust_size_impl;
-//};
-
-
-} // odeint
-} // numeric
-} // boost
-
-
-#endif //BOOST_NUMERIC_ODEINT_ADJUST_SIZE_HPP_INCLUDED

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-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -15,8 +15,8 @@
 
 #include <boost/ref.hpp>
 
-#include <boost/numeric/odeint/stepper/adjust_size.hpp>
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+#include <boost/numeric/odeint/stepper/size_adjuster.hpp>
+#include <boost/numeric/odeint/algebra/default_resize.hpp>
 
 
 namespace boost {

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -15,8 +15,8 @@
 
 #include <boost/ref.hpp>
 
-#include <boost/numeric/odeint/stepper/adjust_size.hpp>
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+#include <boost/numeric/odeint/stepper/size_adjuster.hpp>
+#include <boost/numeric/odeint/algebra/default_resize.hpp>
 
 
 namespace boost {

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_fsal_base.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_fsal_base.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_fsal_base.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -15,8 +15,8 @@
 
 #include <boost/ref.hpp>
 
-#include <boost/numeric/odeint/stepper/adjust_size.hpp>
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+#include <boost/numeric/odeint/stepper/size_adjuster.hpp>
+#include <boost/numeric/odeint/algebra/default_resize.hpp>
 
 
 namespace boost {

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -15,8 +15,8 @@
 
 #include <boost/ref.hpp>
 
-#include <boost/numeric/odeint/stepper/adjust_size.hpp>
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+#include <boost/numeric/odeint/stepper/size_adjuster.hpp>
+#include <boost/numeric/odeint/algebra/default_resize.hpp>
 
 
 namespace boost {

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-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -18,7 +18,7 @@
 #include <boost/noncopyable.hpp>
 #include <boost/ref.hpp>
 
-#include <boost/numeric/odeint/stepper/adjust_size.hpp>
+#include <boost/numeric/odeint/stepper/size_adjuster.hpp>
 #include <boost/numeric/odeint/stepper/error_checker.hpp>
 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
 

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-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -25,8 +25,8 @@
     class Value = double ,
     class Deriv = State ,
     class Time = Value ,
- class Algebra = standard_algebra ,
- class Operations = standard_operations ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
         class AdjustSizePolicy = adjust_size_initially_tag
>
 class dense_output_explicit_euler

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-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -13,8 +13,8 @@
 #ifndef BOOST_NUMERIC_ODEINT_ERROR_CHECKER_HPP_INCLUDED
 #define BOOST_NUMERIC_ODEINT_ERROR_CHECKER_HPP_INCLUDED
 
-#include <boost/numeric/odeint/algebra/standard_algebra.hpp>
-#include <boost/numeric/odeint/algebra/standard_operations.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
 
 namespace boost {
 namespace numeric {
@@ -27,8 +27,8 @@
 template
 <
         class Value ,
- class Algebra = standard_algebra ,
- class Operations = standard_operations
+ class Algebra = range_algebra ,
+ class Operations = default_operations
>
 class error_checker_standard
 {

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -14,9 +14,9 @@
 
 #include <boost/ref.hpp>
 
-#include <boost/numeric/odeint/algebra/standard_algebra.hpp>
-#include <boost/numeric/odeint/algebra/standard_operations.hpp>
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/algebra/default_resize.hpp>
 
 #include <boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_fsal_base.hpp>
 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
@@ -34,8 +34,8 @@
     class Value = double ,
     class Deriv = State ,
     class Time = double ,
- class Algebra = standard_algebra ,
- class Operations = standard_operations ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
         class AdjustSizePolicy = adjust_size_initially_tag
>
 class explicit_error_dopri5

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-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -15,9 +15,9 @@
 
 #include <boost/ref.hpp>
 
-#include <boost/numeric/odeint/algebra/standard_algebra.hpp>
-#include <boost/numeric/odeint/algebra/standard_operations.hpp>
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/algebra/default_resize.hpp>
 
 #include <boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp>
 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
@@ -39,8 +39,8 @@
     class Value = double ,
     class Deriv = State ,
     class Time = double ,
- class Algebra = standard_algebra ,
- class Operations = standard_operations ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
         class AdjustSizePolicy = adjust_size_initially_tag
>
 class explicit_error_rk54_ck

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-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -13,8 +13,8 @@
 #ifndef BOOST_BOOST_NUMERIC_ODEINT_EXPLICIT_EULER_HPP_INCLUDED
 #define BOOST_BOOST_NUMERIC_ODEINT_EXPLICIT_EULER_HPP_INCLUDED
 
-#include <boost/numeric/odeint/algebra/standard_algebra.hpp>
-#include <boost/numeric/odeint/algebra/standard_operations.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
 
 #include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
 #include <boost/numeric/odeint/stepper/detail/macros.hpp>
@@ -31,8 +31,8 @@
     class Value = double ,
     class Deriv = State ,
     class Time = Value ,
- class Algebra = standard_algebra ,
- class Operations = standard_operations ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
         class AdjustSizePolicy = adjust_size_initially_tag
>
 class explicit_euler

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-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -15,9 +15,9 @@
 
 #include <boost/ref.hpp>
 
-#include <boost/numeric/odeint/algebra/standard_algebra.hpp>
-#include <boost/numeric/odeint/algebra/standard_operations.hpp>
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/algebra/default_resize.hpp>
 
 #include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
 #include <boost/numeric/odeint/stepper/detail/macros.hpp>
@@ -32,8 +32,8 @@
     class Value = double ,
     class Deriv = State ,
     class Time = Value ,
- class Algebra = standard_algebra ,
- class Operations = standard_operations ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
         class AdjustSizePolicy = adjust_size_initially_tag
>
 class explicit_rk4

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/implicit_euler.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/implicit_euler.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/implicit_euler.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -12,6 +12,11 @@
 #ifndef BOOST_BOOST_NUMERIC_ODEINT_IMPLICIT_EULER_HPP_INCLUDED
 #define BOOST_BOOST_NUMERIC_ODEINT_IMPLICIT_EULER_HPP_INCLUDED
 
+#include <utility>
+
+#include <boost/numeric/odeint/stepper/size_adjuster.hpp>
+#include <boost/numeric/odeint/algebra/external/ublas_resize.hpp>
+
 #include <boost/numeric/ublas/vector.hpp>
 #include <boost/numeric/ublas/matrix.hpp>
 #include <boost/numeric/ublas/lu.hpp>
@@ -21,46 +26,87 @@
 namespace odeint {
 
 
-template< class ValueType >
+template< class T >
+struct is_resizeable< boost::numeric::ublas::permutation_matrix< T > >
+{
+ struct type : public boost::true_type { };
+ const static bool value = type::value;
+};
+
+
+
+
+struct matrix_vector_adjuster
+{
+ template< class Vector , class Matrix >
+ static bool adjust_size( const Vector &v , Matrix &m )
+ {
+ if( ( m.size1() != v.size() ) || ( m.size2() != v.size() ) )
+ {
+ m.resize( v.size() , v.size() );
+ return true;
+ }
+ return false;
+ }
+};
+
+
+template< class ValueType , class AdjustSizePolicy = adjust_size_initially_tag >
 class implicit_euler
 {
 
 public:
 
     typedef ValueType value_type;
+ typedef value_type time_type;
     typedef boost::numeric::ublas::vector< value_type > state_type;
+ typedef state_type deriv_type;
     typedef boost::numeric::ublas::matrix< value_type > matrix_type;
     typedef boost::numeric::ublas::permutation_matrix< size_t > pmatrix_type;
+ typedef AdjustSizePolicy adjust_size_policy;
 
- implicit_euler( const value_type epsilon = 1E-6 ) : m_epsilon( epsilon ) , m_pm( 1 )
- { }
+ implicit_euler( const value_type epsilon = 1E-6 )
+ : m_epsilon( epsilon ) ,
+ m_state_adjuster() , m_matrix_adjuster() , m_pmatrix_adjuster() ,
+ m_dxdt() , m_x() , m_b() ,
+ m_jacobi() , m_pm( 1 )
+ {
+ m_state_adjuster.register_state( 0 , m_dxdt );
+ m_state_adjuster.register_state( 1 , m_x );
+ m_state_adjuster.register_state( 2 , m_b );
+ m_matrix_adjuster.register_state( 0 , m_jacobi );
+ m_pmatrix_adjuster.register_state( 0 , m_pm );
+ }
 
- template< class System , class Jacobi >
- void do_step( System system , Jacobi jacobi , state_type &x , value_type t , value_type dt )
+ template< class System >
+ void do_step( System system , state_type &x , value_type t , value_type dt )
     {
- typename boost::unwrap_reference< System >::type &sys = system;
- typename boost::unwrap_reference< Jacobi >::type &jac = jacobi;
+ typedef typename boost::unwrap_reference< System >::type system_type;
+ typedef typename boost::unwrap_reference< typename system_type::first_type >::type deriv_func_type;
+ typedef typename boost::unwrap_reference< typename system_type::second_type >::type jacobi_func_type;
+ system_type &sys = system;
+ deriv_func_type &deriv_func = sys.first;
+ jacobi_func_type &jacobi_func = sys.second;
+
+ m_state_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
+ m_matrix_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
+ m_pmatrix_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
 
- m_dxdt.resize( x.size() );
- m_x.resize( x.size() );
- m_b.resize( x.size() );
- m_jacobi.resize( x.size() , x.size() );
- m_pm = pmatrix_type( x.size() ); // no resize because we also need default filling
+ for( size_t i=0 ; i<x.size() ; ++i )
+ m_pm[i] = i;
 
         t += dt;
 
         // apply first Newton step
- sys( x , m_dxdt , t );
+ deriv_func( x , m_dxdt , t );
 
         m_b = dt * m_dxdt;
 
- jac( x , m_jacobi , t );
+ jacobi_func( x , m_jacobi , t );
         m_jacobi *= dt;
         m_jacobi -= boost::numeric::ublas::identity_matrix< value_type >( x.size() );
 
- matrix_type jacobi_tmp( m_jacobi );
-
- solve( m_b , jacobi_tmp );
+ solve( m_b , m_jacobi );
 
         m_x = x - m_b;
 
@@ -68,42 +114,53 @@
         // ToDo: maybe we should apply only one Newton step -> linear implicit one-step scheme
         while( boost::numeric::ublas::norm_2( m_b ) > m_epsilon )
         {
- sys( m_x , m_dxdt , t );
+ deriv_func( m_x , m_dxdt , t );
             m_b = x - m_x + dt*m_dxdt;
 
- /* we use simplified newton where the jacobi matrix is evaluated only once
- jacobi( m_x , m_jacobi , t );
- m_jacobi *= dt;
- m_jacobi -= boost::numeric::ublas::identity_matrix< value_type >( x.size() );
- */
- jacobi_tmp = m_jacobi;
+ // simplified version, only the first Jacobian is used
+// jacobi( m_x , m_jacobi , t );
+// m_jacobi *= dt;
+// m_jacobi -= boost::numeric::ublas::identity_matrix< value_type >( x.size() );
 
- solve( m_b , jacobi_tmp );
+ solve( m_b , m_jacobi );
 
             m_x -= m_b;
         }
         x = m_x;
     }
 
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ m_state_adjuster.adjust_size( x );
+ m_matrix_adjuster.adjust_size( x );
+ m_pmatrix_adjuster.adjust_size( x );
+ }
+
+
 private:
 
     void solve( state_type &x , matrix_type &m )
     {
         int res = boost::numeric::ublas::lu_factorize( m , m_pm );
         if( res != 0 ) exit(0);
-
         boost::numeric::ublas::lu_substitute( m , m_pm , x );
     }
 
 private:
- const value_type m_epsilon;
 
+ const value_type m_epsilon;
+ size_adjuster< state_type , 3 > m_state_adjuster;
+ size_adjuster< matrix_type , 1 , matrix_vector_adjuster> m_matrix_adjuster;
+ size_adjuster< pmatrix_type , 1 > m_pmatrix_adjuster;
     state_type m_dxdt;
     state_type m_x;
     state_type m_b;
     matrix_type m_jacobi;
     pmatrix_type m_pm;
 
+
 };
 
 

Copied: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/size_adjuster.hpp (from r68362, /sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adjust_size.hpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/adjust_size.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/size_adjuster.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -18,7 +18,7 @@
 #include <boost/noncopyable.hpp>
 #include <boost/array.hpp>
 
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+#include <boost/numeric/odeint/algebra/default_resize.hpp>
 
 
 namespace boost {
@@ -37,25 +37,37 @@
 
 
 
+struct default_adjust_size_caller
+{
+ template< class Container1 , class Container2 >
+ static bool adjust_size( const Container1 &x1 , Container2 &x2 )
+ {
+ return boost::numeric::odeint::adjust_size( x1 , x2 );
+ }
+};
 
 
 /*
  * Adjust size functionality with policies and resizeability
  */
-template< class Deriv , size_t Dim >
+template< class Container , size_t Dim , class AdjustSizeCaller = default_adjust_size_caller >
 class size_adjuster : boost::noncopyable
 {
 public:
 
+ typedef Container container_type;
+ static const size_t dim = Dim;
+ typedef AdjustSizeCaller adjust_size_caller;
+
         size_adjuster() : m_is_initialized( false ) , m_states()
         {
- std::fill( m_states.begin() , m_states.end() , static_cast< Deriv* >( 0 ) );
+ std::fill( m_states.begin() , m_states.end() , static_cast< container_type* >( 0 ) );
         }
 
         template< class State >
         bool adjust_size( const State &x )
         {
- return adjust_size_by_resizeability( x , typename is_resizeable< Deriv >::type() );
+ return adjust_size_by_resizeability( x , typename is_resizeable< container_type >::type() );
         }
 
         template< class State >
@@ -70,7 +82,7 @@
                 if( !m_is_initialized )
                 {
                         m_is_initialized = true;
- return adjust_size_by_resizeability( x , typename is_resizeable< Deriv >::type() );
+ return adjust_size_by_resizeability( x , typename is_resizeable< container_type >::type() );
                 }
                 else
                 {
@@ -81,10 +93,10 @@
         template< class State >
         bool adjust_size_by_policy( const State &x , adjust_size_always_tag )
         {
- return adjust_size_by_resizeability( x , typename is_resizeable< Deriv >::type() );
+ return adjust_size_by_resizeability( x , typename is_resizeable< container_type >::type() );
         }
 
- void register_state( size_t idx , Deriv &x )
+ void register_state( size_t idx , container_type &x )
         {
                 m_states[idx] = &x;
         }
@@ -95,11 +107,11 @@
         template< class State >
         bool adjust_size_by_resizeability( const State &x , boost::true_type )
         {
- for( size_t i=0 ; i<Dim ; ++i )
+ for( size_t i=0 ; i<dim ; ++i )
                 {
- boost::numeric::odeint::adjust_size( x , *(m_states[i]) );
+ adjust_size_caller::adjust_size( x , *(m_states[i]) );
                 }
- return ( Dim > 0 );
+ return ( dim > 0 );
         }
 
         template< class State >
@@ -112,7 +124,7 @@
 private :
 
         bool m_is_initialized;
- boost::array< Deriv* , Dim > m_states;
+ boost::array< container_type* , dim > m_states;
 };
 
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/stiff_system.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/stiff_system.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/stiff_system.cpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -11,6 +11,7 @@
 */
 
 #include <iostream>
+#include <utility>
 
 #include <boost/numeric/odeint.hpp>
 #include <boost/numeric/odeint/stepper/implicit_euler.hpp>
@@ -51,15 +52,19 @@
         x1( 0 ) = 1.0; x1( 1 ) = 0.0;
         state_type x2( x1 );
 
- const double dt = 0.01; // for dt >= 0.01 the euler method gets unstable
+ const value_type dt = 0.01; // for dt >= 0.01 the euler method gets unstable
         const size_t steps = 1000;
 
- for( size_t step = 0 ; step < steps ; ++step )
+ value_type t = 0.0;
+ for( size_t step = 0 ; step < steps ; ++step , t+=dt )
         {
- clog << step << " of " << 100 << endl;
- cout << step*dt << tab << x1( 0 ) << tab << x1( 1 ) << tab << x2( 0 ) << tab << x2( 1 ) << endl;
- expl_euler.do_step( stiff_system , x1 , step*dt , dt );
- impl_euler.do_step( stiff_system , jacobi , x2 , step*dt , dt );
+ clog << step << " of " << steps << endl;
+ cout << t << tab << x1( 0 ) << tab << x1( 1 ) << tab << x2( 0 ) << tab << x2( 1 ) << tab;
+ cout << 1.0 / 99.0 * exp( -100.0 * t ) * ( 100.0 - exp( 99.0 * t ) ) << tab;
+ cout << 1.0 / 99.0 * exp( -100.0 * t ) * ( -1.0 + exp( 99.0 * t ) ) << endl;
+
+ expl_euler.do_step( stiff_system , x1 , t , dt );
+ impl_euler.do_step( make_pair( stiff_system , jacobi ) , x2 , t , dt );
         }
- cout << steps*dt << tab << x1( 0 ) << tab << x1( 1 ) << tab << x2( 0 ) << tab << x2( 1 ) << endl;
+
 }

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/algebra_dispatcher.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/algebra_dispatcher.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/algebra_dispatcher.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -27,7 +27,7 @@
         typedef Container container_type;
         typedef Time time_type;
 
- typedef standard_algebra< container_type > type;
+ typedef range_algebra< container_type > type;
 };
 
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/butcher/algebra.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/butcher/algebra.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/butcher/algebra.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -28,8 +28,8 @@
 template< class state_type , class coef_type >
 struct algebra< state_type , coef_type , mpl::int_< 0 > >
 {
- typedef boost::numeric::odeint::standard_algebra std_algebra;
- typedef boost::numeric::odeint::standard_operations< double > std_op;
+ typedef boost::numeric::odeint::range_algebra std_algebra;
+ typedef boost::numeric::odeint::default_operations< double > std_op;
 
         typedef typename state_type::iterator iterator;
         typedef typename state_type::const_iterator const_iterator;
@@ -58,8 +58,8 @@
 template< class state_type , class coef_type >
 struct algebra< state_type , coef_type , mpl::int_< 1 > >
 {
- typedef boost::numeric::odeint::standard_algebra std_algebra;
- typedef boost::numeric::odeint::standard_operations< double > std_op;
+ typedef boost::numeric::odeint::range_algebra std_algebra;
+ typedef boost::numeric::odeint::default_operations< double > std_op;
 
         typedef typename state_type::iterator iterator;
         typedef typename state_type::const_iterator const_iterator;
@@ -89,8 +89,8 @@
 template< class state_type , class coef_type >
 struct algebra< state_type , coef_type , mpl::int_< 2 > >
 {
- typedef boost::numeric::odeint::standard_algebra std_algebra;
- typedef boost::numeric::odeint::standard_operations< double > std_op;
+ typedef boost::numeric::odeint::range_algebra std_algebra;
+ typedef boost::numeric::odeint::default_operations< double > std_op;
 
         typedef typename state_type::iterator iterator;
         typedef typename state_type::const_iterator const_iterator;
@@ -122,8 +122,8 @@
 template< class state_type , class coef_type >
 struct algebra< state_type , coef_type , mpl::int_< 3 > >
 {
- typedef boost::numeric::odeint::standard_algebra std_algebra;
- typedef boost::numeric::odeint::standard_operations< double > std_op;
+ typedef boost::numeric::odeint::range_algebra std_algebra;
+ typedef boost::numeric::odeint::default_operations< double > std_op;
 
         typedef typename state_type::iterator iterator;
         typedef typename state_type::const_iterator const_iterator;
@@ -158,8 +158,8 @@
 template< class state_type , class coef_type >
 struct algebra< state_type , coef_type , mpl::int_< 4 > >
 {
- typedef boost::numeric::odeint::standard_algebra std_algebra;
- typedef boost::numeric::odeint::standard_operations< double > std_op;
+ typedef boost::numeric::odeint::range_algebra std_algebra;
+ typedef boost::numeric::odeint::default_operations< double > std_op;
 
         typedef typename state_type::iterator iterator;
         typedef typename state_type::const_iterator const_iterator;

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/generic_stepper/fusion_algebra.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/generic_stepper/fusion_algebra.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/generic_stepper/fusion_algebra.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -19,8 +19,8 @@
 struct fusion_algebra
 {
 
- typedef boost::numeric::odeint::standard_algebra std_algebra;
- typedef boost::numeric::odeint::standard_operations< double > std_op;
+ typedef boost::numeric::odeint::range_algebra std_algebra;
+ typedef boost::numeric::odeint::default_operations< double > std_op;
 
         template< class state_type >
         inline static void foreach( state_type &x_tmp , const state_type &x , const boost::array< double , n > &a ,
@@ -33,8 +33,8 @@
 struct fusion_algebra< 1 >
 {
 
- typedef boost::numeric::odeint::standard_algebra std_algebra;
- typedef boost::numeric::odeint::standard_operations< double > std_op;
+ typedef boost::numeric::odeint::range_algebra std_algebra;
+ typedef boost::numeric::odeint::default_operations< double > std_op;
 
         template< class state_type >
         inline static void foreach( state_type &x_tmp , const state_type &x , const boost::array< double , 1 > &a ,
@@ -50,8 +50,8 @@
 struct fusion_algebra< 2 >
 {
 
- typedef boost::numeric::odeint::standard_algebra std_algebra;
- typedef boost::numeric::odeint::standard_operations< double > std_op;
+ typedef boost::numeric::odeint::range_algebra std_algebra;
+ typedef boost::numeric::odeint::default_operations< double > std_op;
 
         template< class state_type >
         inline static void foreach( state_type &x_tmp , const state_type &x , const boost::array< double , 2 > &a ,
@@ -68,8 +68,8 @@
 struct fusion_algebra< 3 >
 {
 
- typedef boost::numeric::odeint::standard_algebra std_algebra;
- typedef boost::numeric::odeint::standard_operations< double > std_op;
+ typedef boost::numeric::odeint::range_algebra std_algebra;
+ typedef boost::numeric::odeint::default_operations< double > std_op;
 
     template< class state_type >
     inline static void foreach( state_type &x_tmp , const state_type &x , const boost::array< double , 3 > &a ,
@@ -87,8 +87,8 @@
 struct fusion_algebra< 4 >
 {
 
- typedef boost::numeric::odeint::standard_algebra std_algebra;
- typedef boost::numeric::odeint::standard_operations< double > std_op;
+ typedef boost::numeric::odeint::range_algebra std_algebra;
+ typedef boost::numeric::odeint::default_operations< double > std_op;
 
     template< class state_type >
     inline static void foreach( state_type &x_tmp , const state_type &x , const boost::array< double , 4 > &a ,

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/operations_dispatcher.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/operations_dispatcher.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/operations_dispatcher.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -23,7 +23,7 @@
 template< class Container , class Time >
 struct operations_dispatcher
 {
- typedef standard_operations< Time > type;
+ typedef default_operations< Time > type;
 };
 
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/adjust_size_units.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/adjust_size_units.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/adjust_size_units.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -18,7 +18,7 @@
 #include <boost/noncopyable.hpp>
 #include <boost/array.hpp>
 
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+#include <boost/numeric/odeint/algebra/default_resize.hpp>
 
 
 namespace boost {

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-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -13,7 +13,7 @@
 #ifndef BOOST_BOOST_NUMERIC_ODEINT_EXPLICIT_EULER_UNITS_HPP_INCLUDED
 #define BOOST_BOOST_NUMERIC_ODEINT_EXPLICIT_EULER_UNITS_HPP_INCLUDED
 
-#include <boost/numeric/odeint/algebra/standard_algebra.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
 
 #include "explicit_stepper_base_units.hpp"
 #include "standard_operations_units.hpp"
@@ -26,7 +26,7 @@
     class Deriv ,
     class Value = double ,
     class Time = double ,
- class Algebra = standard_algebra ,
+ class Algebra = range_algebra ,
         class Operations = standard_operations_units ,
         class AdjustSizePolicy = adjust_size_initially_tag
>

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/explicit_stepper_base_units.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/explicit_stepper_base_units.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/units/explicit_stepper_base_units.hpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -16,7 +16,7 @@
 #include <boost/noncopyable.hpp>
 #include <boost/ref.hpp>
 
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+#include <boost/numeric/odeint/algebra/default_resize.hpp>
 
 #include "adjust_size_units.hpp"
 

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-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -20,8 +20,8 @@
         :
          [ run stepper_concepts.cpp ]
          [ run resizing.cpp ]
- [ run standard_operations.cpp ]
- [ run standard_algebra.cpp ]
+ [ run default_operations.cpp ]
+ [ run range_algebra.cpp ]
          [ run implicit_euler.cpp ]
          [ run fusion_algebra.cpp ]
          [ run stepper_with_units.cpp ]

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/default_operations.cpp (from r68362, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_operations.cpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_operations.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/default_operations.cpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -21,12 +21,12 @@
 
 #include <boost/mpl/list.hpp>
 
-#include <boost/numeric/odeint/algebra/standard_operations.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
 
 namespace units = boost::units;
 namespace si = boost::units::si;
 namespace mpl = boost::mpl;
-using boost::numeric::odeint::standard_operations;
+using boost::numeric::odeint::default_operations;
 
 
 template< class Value > struct internal_value_type { typedef Value type; };
@@ -133,7 +133,7 @@
 {
         typedef double_fixture< T > fix_type;
         fix_type f;
- typedef typename standard_operations::scale_sum2< T , T > Op;
+ typedef typename default_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 );
@@ -143,7 +143,7 @@
 {
         typedef double_fixture< T > fix_type;
         fix_type f;
- typedef standard_operations::scale_sum3< T , T , T > Op;
+ typedef default_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 );
@@ -153,7 +153,7 @@
 {
         typedef double_fixture< T > fix_type;
         fix_type f;
- typedef standard_operations::scale_sum4< T , T , T , T > Op;
+ typedef default_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 );
@@ -163,7 +163,7 @@
 {
         typedef double_fixture< T > fix_type;
         fix_type f;
- typedef standard_operations::scale_sum5< T , T , T , T , T > Op;
+ typedef default_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 );
@@ -173,7 +173,7 @@
 {
         typedef double_fixture< T > fix_type;
         fix_type f;
- typedef standard_operations::scale_sum6< T , T , T , T , T , T > Op;
+ typedef default_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 );
@@ -183,7 +183,7 @@
 {
         typedef double_fixture< T > fix_type;
         fix_type f;
- typedef standard_operations::scale_sum7< T , T , T , T , T , T , T > Op;
+ typedef default_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 );
@@ -194,7 +194,7 @@
         typedef double_fixture< T > fix_type;
         fix_type f;
         f.res = -1.1;
- typedef standard_operations::rel_error< T > Op;
+ typedef default_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 ) );
@@ -204,7 +204,7 @@
 {
         typedef double_fixture< T > fix_type;
         fix_type f;
- typedef standard_operations::maximum< typename fix_type::compare_type > Op;
+ typedef default_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 );
@@ -227,7 +227,7 @@
         typedef typename fix_type::time_7_type time_7_type;
 
         fix_type f;
- typedef standard_operations::scale_sum2< value_type , time_type > Op;
+ typedef default_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 );
@@ -246,7 +246,7 @@
         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;
+ typedef default_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 );

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/fusion_algebra.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/fusion_algebra.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/fusion_algebra.cpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -25,14 +25,14 @@
 
 #include <boost/fusion/container.hpp>
 
-#include <boost/numeric/odeint/algebra/standard_operations.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
 #include <boost/numeric/odeint/algebra/fusion_algebra.hpp>
 
 namespace units = boost::units;
 namespace si = boost::units::si;
 namespace fusion = boost::fusion;
 
-using boost::numeric::odeint::standard_operations;
+using boost::numeric::odeint::default_operations;
 using boost::numeric::odeint::fusion_algebra;
 
 typedef double value_type;
@@ -88,7 +88,7 @@
 {
         fusion_fixture f;
         fusion_algebra::for_each2()( f.res , f.k1 ,
- standard_operations::scale_sum1< time_type >( dt ) );
+ default_operations::scale_sum1< time_type >( dt ) );
         BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 0.1 , 1.0e-10 );
         BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 0.1 , 1.0e-10 );
 }
@@ -97,7 +97,7 @@
 {
         fusion_fixture f;
         fusion_algebra::for_each3()( f.res , f.x , f.k1 ,
- standard_operations::scale_sum2< value_type , time_type >( 1.0 , dt ) );
+ default_operations::scale_sum2< value_type , time_type >( 1.0 , dt ) );
         BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 1.1 , 1.0e-10 );
         BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 1.1 , 1.0e-10 );
 }
@@ -106,7 +106,7 @@
 {
         fusion_fixture f;
         fusion_algebra::for_each4()( f.res , f.x , f.k1 , f.k2 ,
- standard_operations::scale_sum3< value_type , time_type , time_type >( 1.0 , dt , dt ) );
+ default_operations::scale_sum3< value_type , time_type , time_type >( 1.0 , dt , dt ) );
         BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 1.3 , 1.0e-10 );
         BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 1.3 , 1.0e-10 );
 }
@@ -115,7 +115,7 @@
 {
         fusion_fixture f;
         fusion_algebra::for_each5()( f.res , f.x , f.k1 , f.k2 , f.k3 ,
- standard_operations::scale_sum4< value_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt ) );
+ default_operations::scale_sum4< value_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt ) );
         BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 1.6 , 1.0e-10 );
         BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 1.6 , 1.0e-10 );
 }
@@ -124,7 +124,7 @@
 {
         fusion_fixture f;
         fusion_algebra::for_each6()( f.res , f.x , f.k1 , f.k2 , f.k3 , f.k4 ,
- standard_operations::scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt , dt ) );
+ default_operations::scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt , dt ) );
         BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 2.0 , 1.0e-10 );
         BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 2.0 , 1.0e-10 );
 }
@@ -133,7 +133,7 @@
 {
         fusion_fixture f;
         fusion_algebra::for_each7()( f.res , f.x , f.k1 , f.k2 , f.k3 , f.k4 , f.k5 ,
- standard_operations::scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt , dt , dt ) );
+ default_operations::scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt , dt , dt ) );
         BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 2.5 , 1.0e-10 );
         BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 2.5 , 1.0e-10 );
 }
@@ -142,7 +142,7 @@
 {
         fusion_fixture f;
         fusion_algebra::for_each8()( f.res , f.x , f.k1 , f.k2 , f.k3 , f.k4 , f.k5 , f.k6 ,
- standard_operations::scale_sum7< value_type , time_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt , dt , dt ,dt ) );
+ default_operations::scale_sum7< value_type , time_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt , dt , dt ,dt ) );
         BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 3.1 , 1.0e-10 );
         BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 3.1 , 1.0e-10 );
 }

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/implicit_euler.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/implicit_euler.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/implicit_euler.cpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -12,6 +12,8 @@
 
 #define BOOST_TEST_MODULE odeint_implicit_euler
 
+#include <utility>
+
 #include <boost/test/unit_test.hpp>
 
 #include <boost/numeric/odeint.hpp>
@@ -53,7 +55,7 @@
 
     value_type eps = 1E-12;
 
- stepper.do_step( sys , jacobi , x , 0.0 , 0.1 );
+ stepper.do_step( std::make_pair( sys , jacobi ) , x , 0.0 , 0.1 );
 
     using std::abs;
 

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/range_algebra.cpp (from r68371, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_algebra.cpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_algebra.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/range_algebra.cpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -23,14 +23,14 @@
 #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>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
 
 namespace units = boost::units;
 namespace si = boost::units::si;
 
-using boost::numeric::odeint::standard_operations;
-using boost::numeric::odeint::standard_algebra;
+using boost::numeric::odeint::default_operations;
+using boost::numeric::odeint::range_algebra;
 
 
 
@@ -39,7 +39,7 @@
 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 ) );
+ range_algebra::for_each2()( x1 , x2 , default_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 );
 }
@@ -47,7 +47,7 @@
 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 ) );
+ range_algebra::for_each3()( x1 , x2 , x3 , default_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 );
 }
@@ -55,7 +55,7 @@
 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 ) );
+ range_algebra::for_each4()( x1 , x2 , x3 , x4 , default_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 );
 }
@@ -63,7 +63,7 @@
 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 ) );
+ range_algebra::for_each5()( x1 , x2 , x3 , x4 , x5 , default_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 );
 }
@@ -71,7 +71,7 @@
 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 ) );
+ range_algebra::for_each6()( x1 , x2 , x3 , x4 , x5 , x6 ,default_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 );
 }
@@ -79,7 +79,7 @@
 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 ) );
+ range_algebra::for_each7()( x1 , x2 , x3 , x4 , x5 , x6 , x7 , default_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 );
 }
@@ -87,7 +87,7 @@
 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 ) );
+ range_algebra::for_each8()( x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , default_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 );
 }
@@ -95,7 +95,7 @@
 BOOST_AUTO_TEST_CASE( reduce )
 {
         std::tr1::array< double , 2 > x = {{ 1.25 , 2.25 }};
- double sum = standard_algebra::reduce()( x , std::plus< double >() , 0.0 );
+ double sum = range_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 );
@@ -106,11 +106,11 @@
 {
         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 ) );
+ range_algebra::for_each2()( x1 , std::make_pair( x2.begin() + 1 , x2.begin() + 3 ) , default_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 ) );
+ range_algebra::for_each2()( std::make_pair( x2.begin() , x2.begin() + 2 ) , std::make_pair( x2.begin() + 2 ,x2.begin() + 4 ) , default_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 );
@@ -124,7 +124,7 @@
         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 ) );
+ range_algebra::for_each2()( x1 , x2 , default_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 );
 }

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -63,13 +63,13 @@
 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 explicit_euler< test_array_type , double , test_array_type , double , range_algebra , default_operations , adjust_size_manually_tag > euler_manual_type;
+typedef explicit_euler< test_array_type , double , test_array_type , double , range_algebra , default_operations , adjust_size_initially_tag > euler_initially_type;
+typedef explicit_euler< test_array_type , double , test_array_type , double , range_algebra , default_operations , adjust_size_always_tag > euler_always_type;
+
+typedef explicit_rk4< test_array_type , double , test_array_type , double , range_algebra , default_operations , adjust_size_manually_tag > rk4_manual_type;
+typedef explicit_rk4< test_array_type , double , test_array_type , double , range_algebra , default_operations , adjust_size_initially_tag > rk4_initially_type;
+typedef explicit_rk4< test_array_type , double , test_array_type , double , range_algebra , default_operations , adjust_size_always_tag > rk4_always_type;
 
 
 typedef mpl::vector<

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_algebra.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_algebra.cpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
+++ (empty file)
@@ -1,133 +0,0 @@
-/*
- * check_operations.cpp
- *
- * Created on: Jan 20, 2011
- * Author: karsten
- */
-
-#define BOOST_TEST_MODULE odeint_standard_algebra
-
-#include <cmath>
-#include <complex>
-#include <utility>
-#include <functional>
-#include <tr1/array>
-
-#include <boost/test/unit_test.hpp>
-#include <boost/test/floating_point_comparison.hpp>
-
-#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;
-
-
-
-BOOST_AUTO_TEST_SUITE( standard_algebra_test )
-
-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 ) );
- BOOST_CHECK_CLOSE( x1[0] , 2.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 2.0 , 1.0e-10 );
-}
-
-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 ) );
- BOOST_CHECK_CLOSE( x1[0] , 8.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 8.0 , 1.0e-10 );
-}
-
-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 ) );
- BOOST_CHECK_CLOSE( x1[0] , 20.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 20.0 , 1.0e-10 );
-}
-
-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 ) );
- BOOST_CHECK_CLOSE( x1[0] , 40.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 40.0 , 1.0e-10 );
-}
-
-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 ) );
- BOOST_CHECK_CLOSE( x1[0] , 70.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 70.0 , 1.0e-10 );
-}
-
-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 ) );
- BOOST_CHECK_CLOSE( x1[0] , 112.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 112.0 , 1.0e-10 );
-}
-
-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 ) );
- BOOST_CHECK_CLOSE( x1[0] , 168.0 , 1.0e-10 );
- BOOST_CHECK_CLOSE( x1[1] , 168.0 , 1.0e-10 );
-}
-
-BOOST_AUTO_TEST_CASE( reduce )
-{
- 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()

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_operations.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/standard_operations.cpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
+++ (empty file)
@@ -1,258 +0,0 @@
-/*
- * check_operations.cpp
- *
- * Created on: Jan 20, 2011
- * Author: karsten
- */
-
-#define BOOST_TEST_MODULE odeint_standard_operations
-
-#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()

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -59,7 +59,7 @@
 typedef mpl::vector< vector_type , vector_space_type , array_type >::type container_types;
 
 
-template< class State > struct algebra_dispatcher { typedef standard_algebra type; };
+template< class State > struct algebra_dispatcher { typedef range_algebra type; };
 template<> struct algebra_dispatcher< vector_space_type > { typedef vector_space_algebra type; };
 template<> struct algebra_dispatcher< double > { typedef vector_space_algebra type; };
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_with_units.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_with_units.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_with_units.cpp 2011-01-26 07:45:50 EST (Wed, 26 Jan 2011)
@@ -28,6 +28,7 @@
 #include <boost/mpl/vector.hpp>
 
 #include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/algebra/fusion_algebra.hpp>
 
 
 using namespace boost::numeric::odeint;


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