Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65666 - in sandbox/odeint/branches/karsten: boost/numeric/odeint/stepper boost/numeric/odeint/stepper/base libs/numeric/odeint/ideas
From: karsten.ahnert_at_[hidden]
Date: 2010-09-29 07:54:35


Author: karsten
Date: 2010-09-29 07:54:31 EDT (Wed, 29 Sep 2010)
New Revision: 65666
URL: http://svn.boost.org/trac/boost/changeset/65666

Log:
Splitting the file explicit_stepper_base.hpp into
* base/explicit_stepper_base.hpp
* base/explicit_error_stepper_base.hpp
* base/explicit_stepper_and_error_stepper_base.hpp
Added:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp (contents, props changed)
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp (contents, props changed)
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp (contents, props changed)
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/dense_output.cpp (contents, props changed)
Removed:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_stepper_base.hpp
Text files modified:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp | 2 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp | 2 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp | 2 +-
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4.hpp | 2 +-
   4 files changed, 4 insertions(+), 4 deletions(-)

Added: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp 2010-09-29 07:54:31 EDT (Wed, 29 Sep 2010)
@@ -0,0 +1,126 @@
+/*
+ boost header: numeric/odeint/explicit_error_stepper_base.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_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED
+
+#include <boost/noncopyable.hpp>
+
+#include <boost/numeric/odeint/stepper/adjust_size.hpp>
+#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/*
+ * base class for explicit error steppers
+ * models the error stepper concept
+ * ToDo : test
+ */
+template<
+ class ErrorStepper ,
+ unsigned short StepperOrder ,
+ unsigned short ErrorOrder ,
+ class State ,
+ class Time ,
+ class Algebra ,
+ class Operations ,
+ class AdjustSizePolicy
+>
+class explicit_error_stepper_base
+{
+public:
+
+
+ typedef State state_type;
+ typedef Time time_type;
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+ typedef AdjustSizePolicy adjust_size_policy;
+ typedef ErrorStepper stepper_type;
+
+ typedef unsigned short order_type;
+ static const order_type stepper_order_value = StepperOrder;
+ static const order_type error_order_value = ErrorOrder;
+
+ order_type stepper_order( void ) const { return stepper_order_value; }
+
+ order_type error_order( void ) const { return error_order_value; }
+
+
+ explicit_error_stepper_base( void ) : m_size_adjuster() , m_dxdt()
+ {
+ boost::numeric::odeint::construct( m_dxdt );
+ m_size_adjuster.register_state( 0 , m_dxdt );
+ }
+
+ ~explicit_error_stepper_base( void )
+ {
+ boost::numeric::odeint::destruct( m_dxdt );
+ }
+
+
+
+ stepper_type& stepper( void ) { return *static_cast< stepper_type* >( this ); }
+ const stepper_type& stepper( void ) const {return *static_cast< const stepper_type* >( this );}
+
+
+
+ template< class System >
+ void do_step( System &system , state_type &x , time_type t , time_type dt , state_type &xerr )
+ {
+ m_size_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
+ system( x , m_dxdt ,t );
+ this->stepper().do_step_impl( system , x , m_dxdt , x , t , dt , xerr );
+ }
+
+ template< class System >
+ void do_step( System &system , state_type &x , const state_type &dxdt , time_type t , time_type dt , state_type &xerr )
+ {
+ this->stepper().do_step_impl( system , x , dxdt , x , t , dt , xerr );
+ }
+
+ template< class System >
+ void do_step( System &system , const state_type &in , state_type &out , time_type t , time_type dt , state_type &xerr )
+ {
+ m_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
+ system( in , m_dxdt ,t );
+ this->stepper().do_step_impl( system , in , m_dxdt , out , t , dt , xerr );
+ }
+
+ template< class System >
+ void do_step( System &system , const state_type &in , const state_type &dxdt , state_type &out , time_type t , time_type dt , state_type &xerr )
+ {
+ this->stepper().do_step_impl( system , in , dxdt , out , t , dt , xerr );
+ }
+
+
+ void adjust_size( const state_type &x )
+ {
+ m_size_adjuster.adjust_size( x );
+ }
+
+
+private:
+
+ size_adjuster< state_type , 1 > m_size_adjuster;
+ state_type m_dxdt;
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+#endif //BOOST_NUMERIC_ODEINT_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED

Added: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp 2010-09-29 07:54:31 EDT (Wed, 29 Sep 2010)
@@ -0,0 +1,156 @@
+/*
+ boost header: numeric/odeint/explicit_stepper_and_error_stepper_base.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_EXPLICIT_STEPPER_AND_ERROR_STEPPER_BASE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXPLICIT_STEPPER_AND_ERROR_STEPPER_BASE_HPP_INCLUDED
+
+#include <boost/noncopyable.hpp>
+
+#include <boost/numeric/odeint/stepper/adjust_size.hpp>
+#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/*
+ * base class for explicit stepper and error steppers
+ * models the stepper AND the error stepper concept
+ */
+template<
+ class Stepper ,
+ unsigned short Order ,
+ unsigned short StepperOrder ,
+ unsigned short ErrorOrder ,
+ class State ,
+ class Time ,
+ class Algebra ,
+ class Operations ,
+ class AdjustSizePolicy
+>
+class explicit_stepper_and_error_stepper_base
+{
+public:
+
+
+ typedef State state_type;
+ typedef Time time_type;
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+ typedef AdjustSizePolicy adjust_size_policy;
+ typedef Stepper stepper_type;
+
+ typedef unsigned short order_type;
+ static const order_type order_value = Order;
+ static const order_type stepper_order_value = StepperOrder;
+ static const order_type error_order_value = ErrorOrder;
+
+ order_type order( void ) const { return order_value; }
+ order_type stepper_order( void ) const { return stepper_order_value; }
+ order_type error_order( void ) const { return error_order_value; }
+
+
+ explicit_stepper_and_error_stepper_base( void ) : m_size_adjuster() , m_dxdt()
+ {
+ boost::numeric::odeint::construct( m_dxdt );
+ m_size_adjuster.register_state( 0 , m_dxdt );
+ }
+
+ ~explicit_stepper_and_error_stepper_base( void )
+ {
+ boost::numeric::odeint::destruct( m_dxdt );
+ }
+
+
+
+ stepper_type& stepper( void ) { return *static_cast< stepper_type* >( this ); }
+ const stepper_type& stepper( void ) const {return *static_cast< const stepper_type* >( this );}
+
+
+ template< class System >
+ void do_step( System &system , state_type &x , time_type t , time_type dt )
+ {
+ m_size_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
+ system( x , m_dxdt ,t );
+ this->stepper().do_step_impl( system , x , m_dxdt , x , t , dt );
+ }
+
+ template< class System >
+ void do_step( System &system , state_type &x , const state_type &dxdt , time_type t , time_type dt )
+ {
+ this->stepper().do_step_impl( system , x , dxdt , x , t , dt );
+ }
+
+ template< class System >
+ void do_step( System &system , const state_type &in , state_type &out , time_type t , time_type dt )
+ {
+ m_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
+ system( in , m_dxdt ,t );
+ this->stepper().do_step_impl( system , in , m_dxdt , out , t , dt );
+ }
+
+ template< class System >
+ void do_step( System &system , const state_type &in , const state_type &dxdt , state_type &out , time_type t , time_type dt )
+ {
+ this->stepper().do_step_impl( system , in , dxdt , out , t , dt );
+ }
+
+
+
+ template< class System >
+ void do_step( System &system , state_type &x , time_type t , time_type dt , state_type &xerr )
+ {
+ m_size_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
+ system( x , m_dxdt ,t );
+ this->stepper().do_step_impl( system , x , m_dxdt , x , t , dt , xerr );
+ }
+
+ template< class System >
+ void do_step( System &system , state_type &x , const state_type &dxdt , time_type t , time_type dt , state_type &xerr )
+ {
+ this->stepper().do_step_impl( system , x , dxdt , x , t , dt , xerr );
+ }
+
+ template< class System >
+ void do_step( System &system , state_type &in , state_type &out , time_type t , time_type dt , state_type &xerr )
+ {
+ m_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
+ system( in , m_dxdt ,t );
+ this->stepper().do_step_impl( system , in , m_dxdt , out , t , dt , xerr );
+ }
+
+ template< class System >
+ void do_step( System &system , state_type &in , const state_type &dxdt , state_type &out , time_type t , time_type dt , state_type &xerr )
+ {
+ this->stepper().do_step_impl( system , in , dxdt , out , t , dt , xerr );
+ }
+
+ void adjust_size( const state_type &x )
+ {
+ m_size_adjuster.adjust_size( x );
+ }
+
+
+private:
+
+ size_adjuster< state_type , 1 > m_size_adjuster;
+ state_type m_dxdt;
+
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+#endif //BOOST_NUMERIC_ODEINT_EXPLICIT_STEPPER_AND_ERROR_STEPPER_BASE_HPP_INCLUDED

Added: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp 2010-09-29 07:54:31 EDT (Wed, 29 Sep 2010)
@@ -0,0 +1,122 @@
+/*
+ boost header: numeric/odeint/explicit_stepper_base.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_EXPLICIT_STEPPER_BASE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXPLICIT_STEPPER_BASE_HPP_INCLUDED
+
+#include <boost/noncopyable.hpp>
+
+#include <boost/numeric/odeint/stepper/adjust_size.hpp>
+#include <boost/numeric/odeint/algebra/standard_resize.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/*
+ * base class for explicit steppers
+ * models the stepper concept
+ */
+template<
+ class Stepper ,
+ unsigned short Order ,
+ class State ,
+ class Time ,
+ class Algebra ,
+ class Operations ,
+ class AdjustSizePolicy
+>
+class explicit_stepper_base : boost::noncopyable
+{
+public:
+
+
+ typedef State state_type;
+ typedef Time time_type;
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+ typedef AdjustSizePolicy adjust_size_policy;
+ typedef Stepper stepper_type;
+
+ typedef explicit_stepper_base< Stepper , Order , State , Time , Algebra , Operations , AdjustSizePolicy > internal_stepper_base_type;
+
+ typedef unsigned short order_type;
+ static const order_type order_value = Order;
+
+ order_type order( void ) const { return order_value; }
+
+
+ explicit_stepper_base( void ) : m_size_adjuster() , m_dxdt()
+ {
+ boost::numeric::odeint::construct( m_dxdt );
+ m_size_adjuster.register_state( 0 , m_dxdt );
+ }
+
+ ~explicit_stepper_base( void )
+ {
+ boost::numeric::odeint::destruct( m_dxdt );
+ }
+
+
+ stepper_type& stepper( void ) { return *static_cast< stepper_type* >( this ); }
+ const stepper_type& stepper( void ) const {return *static_cast< const stepper_type* >( this );}
+
+
+
+ template< class System >
+ void do_step( System &system , state_type &x , time_type t , time_type dt )
+ {
+ m_size_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
+ system( x , m_dxdt ,t );
+ this->stepper().do_step_impl( system , x , m_dxdt , x , t , dt );
+ }
+
+ template< class System >
+ void do_step( System &system , state_type &x , const state_type dxdt , time_type t , time_type dt )
+ {
+ this->stepper().do_step_impl( system , x , dxdt , x , t , dt );
+ }
+
+ template< class System >
+ void do_step( System &system , const state_type &in , state_type &out , time_type t , time_type dt )
+ {
+ m_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
+ system( in , m_dxdt ,t );
+ this->stepper().do_step_impl( system , in , m_dxdt , out , t , dt );
+ }
+
+ template< class System >
+ void do_step( System &system , const state_type &in , const state_type &dxdt , state_type &out , time_type t , time_type dt )
+ {
+ this->stepper().do_step_impl( system , in , dxdt , out , t , dt );
+ }
+
+
+ void adjust_size( const state_type &x )
+ {
+ m_size_adjuster.adjust_size( x );
+ }
+
+
+private:
+
+ size_adjuster< state_type , 1 > m_size_adjuster;
+ state_type m_dxdt;
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+#endif //BOOST_NUMERIC_ODEINT_EXPLICIT_STEPPER_BASE_HPP_INCLUDED

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_dopri5.hpp 2010-09-29 07:54:31 EDT (Wed, 29 Sep 2010)
@@ -16,7 +16,7 @@
 #include <boost/numeric/odeint/algebra/standard_operations.hpp>
 #include <boost/numeric/odeint/algebra/standard_resize.hpp>
 
-#include <boost/numeric/odeint/stepper/explicit_stepper_base.hpp>
+#include <boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp>
 #include <boost/numeric/odeint/stepper/detail/macros.hpp>
 
 namespace boost {

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp 2010-09-29 07:54:31 EDT (Wed, 29 Sep 2010)
@@ -18,7 +18,7 @@
 #include <boost/numeric/odeint/algebra/standard_operations.hpp>
 #include <boost/numeric/odeint/algebra/standard_resize.hpp>
 
-#include <boost/numeric/odeint/stepper/explicit_stepper_base.hpp>
+#include <boost/numeric/odeint/stepper/base/explicit_stepper_and_error_stepper_base.hpp>
 #include <boost/numeric/odeint/stepper/detail/macros.hpp>
 
 namespace boost {

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_euler.hpp 2010-09-29 07:54:31 EDT (Wed, 29 Sep 2010)
@@ -16,7 +16,7 @@
 #include <boost/numeric/odeint/algebra/standard_algebra.hpp>
 #include <boost/numeric/odeint/algebra/standard_operations.hpp>
 
-#include <boost/numeric/odeint/stepper/explicit_stepper_base.hpp>
+#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
 #include <boost/numeric/odeint/stepper/detail/macros.hpp>
 
 namespace boost {

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_rk4.hpp 2010-09-29 07:54:31 EDT (Wed, 29 Sep 2010)
@@ -18,7 +18,7 @@
 #include <boost/numeric/odeint/algebra/standard_operations.hpp>
 #include <boost/numeric/odeint/algebra/standard_resize.hpp>
 
-#include <boost/numeric/odeint/stepper/explicit_stepper_base.hpp>
+#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
 #include <boost/numeric/odeint/stepper/detail/macros.hpp>
 
 namespace boost {

Deleted: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_stepper_base.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/explicit_stepper_base.hpp 2010-09-29 07:54:31 EDT (Wed, 29 Sep 2010)
+++ (empty file)
@@ -1,381 +0,0 @@
-/*
- boost header: BOOST_NUMERIC_ODEINT/explicit_stepper_base.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_EXPLICIT_STEPPER_BASE_HPP_INCLUDED
-#define BOOST_BOOST_NUMERIC_ODEINT_EXPLICIT_STEPPER_BASE_HPP_INCLUDED
-
-
-#include <boost/noncopyable.hpp>
-
-#include <boost/numeric/odeint/stepper/adjust_size.hpp>
-#include <boost/numeric/odeint/algebra/standard_resize.hpp>
-
-
-
-
-namespace boost {
-namespace numeric {
-namespace odeint {
-
-
-
-
-
-
-
-/*
- * base class for explicit steppers
- * models the stepper concept
- */
-template<
- class Stepper ,
- unsigned short Order ,
- class State ,
- class Time ,
- class Algebra ,
- class Operations ,
- class AdjustSizePolicy
->
-class explicit_stepper_base : boost::noncopyable
-{
-public:
-
-
- typedef State state_type;
- typedef Time time_type;
- typedef Algebra algebra_type;
- typedef Operations operations_type;
- typedef AdjustSizePolicy adjust_size_policy;
- typedef Stepper stepper_type;
-
- typedef explicit_stepper_base< Stepper , Order , State , Time , Algebra , Operations , AdjustSizePolicy > internal_stepper_base_type;
-
- typedef unsigned short order_type;
- static const order_type order_value = Order;
-
- order_type order( void ) const { return order_value; }
-
-
- explicit_stepper_base( void ) : m_size_adjuster() , m_dxdt()
- {
- boost::numeric::odeint::construct( m_dxdt );
- m_size_adjuster.register_state( 0 , m_dxdt );
- }
-
- ~explicit_stepper_base( void )
- {
- boost::numeric::odeint::destruct( m_dxdt );
- }
-
-
- stepper_type& stepper( void ) { return *static_cast< stepper_type* >( this ); }
- const stepper_type& stepper( void ) const {return *static_cast< const stepper_type* >( this );}
-
-
-
- template< class System >
- void do_step( System &system , state_type &x , time_type t , time_type dt )
- {
- m_size_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
- system( x , m_dxdt ,t );
- this->stepper().do_step_impl( system , x , m_dxdt , x , t , dt );
- }
-
- template< class System >
- void do_step( System &system , state_type &x , const state_type dxdt , time_type t , time_type dt )
- {
- this->stepper().do_step_impl( system , x , dxdt , x , t , dt );
- }
-
- template< class System >
- void do_step( System &system , const state_type &in , state_type &out , time_type t , time_type dt )
- {
- m_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
- system( in , m_dxdt ,t );
- this->stepper().do_step_impl( system , in , m_dxdt , out , t , dt );
- }
-
- template< class System >
- void do_step( System &system , const state_type &in , const state_type &dxdt , state_type &out , time_type t , time_type dt )
- {
- this->stepper().do_step_impl( system , in , dxdt , out , t , dt );
- }
-
-
- void adjust_size( const state_type &x )
- {
- m_size_adjuster.adjust_size( x );
- }
-
-
-private:
-
- size_adjuster< state_type , 1 > m_size_adjuster;
- state_type m_dxdt;
-};
-
-
-
-
-
-
-
-
-
-
-
-/*
- * base class for explicit error steppers
- * models the error stepper concept
- * ToDo : test
- */
-template<
- class ErrorStepper ,
- unsigned short StepperOrder ,
- unsigned short ErrorOrder ,
- class State ,
- class Time ,
- class Algebra ,
- class Operations ,
- class AdjustSizePolicy
->
-class explicit_error_stepper_base
-{
-public:
-
-
- typedef State state_type;
- typedef Time time_type;
- typedef Algebra algebra_type;
- typedef Operations operations_type;
- typedef AdjustSizePolicy adjust_size_policy;
- typedef ErrorStepper stepper_type;
-
- typedef unsigned short order_type;
- static const order_type stepper_order_value = StepperOrder;
- static const order_type error_order_value = ErrorOrder;
-
- order_type stepper_order( void ) const { return stepper_order_value; }
-
- order_type error_order( void ) const { return error_order_value; }
-
-
- explicit_error_stepper_base( void ) : m_size_adjuster() , m_dxdt()
- {
- boost::numeric::odeint::construct( m_dxdt );
- m_size_adjuster.register_state( 0 , m_dxdt );
- }
-
- ~explicit_error_stepper_base( void )
- {
- boost::numeric::odeint::destruct( m_dxdt );
- }
-
-
-
- stepper_type& stepper( void ) { return *static_cast< stepper_type* >( this ); }
- const stepper_type& stepper( void ) const {return *static_cast< const stepper_type* >( this );}
-
-
-
- template< class System >
- void do_step( System &system , state_type &x , time_type t , time_type dt , state_type &xerr )
- {
- m_size_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
- system( x , m_dxdt ,t );
- this->stepper().do_step_impl( system , x , m_dxdt , x , t , dt , xerr );
- }
-
- template< class System >
- void do_step( System &system , state_type &x , const state_type &dxdt , time_type t , time_type dt , state_type &xerr )
- {
- this->stepper().do_step_impl( system , x , dxdt , x , t , dt , xerr );
- }
-
- template< class System >
- void do_step( System &system , const state_type &in , state_type &out , time_type t , time_type dt , state_type &xerr )
- {
- m_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
- system( in , m_dxdt ,t );
- this->stepper().do_step_impl( system , in , m_dxdt , out , t , dt , xerr );
- }
-
- template< class System >
- void do_step( System &system , const state_type &in , const state_type &dxdt , state_type &out , time_type t , time_type dt , state_type &xerr )
- {
- this->stepper().do_step_impl( system , in , dxdt , out , t , dt , xerr );
- }
-
-
- void adjust_size( const state_type &x )
- {
- m_size_adjuster.adjust_size( x );
- }
-
-
-private:
-
- size_adjuster< state_type , 1 > m_size_adjuster;
- state_type m_dxdt;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*
- * base class for explicit stepper and error steppers
- * models the stepper AND the error stepper concept
- */
-template<
- class Stepper ,
- unsigned short Order ,
- unsigned short StepperOrder ,
- unsigned short ErrorOrder ,
- class State ,
- class Time ,
- class Algebra ,
- class Operations ,
- class AdjustSizePolicy
->
-class explicit_stepper_and_error_stepper_base
-{
-public:
-
-
- typedef State state_type;
- typedef Time time_type;
- typedef Algebra algebra_type;
- typedef Operations operations_type;
- typedef AdjustSizePolicy adjust_size_policy;
- typedef Stepper stepper_type;
-
- typedef unsigned short order_type;
- static const order_type order_value = Order;
- static const order_type stepper_order_value = StepperOrder;
- static const order_type error_order_value = ErrorOrder;
-
- order_type order( void ) const { return order_value; }
- order_type stepper_order( void ) const { return stepper_order_value; }
- order_type error_order( void ) const { return error_order_value; }
-
-
- explicit_stepper_and_error_stepper_base( void ) : m_size_adjuster() , m_dxdt()
- {
- boost::numeric::odeint::construct( m_dxdt );
- m_size_adjuster.register_state( 0 , m_dxdt );
- }
-
- ~explicit_stepper_and_error_stepper_base( void )
- {
- boost::numeric::odeint::destruct( m_dxdt );
- }
-
-
-
- stepper_type& stepper( void ) { return *static_cast< stepper_type* >( this ); }
- const stepper_type& stepper( void ) const {return *static_cast< const stepper_type* >( this );}
-
-
- template< class System >
- void do_step( System &system , state_type &x , time_type t , time_type dt )
- {
- m_size_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
- system( x , m_dxdt ,t );
- this->stepper().do_step_impl( system , x , m_dxdt , x , t , dt );
- }
-
- template< class System >
- void do_step( System &system , state_type &x , const state_type &dxdt , time_type t , time_type dt )
- {
- this->stepper().do_step_impl( system , x , dxdt , x , t , dt );
- }
-
- template< class System >
- void do_step( System &system , const state_type &in , state_type &out , time_type t , time_type dt )
- {
- m_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
- system( in , m_dxdt ,t );
- this->stepper().do_step_impl( system , in , m_dxdt , out , t , dt );
- }
-
- template< class System >
- void do_step( System &system , const state_type &in , const state_type &dxdt , state_type &out , time_type t , time_type dt )
- {
- this->stepper().do_step_impl( system , in , dxdt , out , t , dt );
- }
-
-
-
- template< class System >
- void do_step( System &system , state_type &x , time_type t , time_type dt , state_type &xerr )
- {
- m_size_adjuster.adjust_size_by_policy( x , adjust_size_policy() );
- system( x , m_dxdt ,t );
- this->stepper().do_step_impl( system , x , m_dxdt , x , t , dt , xerr );
- }
-
- template< class System >
- void do_step( System &system , state_type &x , const state_type &dxdt , time_type t , time_type dt , state_type &xerr )
- {
- this->stepper().do_step_impl( system , x , dxdt , x , t , dt , xerr );
- }
-
- template< class System >
- void do_step( System &system , state_type &in , state_type &out , time_type t , time_type dt , state_type &xerr )
- {
- m_size_adjuster.adjust_size_by_policy( in , adjust_size_policy() );
- system( in , m_dxdt ,t );
- this->stepper().do_step_impl( system , in , m_dxdt , out , t , dt , xerr );
- }
-
- template< class System >
- void do_step( System &system , state_type &in , const state_type &dxdt , state_type &out , time_type t , time_type dt , state_type &xerr )
- {
- this->stepper().do_step_impl( system , in , dxdt , out , t , dt , xerr );
- }
-
- void adjust_size( const state_type &x )
- {
- m_size_adjuster.adjust_size( x );
- }
-
-
-private:
-
- size_adjuster< state_type , 1 > m_size_adjuster;
- state_type m_dxdt;
-
-};
-
-
-
-
-} // odeint
-} // numeric
-} // boost
-
-
-#endif //BOOST_BOOST_NUMERIC_ODEINT_EXPLICIT_STEPPER_BASE_HPP_INCLUDED

Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/dense_output.cpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/dense_output.cpp 2010-09-29 07:54:31 EDT (Wed, 29 Sep 2010)
@@ -0,0 +1,33 @@
+/*
+ * dense_output.cpp
+ *
+ * Created on: Sep 29, 2010
+ * Author: karsten
+ */
+
+class dopri5_dense_output
+{
+public:
+
+ template< class System >
+ std::pair< time_type , time_type > do_step( System &system );
+
+ state_type get_state( double t );
+ void calc_state( double t , state_type &x );
+ state_type& get_current_state( void );
+};
+
+
+void test_dense_output
+{
+ dopri_dense_output dopri;
+
+ dopri.initialize( x0 , t0 , dt0 );
+
+ while( t < tend )
+ {
+ std::pair< double , double > time_range = dopri.do_step( system );
+ state_type x = dopri.get_state( time_range.first + 0.1 );
+ dopri.calc_state( time_range.first + 0.1 , x );
+ }
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk