Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68473 - in sandbox/odeint/branches/karsten: . boost/numeric/odeint/stepper libs/numeric/odeint/regression_test libs/numeric/odeint/test libs/numeric/odeint/test_external/gmp libs/numeric/odeint/test_external/gsl libs/numeric/odeint/test_external/mkl libs/numeric/odeint/test_external/thrust
From: karsten.ahnert_at_[hidden]
Date: 2011-01-27 10:06:02


Author: karsten
Date: 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
New Revision: 68473
URL: http://svn.boost.org/trac/boost/changeset/68473

Log:
* cleaning header dependencies in test and regression_test
* moving error_checker_standard to controlled_error_stepper.hpp
Added:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_stepper_result.hpp (contents, props changed)
Removed:
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/error_checker.hpp
Text files modified:
   sandbox/odeint/branches/karsten/TODO | 12 ++++---
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp | 58 +++++++++++++++++++++++++++++++++++----
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_dopri5.hpp | 1
   sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/size_adjuster.hpp | 7 ++++
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/controlled_stepper_evolution.cpp | 4 ++
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_dopri5.cpp | 4 ++
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_explicit_euler.cpp | 5 ++-
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_stepper_evolution.cpp | 4 ++
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/implicit_euler.cpp | 1
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/resizing.cpp | 3 +
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp | 6 +++
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_copying.cpp | 2 -
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_with_units.cpp | 6 +++
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/check_gmp.cpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/check_gsl.cpp | 3 --
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/mkl/check_mkl.cpp | 2
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/check_thrust.cu | 2
   17 files changed, 93 insertions(+), 29 deletions(-)

Modified: sandbox/odeint/branches/karsten/TODO
==============================================================================
--- sandbox/odeint/branches/karsten/TODO (original)
+++ sandbox/odeint/branches/karsten/TODO 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -2,12 +2,13 @@
   NEARLY DONE * test operations
   OK * test standard_algebra
   OK * test fusion_algebra
- * test vector_space_algebra
+ * test vector_space_algebra, maybe with some proto lib
   * test copying
+ * test gsl
 OK * change standard_operations::rel_error in order to word with units and test it
-* include implicit euler
- * call via std::pair< deriv , jacobi >
- * resizing
+OK * include implicit euler
+ OK * call via std::pair< deriv , jacobi >
+ OK * resizing
 * include rosenbrock4 in trunk
 OK * operations that fit units
 OK * operations that fit result_of
@@ -16,7 +17,7 @@
 OK * change error_stepper to error_stepper_units
 DIFFICULT * finishing change of controlled_stepper to units
   * check if rosenbrock controller and controlled_stepper can both be used with the explicit steppers
- * move error_checker into controlled_stepper
+ OK * move error_checker into controlled_stepper
   * rename controlled_stepper to a more specific name
 DIFICULT * change dense_output to units
   * roll out dense_output_explicit_euler::calc_state() to explicit_euler::dense_output()
@@ -28,6 +29,7 @@
 * 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
+OK * in all tests and regression test do not include odeint.hpp, only include the headers which are really needed
 
 * 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/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-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -19,19 +19,65 @@
 #include <boost/ref.hpp>
 
 #include <boost/numeric/odeint/stepper/size_adjuster.hpp>
