Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57584 - in sandbox/odeint: boost/numeric boost/numeric/odeint boost/numeric/odeint/detail libs/numeric/odeint/examples libs/numeric/odeint/stuff/gsl_compare libs/numeric/odeint/stuff/iterator_algebra
From: karsten.ahnert_at_[hidden]
Date: 2009-11-11 16:56:37


Author: karsten
Date: 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
New Revision: 57584
URL: http://svn.boost.org/trac/boost/changeset/57584

Log:
changing names
Added:
   sandbox/odeint/boost/numeric/odeint/stepper_euler.hpp (contents, props changed)
      - copied, changed from r57580, /sandbox/odeint/boost/numeric/odeint/euler.hpp
   sandbox/odeint/boost/numeric/odeint/stepper_rk4.hpp (contents, props changed)
      - copied, changed from r57580, /sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp
Removed:
   sandbox/odeint/boost/numeric/odeint/euler.hpp
   sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp
Text files modified:
   sandbox/odeint/boost/numeric/odeint.hpp | 4 ++--
   sandbox/odeint/boost/numeric/odeint/detail/iterator_algebra.hpp | 10 +++++-----
   sandbox/odeint/boost/numeric/odeint/stepper_euler.hpp | 13 +++++++------
   sandbox/odeint/boost/numeric/odeint/stepper_half_step.hpp | 2 +-
   sandbox/odeint/boost/numeric/odeint/stepper_rk4.hpp | 10 +++++-----
   sandbox/odeint/libs/numeric/odeint/examples/lorenz_controlled.cpp | 2 +-
   sandbox/odeint/libs/numeric/odeint/examples/lorenz_integrate_constant_step.cpp | 4 ++--
   sandbox/odeint/libs/numeric/odeint/examples/lorenz_integrator.cpp | 2 +-
   sandbox/odeint/libs/numeric/odeint/examples/lorenz_stepper.cpp | 4 ++--
   sandbox/odeint/libs/numeric/odeint/stuff/gsl_compare/lorenz_stepper_cmp.cpp | 5 ++++-
   sandbox/odeint/libs/numeric/odeint/stuff/iterator_algebra/increment_decrement.cc | 20 ++++++++++----------
   11 files changed, 40 insertions(+), 36 deletions(-)

Modified: sandbox/odeint/boost/numeric/odeint.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint.hpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -15,8 +15,8 @@
 #ifndef BOOST_NUMERIC_ODEINT_HPP
 #define BOOST_NUMERIC_ODEINT_HPP
 
-#include <boost/numeric/odeint/euler.hpp>
-#include <boost/numeric/odeint/runge_kutta_4.hpp>
+#include <boost/numeric/odeint/stepper_euler.hpp>
+#include <boost/numeric/odeint/stepper_rk4.hpp>
 #include <boost/numeric/odeint/stepper_half_step.hpp>
 
 #include <boost/numeric/odeint/stepsize_controller_standard.hpp>

Modified: sandbox/odeint/boost/numeric/odeint/detail/iterator_algebra.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/detail/iterator_algebra.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/detail/iterator_algebra.hpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -36,7 +36,7 @@
         T alpha
         )
     {
- while( first1 < last1 )
+ while( first1 != last1 )
             (*first1++) += alpha * (*first2++);
     }
 
@@ -53,7 +53,7 @@
         InputIterator1 first2 ,
         InputIterator2 first3 )
     {
- while( first1 < last1 )
+ while( first1 != last1 )
             (*first1++) = (*first2++) - (*first3++);
     }
 
@@ -71,7 +71,7 @@
         InputIterator2 first3 ,
         T alpha )
     {
- while( first1 < last1 )
+ while( first1 != last1 )
             (*first1++) = (*first2++) + alpha * (*first3++);
     }
 
@@ -94,7 +94,7 @@
         T alpha2
         )
     {
- while( first1 < last1 )
+ while( first1 != last1 )
             (*first1++) += alpha1 *
                 ( (*first2++) + (*first3++) + alpha2*(*first4++) );
     }
