Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68586 - in sandbox/odeint/branches/karsten: boost/numeric/odeint/integrate boost/numeric/odeint/integrate/detail boost/numeric/odeint/stepper boost/numeric/odeint/stepper/base libs/numeric/odeint/regression_test
From: karsten.ahnert_at_[hidden]
Date: 2011-01-31 12:49:57


Author: karsten
Date: 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
New Revision: 68586
URL: http://svn.boost.org/trac/boost/changeset/68586

Log:
* expanding stepper categories
* skeleton for integrate functions
Added:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp (contents, props changed)
   sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/do_nothing_observer.hpp (contents, props changed)
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/integrate_functions.cpp (contents, props changed)
Text files modified:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp | 45 +++++++++++++++++++++++++++++++------
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp | 2 +
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp | 2 +
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_fsal_base.hpp | 2 +
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp | 3 ++
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp | 1
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_controlled_explicit_fsal.hpp | 3 +
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_explicit.hpp | 5 ++++
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp | 1
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp | 2 -
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/implicit_euler.hpp | 47 ++++++++++++++++++++++++++++++++++-----
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4.hpp | 5 ++-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp | 3 ++
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/stepper_categories.hpp | 6 +---
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/Jamfile | 4 +++
   15 files changed, 107 insertions(+), 24 deletions(-)

Added: sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -0,0 +1,49 @@
+/*
+ * integrate_adaptive.hpp
+ *
+ * Created on: Jan 31, 2011
+ * Author: karsten
+ */
+
+#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer , stepper_tag )
+{
+ return 0;
+}
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer , error_stepper_tag )
+{
+ return 0;
+}
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer , controlled_stepper_tag )
+{
+ return 0;
+}
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer , dense_output_stepper_tag )
+{
+ return 0;
+}
+
+
+
+
+} // namespace detail
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif /* BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_ */

Added: sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/do_nothing_observer.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/do_nothing_observer.hpp 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -0,0 +1,29 @@
+/*
+ * do_nothing_observer.hpp
+ *
+ * Created on: Jan 31, 2011
+ * Author: karsten
+ */
+
+#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DO_NOTHING_OBSERVER_HPP_
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_DO_NOTHING_OBSERVER_HPP_
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+struct do_nothing_observer
+{
+ template< class State , class Time >
+ void operator()( const State& x , const Time &t ) const
+ {
+
+ }
+};
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+#endif /* BOOST_NUMERIC_ODEINT_INTEGRATE_DO_NOTHING_OBSERVER_HPP_ */

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -11,7 +11,9 @@
 #include <boost/type_traits/is_same.hpp>
 
 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/integrate/do_nothing_observer.hpp>
 #include <boost/numeric/odeint/integrate/detail/integrate_const.hpp>
+#include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp>
 
 namespace boost {
 namespace numeric {
@@ -24,29 +26,56 @@
 
 size_t integrate( stepper , system , start_state , start_time , end_time , dt , observer );
 
-Time integrate_n_steps( stepper , system , start_state , start_time , num_of_steps , observer );
+Time integrate_n_steps( stepper , system , start_state , start_time , dt , num_of_steps , observer );
 
-void integrate_adaptive( stepper , system , start_state , start_time , end_time , start_dt , observer );
-void integrate_adaptive( stepper , system , start_state , start_time , end_time , start_dt , state_back_insert_sequence , time_back_insert_sequence );
+size_t integrate_adaptive( stepper , system , start_state , start_time , end_time , start_dt , observer );
 
 */
 
 
 
-template< class Stepper , class system , class State , class Time , class Observer = empty_observer >
-size_t integrate( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer = Observer() )
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , const Time &dt , Observer observer )
 {
         // we want to get as fast as possible to the end
- if( typename boost:is_same< empty_observer , Observer >::value )
+ if( boost::is_same< do_nothing_observer , Observer >::value )
         {
- return detail::integrate_adpative( stepper , system , start_state , start_time , end_time , dt , Observer , typename Stepper::stepper_type() );
+ return detail::integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , observer , typename Stepper::stepper_category() );
         }
         else
         {
- return detail::integrate_const( stepper , system , start_state , start_time , end_time , dt , Observer , typename Stepper::stepper_type() );
+ return detail::integrate_const( stepper , system , start_state , start_time , end_time , dt , observer , typename Stepper::stepper_category() );
         }
+ return 0;
 }
 