-#include <boost/numeric/odeint/stepper/error_checker.hpp>
+#include <boost/numeric/odeint/stepper/controlled_stepper_result.hpp>
 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
 
 namespace boost {
 namespace numeric {
 namespace odeint {
 
-typedef enum
+
+/*
+ * Error checker for controlled_error_stepper
+ *
+ * ToDo: implement constructor with epsilons
+ */
+template
+<
+ class Value ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations
+>
+class error_checker_standard
 {
- success_step_size_unchanged ,
- step_size_decreased ,
- success_step_size_increased
-} controlled_step_result;
+public:
+
+ typedef Value value_type;
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+
+
+ error_checker_standard( void ) : m_eps_abs( 1E-6 ) , m_eps_rel( 1E-6 ) , m_a_x( 1.0 ) , m_a_dxdt( 1.0 )
+ {}
+
+
+ template< class State , class Deriv , class Err , class Time >
+ value_type error( const State &x_old , const Deriv &dxdt_old , Err &x_err , const Time &dt )
+ {
+ // this overwrites x_err !
+ typename algebra_type::for_each3()( x_old , dxdt_old , x_err ,
+ typename operations_type::template rel_error< value_type >( m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt * detail::get_value( dt ) ) );
+
+ value_type res = typename algebra_type::reduce()( x_err , typename operations_type::template maximum< value_type >() , 0.0 );
+ return res;
+ }
+
+private:
+
+ value_type m_eps_abs;
+ value_type m_eps_rel;
+ value_type m_a_x;
+ value_type m_a_dxdt;
+};
+
+
+
+
+
+
 
 
 /*

Added: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_stepper_result.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_stepper_result.hpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,27 @@
+/*
+ * controlled_stepper_result.hpp
+ *
+ * Created on: Jan 27, 2011
+ * Author: karsten
+ */
+
+#ifndef CONTROLLED_STEPPER_RESULT_HPP_
+#define CONTROLLED_STEPPER_RESULT_HPP_
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+typedef enum
+{
+ success_step_size_unchanged ,
+ step_size_decreased ,
+ success_step_size_increased
+} controlled_step_result;
+
+} // namespace odeint
+} // numeric
+} // boost
+
+#endif /* CONTROLLED_STEPPER_RESULT_HPP_ */

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_dopri5.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_dopri5.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/dense_output_dopri5.hpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -25,6 +25,7 @@
 #include <boost/type_traits.hpp>
 #include <boost/ref.hpp>
 
+#include <boost/numeric/odeint/stepper/controlled_stepper_result.hpp>
 #include <boost/numeric/odeint/stepper/explicit_error_dopri5.hpp>
 
 namespace boost {

Deleted: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/error_checker.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/error_checker.hpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
+++ (empty file)
@@ -1,70 +0,0 @@
-/*
- boost header: NUMERIC_ODEINT/error_checker.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_ERROR_CHECKER_HPP_INCLUDED
-#define BOOST_NUMERIC_ODEINT_ERROR_CHECKER_HPP_INCLUDED
-
-#include <boost/numeric/odeint/algebra/range_algebra.hpp>
-#include <boost/numeric/odeint/algebra/default_operations.hpp>
-
-namespace boost {
-namespace numeric {
-namespace odeint {
-
-
-/*
- * ToDo: implement constructor with epsilons
- */
-template
-<
- class Value ,
- class Algebra = range_algebra ,
- class Operations = default_operations
->
-class error_checker_standard
-{
-public:
-
- typedef Value value_type;
- typedef Algebra algebra_type;
- typedef Operations operations_type;
-
-
- error_checker_standard( void ) : m_eps_abs( 1E-6 ) , m_eps_rel( 1E-6 ) , m_a_x( 1.0 ) , m_a_dxdt( 1.0 )
- {}
-
-
- template< class State , class Deriv , class Err , class Time >
- value_type error( const State &x_old , const Deriv &dxdt_old , Err &x_err , const Time &dt )
- {
- // this overwrites x_err !
- typename algebra_type::for_each3()( x_old , dxdt_old , x_err ,
- typename operations_type::template rel_error< value_type >( m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt * detail::get_value( dt ) ) );
-
- value_type res = typename algebra_type::reduce()( x_err , typename operations_type::template maximum< value_type >() , 0.0 );
- return res;
- }
-
-private:
-
- value_type m_eps_abs;
- value_type m_eps_rel;
- value_type m_a_x;
- value_type m_a_dxdt;
-};
-
-} // odeint
-} // numeric
-} // boost
-
-
-#endif //BOOST_NUMERIC_ODEINT_ERROR_CHECKER_HPP_INCLUDED

Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/size_adjuster.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/size_adjuster.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/size_adjuster.hpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -36,7 +36,12 @@
 
 
 