@@ -117,7 +117,7 @@
         T alpha
         )
     {
- while( first1 < last1 )
+ while( first1 != last1 )
         {
             (*first1++) = (*first2++) + alpha * (*first3);
             (*first3++) += (*first4++);

Deleted: sandbox/odeint/boost/numeric/odeint/euler.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/euler.hpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
+++ (empty file)
@@ -1,110 +0,0 @@
-/* Boost odeint/euler.hpp header file
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
- Copyright 2009 Andre Bergner
-
- This file includes the explicit euler solver for ordinary differential equations.
-
- It solves any ODE dx/dt = f(x,t) via
- x(t+dt) = x(t) + dt*f(x,t)
-
- 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_EULER_HPP
-#define BOOST_NUMERIC_ODEINT_EULER_HPP
-
-#include <boost/concept_check.hpp>
-
-#include <boost/numeric/odeint/detail/iterator_algebra.hpp>
-#include <boost/numeric/odeint/concepts/state_concept.hpp>
-#include <boost/numeric/odeint/resizer.hpp>
-
-
-
-namespace boost {
-namespace numeric {
-namespace odeint {
-
- template<
- class Container ,
- class Time = double ,
- class Resizer = resizer< Container >
- >
- class ode_step_euler
- {
-
-
- // provide basic typedefs
- public:
-
- typedef Container container_type;
- typedef Resizer resizer_type;
- typedef Time time_type;
- typedef const unsigned short order_type;
- typedef typename container_type::value_type value_type;
- typedef typename container_type::iterator iterator;
-
-
-
-
- // check the concept of the ContainerType
- private:
-
- BOOST_CLASS_REQUIRE( container_type ,
- boost::numeric::odeint, Container );
-
-
-
-
- // private members
- private:
-
- container_type m_dxdt;
- container_type m_xtemp;
- resizer_type m_resizer;
-
-
-
-
- // public interface
- public:
-
- order_type order() const { return 1; }
-
-
-
- template< class DynamicalSystem >
- void next_step( DynamicalSystem &system ,
- container_type &x ,
- const container_type &dxdt ,
- time_type t ,
- time_type dt )
- {
- //x = x + dt*dxdt
- detail::it_algebra::increment( x.begin() , x.end() , dxdt.begin() , dt );
- }
-
- template< class DynamicalSystem >
- void next_step( DynamicalSystem &system ,
- container_type &x ,
- time_type t ,
- time_type dt )
- {
- m_resizer.adjust_size( x , m_dxdt );
- system( x , m_dxdt , t );
- next_step( system , x , m_dxdt , t , dt );
- }
- };
-
-
-
-} // namespace odeint
-} // namespace numeric
-} // namespace boost
-
-
-#endif // BOOST_NUMERIC_ODEINT_EULER_HPP

Deleted: sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
+++ (empty file)
@@ -1,138 +0,0 @@
-/* Boost odeint/runge_kutta_4.hpp header file
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
- Copyright 2009 Andre Bergner
-
- This file includes the explicit runge kutta solver for
- ordinary differential equations.
-
- It solves any ODE dx/dt = f(x,t).
-
- 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_RUNGE_KUTTA_4_HPP
-#define BOOST_NUMERIC_ODEINT_RUNGE_KUTTA_4_HPP
-
-#include <boost/concept_check.hpp>
-
-#include <boost/numeric/odeint/concepts/state_concept.hpp>
-#include <boost/numeric/odeint/resizer.hpp>
-#include <iostream>
-
-namespace boost {
-namespace numeric {
-namespace odeint {
-
-
- template<
- class Container ,
- class Time = double ,
- class Resizer = resizer< Container >
- >
- class ode_step_runge_kutta_4
- {
-
- // provide basic typedefs
- public:
-
- typedef Container container_type;
- typedef Resizer resizer_type;
- typedef Time time_type;
- typedef const unsigned short order_type;
- typedef typename container_type::value_type value_type;
- typedef typename container_type::iterator iterator;
-
-
-
-
-
- // check the concept of the ContainerType
- private:
-
- BOOST_CLASS_REQUIRE( container_type ,
- boost::numeric::odeint, Container );
-
-
-
-
- // private members
- private:
-
- container_type m_dxdt;
- container_type m_dxt;
- container_type m_dxm;
- container_type m_xt;
- resizer_type m_resizer;
-
-
-
-
-
- // public interface
- public:
-
- order_type order() const { return 4; }
-
- template< class DynamicalSystem >
- void next_step( DynamicalSystem &system ,
- container_type &x ,
- const container_type &dxdt ,
- time_type t ,
- time_type dt )
- {
- using namespace detail::it_algebra;
-
- const time_type val2 = time_type( 2.0 );
-
- m_resizer.adjust_size( x , m_dxt );
- m_resizer.adjust_size( x , m_dxm );
- m_resizer.adjust_size( x , m_xt );
-
- time_type dh = time_type( 0.5 ) * dt;
- time_type th = t + dh;
-
- //m_xt = x + dh*dxdt
- assign_sum( m_xt.begin() , m_xt.end() , x.begin() , dxdt.begin() , dh );
-
- system( m_xt , m_dxt , th );
- //m_xt = x + dh*m_dxdt
- assign_sum( m_xt.begin() , m_xt.end() , x.begin() , m_dxt.begin() , dh );
-
- system( m_xt , m_dxm , th );
- //m_xt = x + dt*m_dxm ; m_dxm += m_dxt
- assign_sum_increment( m_xt.begin() , m_xt.end() , x.begin() ,
- m_dxm.begin() , m_dxt.begin() , dt );
-
- system( m_xt , m_dxt , value_type( t + dt ) );
- //x = dt/6 * ( m_dxdt + m_dxt + val2*m_dxm )
- increment_sum_sum( x.begin() , x.end() , dxdt.begin() ,
- m_dxt.begin() , m_dxm.begin() ,
- dt / time_type( 6.0 ) , val2 );
- }
-
-
-
- template< class DynamicalSystem >
- void next_step( DynamicalSystem &system ,
- container_type &x ,
- time_type t ,
- time_type dt )
- {
- m_resizer.adjust_size( x , m_dxdt );
- system( x , m_dxdt , t );
- next_step( system , x , m_dxdt , t , dt );
- }
-
-
- };
-
-} // namespace odeint
-} // namespace numeric
-} // namespace boost
-
-
-#endif // BOOST_NUMERIC_ODEINT_RUNGE_KUTTA_4_HPP

Copied: sandbox/odeint/boost/numeric/odeint/stepper_euler.hpp (from r57580, /sandbox/odeint/boost/numeric/odeint/euler.hpp)
==============================================================================
--- /sandbox/odeint/boost/numeric/odeint/euler.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/stepper_euler.hpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -1,10 +1,11 @@
-/* Boost odeint/euler.hpp header file
+/* Boost odeint/stepper_euler.hpp header file
  
  Copyright 2009 Karsten Ahnert
  Copyright 2009 Mario Mulansky
  Copyright 2009 Andre Bergner
  
- This file includes the explicit euler solver for ordinary differential equations.
+ This file includes the explicit euler solver for
+ ordinary differential equations.
 
  It solves any ODE dx/dt = f(x,t) via
  x(t+dt) = x(t) + dt*f(x,t)
@@ -14,8 +15,8 @@
  copy at http://www.boost.org/LICENSE_1_0.txt)
 */
 
-#ifndef BOOST_NUMERIC_ODEINT_EULER_HPP
-#define BOOST_NUMERIC_ODEINT_EULER_HPP
+#ifndef BOOST_NUMERIC_ODEINT_STEPPER_EULER_HPP
+#define BOOST_NUMERIC_ODEINT_STEPPER_EULER_HPP
 
 #include <boost/concept_check.hpp>
 
@@ -34,7 +35,7 @@
         class Time = double ,
         class Resizer = resizer< Container >
>
- class ode_step_euler
+ class stepper_euler
     {
 
 
@@ -107,4 +108,4 @@
 } // namespace boost
 
 
-#endif // BOOST_NUMERIC_ODEINT_EULER_HPP
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_EULER_HPP

Modified: sandbox/odeint/boost/numeric/odeint/stepper_half_step.hpp
==============================================================================
--- sandbox/odeint/boost/numeric/odeint/stepper_half_step.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/stepper_half_step.hpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -32,7 +32,7 @@
     template<
         class Stepper
>
- class ode_step_half_step
+ class stepper_half_step
     {
         // provide basic typedefs
     public:

Copied: sandbox/odeint/boost/numeric/odeint/stepper_rk4.hpp (from r57580, /sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp)
==============================================================================
--- /sandbox/odeint/boost/numeric/odeint/runge_kutta_4.hpp (original)
+++ sandbox/odeint/boost/numeric/odeint/stepper_rk4.hpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -1,4 +1,4 @@
-/* Boost odeint/runge_kutta_4.hpp header file
+/* Boost odeint/stepper_rk4.hpp header file
  
  Copyright 2009 Karsten Ahnert
  Copyright 2009 Mario Mulansky
@@ -14,8 +14,8 @@
  copy at http://www.boost.org/LICENSE_1_0.txt)
 */
 
-#ifndef BOOST_NUMERIC_ODEINT_RUNGE_KUTTA_4_HPP
-#define BOOST_NUMERIC_ODEINT_RUNGE_KUTTA_4_HPP
+#ifndef BOOST_NUMERIC_ODEINT_STEPPER_RK4_HPP
+#define BOOST_NUMERIC_ODEINT_STEPPER_RK_4_HPP
 
 #include <boost/concept_check.hpp>
 
@@ -33,7 +33,7 @@
         class Time = double ,
         class Resizer = resizer< Container >
>
- class ode_step_runge_kutta_4
+ class stepper_rk4
     {
 
         // provide basic typedefs
@@ -135,4 +135,4 @@
 } // namespace boost
 
 
-#endif // BOOST_NUMERIC_ODEINT_RUNGE_KUTTA_4_HPP
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_RK4_HPP

Modified: sandbox/odeint/libs/numeric/odeint/examples/lorenz_controlled.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/examples/lorenz_controlled.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/examples/lorenz_controlled.cpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -60,7 +60,7 @@
     x[1] = 0.0;
     x[2] = 20.0;
 
- ode_step_half_step< ode_step_euler< state_type > > euler;
+ stepper_half_step< stepper_euler< state_type > > euler;
     step_controller_standard< state_type, double > controller( eps_abs , eps_rel, 1.0, 1.0);
     
     cout.precision(5);

Modified: sandbox/odeint/libs/numeric/odeint/examples/lorenz_integrate_constant_step.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/examples/lorenz_integrate_constant_step.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/examples/lorenz_integrate_constant_step.cpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -63,8 +63,8 @@
     x[1] = 0.0;
     x[2] = 0.0;
 
- ode_step_runge_kutta_4< state_type , double > rk4;
- ode_step_euler< state_type , double > euler;
+ stepper_rk4< state_type , double > rk4;
+ stepper_euler< state_type , double > euler;
     integrate( rk4 , lorenz , 0.0 , 0.01 , x , 100.0 ,
                cout << _1 << tab << _2[0] << "\n" );
 

Modified: sandbox/odeint/libs/numeric/odeint/examples/lorenz_integrator.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/examples/lorenz_integrator.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/examples/lorenz_integrator.cpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -62,7 +62,7 @@
         times[i] = 0.1*i;
     }
 
- ode_step_half_step< ode_step_euler< state_type > > euler;
+ stepper_half_step< stepper_euler< state_type > > euler;
     size_t steps = integrate( euler, lorenz, x, times, back_inserter(x_t_vec));
 
     clog << "Steps: " << steps << endl;

Modified: sandbox/odeint/libs/numeric/odeint/examples/lorenz_stepper.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/examples/lorenz_stepper.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/examples/lorenz_stepper.cpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -69,8 +69,8 @@
     x1[2] = 0.0;
     state_type2 x2 = {{ 1.0 , 0.0 , 0.0 }};
 
- ode_step_runge_kutta_4< state_type1 > stepper1;
- ode_step_runge_kutta_4< state_type2 > stepper2;
+ stepper_rk4< state_type1 > stepper1;
+ stepper_rk4< state_type2 > stepper2;
 
     clock_t start , end;
     double t;

Modified: sandbox/odeint/libs/numeric/odeint/stuff/gsl_compare/lorenz_stepper_cmp.cpp
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/stuff/gsl_compare/lorenz_stepper_cmp.cpp (original)
+++ sandbox/odeint/libs/numeric/odeint/stuff/gsl_compare/lorenz_stepper_cmp.cpp 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -39,6 +39,7 @@
 
 typedef std::tr1::array< double , 3 > state_type;
 
+
 const double sigma = 10.0;
 const double R = 28.0;
 const double b = 8.0 / 3.0;
@@ -89,6 +90,8 @@
 }
 
 
+
+
 int main( int argc , char **argv )
 {
     const double dt = 0.01;
@@ -104,7 +107,7 @@
 
     // odeint method
     state_type x1 = x_start , x1_err;
- ode_step_half_step< ode_step_runge_kutta_4< state_type > > stepper;
+ stepper_half_step< stepper_rk4< state_type > > stepper;
 
     start= clock();
     t = 0.0;

Modified: sandbox/odeint/libs/numeric/odeint/stuff/iterator_algebra/increment_decrement.cc
==============================================================================
--- sandbox/odeint/libs/numeric/odeint/stuff/iterator_algebra/increment_decrement.cc (original)
+++ sandbox/odeint/libs/numeric/odeint/stuff/iterator_algebra/increment_decrement.cc 2009-11-11 16:56:35 EST (Wed, 11 Nov 2009)
@@ -18,7 +18,7 @@
 template< class InOutIterator , class InputIterator >
 void increment( InOutIterator first1 , InOutIterator last1 , InputIterator first2 )
 {
- while( first1 < last1 )
+ while( first1 != last1 )
         (*first1++) += (*first2++);
 }
 
@@ -28,7 +28,7 @@
 template< class InOutIterator , class InputIterator , class T >
 void increment( InOutIterator first1 , InOutIterator last1 , InputIterator first2 , T val )
 {
- while( first1 < last1 )
+ while( first1 != last1 )
         (*first1++) += val * (*first2++);
 }
 
@@ -38,7 +38,7 @@
 template< class InOutIterator , class InputIterator , class Operation >
 void increment_op( InOutIterator first1 , InOutIterator last1 , InputIterator first2 , Operation op )
 {
- while( first1 < last1 )
+ while( first1 != last1 )
         (*first1++) += op(*first2++);
 }
 
@@ -48,7 +48,7 @@
 template< class InOutIterator , class InputIterator >
 void decrement( InOutIterator first1 , InOutIterator last1 , InputIterator first2 )
 {
- while( first1 < last1 )
+ while( first1 != last1 )
         (*first1++) -= (*first2++);
 }
 
@@ -58,7 +58,7 @@
 template< class InOutIterator , class InputIterator , class T >
 void decrement( InOutIterator first1 , InOutIterator last1 , InputIterator first2 , T val )
 {
- while( first1 < last1 )
+ while( first1 != last1 )
         (*first1++) -= val * (*first2++);
 }
 
@@ -68,7 +68,7 @@
 template< class InOutIterator , class InputIterator , class Operation >
 void decrement_op( InOutIterator first1 , InOutIterator last1 , InputIterator first2 , Operation op )
 {
- while( first1 < last1 )
+ while( first1 != last1 )
         (*first1++) -= op(*first2++);
 }
 
@@ -82,7 +82,7 @@
 template< class InOutIterator , class InputIterator1 , class InputIterator2 >
 void increment_add( InOutIterator first1 , InOutIterator last1 , InputIterator1 first2 , InputIterator2 first3 )
 {
- while( first1 < last1 )
+ while( first1 != last1 )
         (*first1++) += (*first2++) + (*first3++);
 }
 
@@ -92,7 +92,7 @@
 template< class InOutIterator , class InputIterator1 , class InputIterator2 , class T >
 void increment_add( InOutIterator first1 , InOutIterator last1 , InputIterator1 first2 , InputIterator2 first3 , T val )
 {
- while( first1 < last1 )
+ while( first1 != last1 )
         (*first1++) += val * ( (*first2++) + (*first3++) );
 }
 
@@ -102,7 +102,7 @@
 template< class InOutIterator , class InputIterator1 , class InputIterator2 , class T >
 void increment_add( InOutIterator first1 , InOutIterator last1 , InputIterator1 first2 , InputIterator2 first3 , T val1 , T val2 )
 {
- while( first1 < last1 )
+ while( first1 != last1 )
         (*first1++) += val1 * (*first2++) + val2 * (*first3++);
 }
 
@@ -112,7 +112,7 @@
 template< class InOutIterator , class InputIterator1 , class InputIterator2 , class Operation >
 void increment_add_op( InOutIterator first1 , InOutIterator last1 , InputIterator1 first2 , InputIterator2 first3 , Operation op )
 {
- while( first1 < last1 )
+ while( first1 != last1 )
         (*first1++) += op( *first2++ , *first3++ );
 }
 


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