+template< class Stepper , class System , class State , class Time , class Observer >
+Time integrate_n_steps( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &dt , size_t num_of_steps , Observer observer )
+{
+ Time end_time = dt * num_of_steps;
+
+ // we want to get as fast as possible to the end
+ if( boost::is_same< do_nothing_observer , Observer >::type::value )
+ {
+ detail::integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , observer , typename Stepper::stepper_category() );
+ }
+ else
+ {
+ detail::integrate_const( stepper , system , start_state , start_time , end_time , dt , observer , typename Stepper::stepper_category() );
+ }
+ return end_time;
+}
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive( Stepper stepper , System system , State &start_state , const Time &start_time , const Time &end_time , Time &dt , Observer observer )
+{
+ return detail::integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , observer , typename Stepper::stepper_category() );
+ return 0;
+}
+
+
+
+
 
 
 

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-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -20,6 +20,7 @@
 #include <boost/numeric/odeint/util/destruct.hpp>
 #include <boost/numeric/odeint/util/copy.hpp>
 
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
 
 namespace boost {
 namespace numeric {
@@ -54,6 +55,7 @@
         typedef Operations operations_type;
         typedef AdjustSizePolicy adjust_size_policy;
         typedef ErrorStepper stepper_type;
+ typedef explicit_error_stepper_tag stepper_category;
 
         typedef unsigned short order_type;
         static const order_type stepper_order_value = StepperOrder;

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-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -20,6 +20,7 @@
 #include <boost/numeric/odeint/util/destruct.hpp>
 #include <boost/numeric/odeint/util/copy.hpp>
 
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
 
 namespace boost {
 namespace numeric {
@@ -55,6 +56,7 @@
         typedef Operations operations_type;
         typedef AdjustSizePolicy adjust_size_policy;
         typedef Stepper stepper_type;
+ typedef explicit_error_stepper_tag stepper_category;
 
         typedef unsigned short order_type;
         static const order_type order_value = Order;

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-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -20,6 +20,7 @@
 #include <boost/numeric/odeint/util/destruct.hpp>
 #include <boost/numeric/odeint/util/copy.hpp>
 
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
 
 namespace boost {
 namespace numeric {
@@ -54,6 +55,7 @@
         typedef Operations operations_type;
         typedef AdjustSizePolicy adjust_size_policy;
         typedef Stepper stepper_type;
+ typedef explicit_error_stepper_fsal_tag stepper_category;
 
         typedef unsigned short order_type;
         static const order_type order_value = Order;

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-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -20,6 +20,8 @@
 #include <boost/numeric/odeint/util/destruct.hpp>
 #include <boost/numeric/odeint/util/copy.hpp>
 
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
 
 namespace boost {
 namespace numeric {
@@ -53,6 +55,7 @@
         typedef Operations operations_type;
         typedef AdjustSizePolicy adjust_size_policy;
         typedef Stepper stepper_type;
+ typedef stepper_tag stepper_category;
 
         typedef explicit_stepper_base< Stepper , Order , State , Value , Deriv , Time , Algebra , Operations , AdjustSizePolicy > internal_stepper_base_type;
 

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-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -139,6 +139,7 @@
         typedef typename stepper_type::order_type order_type;
         typedef AdjustSizePolicy adjust_size_policy;
         typedef ErrorChecker error_checker_type;
+ typedef controlled_stepper_tag stepper_category;
 
 
 

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_controlled_explicit_fsal.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_controlled_explicit_fsal.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_controlled_explicit_fsal.hpp 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -17,6 +17,7 @@
 #include <boost/numeric/odeint/util/copy.hpp>
 
 #include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
 
 namespace boost {
 namespace numeric {
@@ -91,7 +92,7 @@
         typedef typename stepper_type::algebra_type algebra_type;
         typedef typename stepper_type::operations_type operations_type;
         typedef typename stepper_type::adjust_size_policy adjust_size_policy;
-
+ typedef dense_output_stepper_tag stepper_category;
 
         dense_output_controlled_explicit_fsal( const controlled_stepper_type &stepper = controlled_stepper_type() )
         : m_stepper( stepper ) ,

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_explicit.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_explicit.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_explicit.hpp 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -15,6 +15,8 @@
 #include <boost/numeric/odeint/util/destruct.hpp>
 #include <boost/numeric/odeint/util/copy.hpp>
 
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
 namespace boost {
 namespace numeric {
 namespace odeint {
@@ -69,6 +71,9 @@
         typedef typename stepper_type::algebra_type algebra_type;
         typedef typename stepper_type::operations_type operations_type;
         typedef typename stepper_type::adjust_size_policy adjust_size_policy;
+ typedef dense_output_stepper_tag stepper_category;
+
+
 
         dense_output_explicit( const stepper_type &stepper = stepper_type() )
         : m_stepper( stepper ) , m_size_adjuster() ,

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-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -74,7 +74,6 @@
 
         BOOST_ODEINT_EXPLICIT_STEPPERS_AND_ERROR_STEPPERS_FSAL_TYPEDEFS( explicit_error_dopri5 , 5 , 5 , 4 );
 
- typedef explicit_error_stepper_fsal_tag stepper_category;
 
         explicit_error_dopri5( void )
         : stepper_base_type() , m_state_adjuster() , m_deriv_adjuster() , m_x_tmp() , m_k2() , m_k3() , m_k4() , m_k5() , m_k6()

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-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -77,8 +77,6 @@
 
         BOOST_ODEINT_EXPLICIT_STEPPERS_AND_ERROR_STEPPERS_TYPEDEFS( explicit_error_rk54_ck , 5 , 5 , 4);
 
- typedef explicit_error_stepper_tag stepper_category;
-
         explicit_error_rk54_ck( void )
         : stepper_base_type() , m_state_adjuster() , m_deriv_adjuster() , m_x_tmp() , m_k2() , m_k3() , m_k4() , m_k5() , m_k6()
         {

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-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -14,6 +14,10 @@
 
 #include <utility>
 
+#include <boost/ref.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
 #include <boost/numeric/odeint/util/size_adjuster.hpp>
 #include <boost/numeric/odeint/util/matrix_vector_adjust_size.hpp>
 #include <boost/numeric/odeint/util/ublas_resize.hpp>
@@ -37,6 +41,25 @@
 template< class ValueType , class AdjustSizePolicy = adjust_size_initially_tag >
 class implicit_euler
 {
+ void initialize( void )
+ {
+ 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 );
+
+ }
+
+ void copy( const implicit_euler &euler )
+ {
+ m_dxdt = euler.m_dxdt;
+ m_x = euler.m_x;
+ m_b = euler.m_b;
+ m_jacobi = euler.m_jacobi;
+ m_pm = euler.m_pm;
+ m_epsilon = euler.m_epsilon;
+ }
 
 public:
 
@@ -47,6 +70,7 @@
     typedef boost::numeric::ublas::matrix< value_type > matrix_type;
     typedef boost::numeric::ublas::permutation_matrix< size_t > pmatrix_type;
     typedef AdjustSizePolicy adjust_size_policy;
+ typedef stepper_tag stepper_category;
 
     implicit_euler( const value_type epsilon = 1E-6 )
     : m_epsilon( epsilon ) ,
@@ -54,11 +78,22 @@
       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 );
+ initialize();
+ }
+
+ implicit_euler( const implicit_euler &euler )
+ : m_epsilon( 1.0e-6 ) ,
+ m_state_adjuster() , m_matrix_adjuster() , m_pmatrix_adjuster() ,
+ m_dxdt() , m_x() , m_b() ,
+ m_jacobi() , m_pm( 1 )
+ {
+ initialize();
+ copy( euler );
+ }
+
+ implicit_euler& operator=( const implicit_euler &euler )
+ {
+ copy( euler );
     }
 
     template< class System >
@@ -133,7 +168,7 @@
 
 private:
 
- const value_type m_epsilon;
+ value_type m_epsilon;
     size_adjuster< state_type , 3 > m_state_adjuster;
     size_adjuster< matrix_type , 1 , matrix_vector_adjust_size > m_matrix_adjuster;
     size_adjuster< pmatrix_type , 1 > m_pmatrix_adjuster;

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4.hpp 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -15,7 +15,8 @@
 #include <boost/numeric/ublas/matrix.hpp>
 #include <boost/numeric/ublas/lu.hpp>
 
-#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
 #include <boost/numeric/odeint/util/size_adjuster.hpp>
 #include <boost/numeric/odeint/util/matrix_vector_adjust_size.hpp>
 #include <boost/numeric/odeint/util/ublas_resize.hpp>
@@ -123,7 +124,7 @@
     typedef boost::numeric::ublas::permutation_matrix< size_t > pmatrix_type;
     typedef AdjustSizePolicy adjust_size_policy;
     typedef Coefficients rosenbrock_coefficients;
-
+ typedef stepper_tag stepper_category;
 
         rosenbrock4( void )
         : m_state_adjuster() , m_matrix_adjuster() , m_pmatrix_adjuster() ,

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -9,6 +9,8 @@
 #define BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_CONTROLLER_HPP_
 
 #include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
 #include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
 
 
@@ -26,6 +28,7 @@
         typedef typename stepper_type::state_type state_type;
         typedef typename stepper_type::time_type time_type;
         typedef typename stepper_type::deriv_type deriv_type;
+ typedef controlled_stepper_tag stepper_category;
 
 
         rosenbrock4_controller( value_type atol = 1.0e-6 , value_type rtol = 1.0e-6 , const stepper_type &stepper = stepper_type() )

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/stepper_categories.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/stepper_categories.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/stepper_categories.hpp 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -28,12 +28,10 @@
 //struct implicit_stepper_tag : stepper_tag {};
 
 struct error_stepper_tag {};
-//struct explicit_error_stepper_tag : error_stepper_tag {};
-//struct explicit_error_stepper_fsal_tag : error_stepper_tag {};
+struct explicit_error_stepper_tag : error_stepper_tag {};
+struct explicit_error_stepper_fsal_tag : error_stepper_tag {};
 
 struct controlled_stepper_tag {};
-//struct controlled_explicit_stepper_tag : controlled_stepper_tag {};
-//struct controlled_implicit_stepper_tag : controlled_stepper_tag {};
 
 struct dense_output_stepper_tag {};
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/Jamfile
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/Jamfile (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/Jamfile 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -27,4 +27,8 @@
         
 exe rosenbrock4
         : rosenbrock4.cpp
+ ;
+
+exe integrate_functions
+ : integrate_functions.cpp
         ;
\ No newline at end of file

Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/integrate_functions.cpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/integrate_functions.cpp 2011-01-31 12:49:52 EST (Mon, 31 Jan 2011)
@@ -0,0 +1,94 @@
+/*
+ * integrate_functions.cpp
+ *
+ * Created on: Jan 31, 2011
+ * Author: karsten
+ */
+
+#include <tr1/array>
+
+#include <boost/numeric/odeint/stepper/implicit_euler.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
+
+#include <boost/numeric/odeint/stepper/explicit_euler.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp>
+#include <boost/numeric/odeint/stepper/controlled_error_stepper.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_explicit.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_controlled_explicit_fsal.hpp>
+
+#include <boost/numeric/odeint/integrate/integrate.hpp>
+
+
+
+const double sigma = 10.0;
+const double R = 28.0;
+const double b = 8.0 / 3.0;
+
+struct lorenz
+{
+ template< class StateType >
+ void operator()( const StateType &x , StateType &dxdt , const double &t )
+ {
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = x[0] * x[1] - b * x[2];
+ }
+};
+
+struct lorenz_jacobi
+{
+ template< class State , class Matrix >
+ void operator()( const State &x , Matrix &J , const double &t , State &dfdt )
+ {
+ J( 0 , 0 ) = -sigma;
+ J( 0 , 1 ) = sigma;
+ J( 0 , 2 ) = 0.0;
+ J( 1 , 0 ) = R - x[2];
+ J( 1 , 1 ) = -1.0;
+ J( 1 , 2 ) = -x[0];
+ J( 2 , 0 ) = x[1];
+ J( 2 , 1 ) = x[0];
+ J( 2 , 2 ) = -b;
+
+ dfdt[0] = 0.0;
+ dfdt[1] = 0.0;
+ dfdt[2] = 0.0;
+ }
+};
+
+typedef boost::numeric::ublas::vector< double > vector_type;
+typedef std::tr1::array< double , 3 > state_type;
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+int main( int argc , char **argv )
+{
+ state_type x1;
+ vector_type x2( 3 );
+
+ integrate( implicit_euler< double >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 10.0 , 0.1 , do_nothing_observer() );
+// integrate_n_steps( implicit_euler< double >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 1000 , 0.1 );
+// integrate_adaptive( implicit_euler< double >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 10.0 , 0.1 );
+
+// integrate( rosenbrock4< double >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 10.0 , 0.1 );
+// integrate_n_steps( rosenbrock4< double >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 1000 , 0.1 );
+// integrate_adaptive( rosenbrock4< double >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 10.0 , 0.1 );
+//
+// integrate( rosenbrock4_controller< rosenbrock4< double > >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 10.0 , 0.1 );
+// integrate_n_steps( rosenbrock4_controller< rosenbrock4< double > >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 1000 , 0.1 );
+// integrate_adaptive( rosenbrock4_controller< rosenbrock4< double > >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 10.0 , 0.1 );
+
+
+//#include <boost/numeric/odeint/stepper/explicit_euler.hpp>
+//#include <boost/numeric/odeint/stepper/explicit_error_dopri5.hpp>
+//#include <boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp>
+//#include <boost/numeric/odeint/stepper/controlled_error_stepper.hpp>
+//#include <boost/numeric/odeint/stepper/dense_output_explicit.hpp>
+//#include <boost/numeric/odeint/stepper/dense_output_controlled_explicit_fsal.hpp>
+
+
+ return true;
+}


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