-
+/*
+ * we need this interface in order to call matrix by vector resizing,
+ * i.e. mat.resize( vec.size() , vec.size() )
+ *
+ * See implicit_euler.hpp for usage
+ */
 struct default_adjust_size_caller
 {
         template< class Container1 , class Container2 >

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/controlled_stepper_evolution.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/controlled_stepper_evolution.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/controlled_stepper_evolution.cpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -10,7 +10,9 @@
 #include <iostream>
 #include <tr1/array>
 
-#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/controlled_error_stepper.hpp>
 
 #define tab "\t"
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_dopri5.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_dopri5.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_dopri5.cpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -9,7 +9,9 @@
 #include <fstream>
 #include <iostream>
 
-#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/controlled_error_stepper.hpp>
 
 using namespace boost::numeric::odeint;
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_explicit_euler.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_explicit_euler.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_explicit_euler.cpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -15,8 +15,9 @@
 #include <fstream>
 #include <iostream>
 
-#include <boost/numeric/odeint.hpp>
-#include <boost/numeric/odeint/stepper/implicit_euler.hpp>
+#include <boost/numeric/odeint/stepper/explicit_euler.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_explicit_euler.hpp>
+
 
 using namespace boost::numeric::odeint;
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_stepper_evolution.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_stepper_evolution.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_stepper_evolution.cpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -10,7 +10,9 @@
 #include <iostream>
 #include <tr1/array>
 
-#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_explicit_euler.hpp>
+#include <boost/numeric/odeint/stepper/controlled_error_stepper.hpp>
 
 #define tab "\t"
 

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-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -16,7 +16,6 @@
 
 #include <boost/test/unit_test.hpp>
 
-#include <boost/numeric/odeint.hpp>
 #include <boost/numeric/odeint/stepper/implicit_euler.hpp>
 #include <boost/numeric/odeint/algebra/external/ublas_resize.hpp>
 

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-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -25,7 +25,8 @@
 #include <boost/mpl/int.hpp>
 #include <boost/mpl/at.hpp>
 
-#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/explicit_euler.hpp>
+#include <boost/numeric/odeint/stepper/explicit_rk4.hpp>
 #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
 
 using namespace boost::unit_test;

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-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -36,7 +36,11 @@
 #include <boost/mpl/placeholders.hpp>
 #include <boost/mpl/inserter.hpp>
 
-#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/explicit_euler.hpp>
+#include <boost/numeric/odeint/stepper/explicit_rk4.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/controlled_error_stepper.hpp>
 #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
 
 #include "vector_space_1d.hpp"

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_copying.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_copying.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_copying.cpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -9,8 +9,6 @@
 
 #include <boost/test/unit_test.hpp>
 
-#include <boost/numeric/odeint.hpp>
-
 BOOST_AUTO_TEST_SUITE( stepper_copying )
 
 BOOST_AUTO_TEST_CASE( explicit_euler_copying )

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-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -27,7 +27,11 @@
 #include <boost/fusion/container.hpp>
 #include <boost/mpl/vector.hpp>
 
-#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/explicit_euler.hpp>
+#include <boost/numeric/odeint/stepper/explicit_rk4.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp>
+#include <boost/numeric/odeint/stepper/explicit_error_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/controlled_error_stepper.hpp>
 #include <boost/numeric/odeint/algebra/fusion_algebra.hpp>
 
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/check_gmp.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/check_gmp.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gmp/check_gmp.cpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -17,7 +17,7 @@
 #include <boost/test/unit_test.hpp>
 #include <boost/array.hpp>
 
-#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/explicit_rk4.hpp>
 
 using namespace boost::unit_test;
 using namespace boost::numeric::odeint;

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/check_gsl.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/check_gsl.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/gsl/check_gsl.cpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -16,10 +16,7 @@
 
 #include <boost/test/unit_test.hpp>
 
-#include <boost/numeric/odeint.hpp>
-
 using namespace boost::unit_test;
-using namespace boost::numeric::odeint;
 
 
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/mkl/check_mkl.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/mkl/check_mkl.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/mkl/check_mkl.cpp 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -14,7 +14,7 @@
 
 #include <boost/test/unit_test.hpp>
 
-#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/explicit_euler.hpp>
 #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
 #include <boost/numeric/odeint/algebra/external/mkl_operations.hpp>
 

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/check_thrust.cu
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/check_thrust.cu (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test_external/thrust/check_thrust.cu 2011-01-27 10:05:56 EST (Thu, 27 Jan 2011)
@@ -12,7 +12,7 @@
 
 //#include <boost/test/unit_test.hpp>
 
-#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/explicit_euler.hpp>
 #include <boost/numeric/odeint/algebra/external/thrust_algebra.hpp>
 #include <boost/numeric/odeint/algebra/external/thrust_operations.hpp>
 #include <boost/numeric/odeint/algebra/external/thrust_resize.hpp>


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