Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68352 - in sandbox/odeint/branches/karsten/libs/numeric/odeint: regression_test test
From: karsten.ahnert_at_[hidden]
Date: 2011-01-21 11:56:08


Author: karsten
Date: 2011-01-21 11:56:06 EST (Fri, 21 Jan 2011)
New Revision: 68352
URL: http://svn.boost.org/trac/boost/changeset/68352

Log:
* resorganizing tests and regression tests
Added:
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_dopri5.cpp (contents, props changed)
      - copied, changed from r68351, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_dopri5.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_explicit_euler.cpp (contents, props changed)
      - copied, changed from r68351, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_explicit_euler.cpp
Removed:
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_dopri5.cpp
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_explicit_euler.cpp
Text files modified:
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_dopri5.cpp | 16 +---------------
   sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_explicit_euler.cpp | 13 +------------
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile | 2 --
   3 files changed, 2 insertions(+), 29 deletions(-)

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_dopri5.cpp (from r68351, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_dopri5.cpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_dopri5.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_dopri5.cpp 2011-01-21 11:56:06 EST (Fri, 21 Jan 2011)
@@ -5,18 +5,12 @@
  * Author: karsten
  */
 
-#define BOOST_TEST_MODULE odeint_dense_output_dopri5
-
 #include <tr1/array>
 #include <fstream>
 #include <iostream>
 
-#include <boost/test/unit_test.hpp>
-
 #include <boost/numeric/odeint.hpp>
-#include <boost/numeric/odeint/stepper/implicit_euler.hpp>
 
-using namespace boost::unit_test;
 using namespace boost::numeric::odeint;
 
 typedef double value_type;
@@ -35,9 +29,7 @@
 }
 
 
-BOOST_AUTO_TEST_SUITE( dense_output_dopri5_test )
-
-BOOST_AUTO_TEST_CASE( test_dopri5 )
+int main( int argc , char **argv )
 {
     using std::abs;
 
@@ -77,11 +69,5 @@
             }
             t += dt;
     }
-
-// // compare with analytic solution of above system
-// BOOST_CHECK_MESSAGE( abs( x(0) - 20.0/81.0 ) < eps , x(0) - 20.0/81.0 );
-// BOOST_CHECK_MESSAGE( abs( x(1) - 10.0/9.0 ) < eps , x(0) - 10.0/9.0 );
-
 }
 
-BOOST_AUTO_TEST_SUITE_END()

Copied: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_explicit_euler.cpp (from r68351, /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_explicit_euler.cpp)
==============================================================================
--- /sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_explicit_euler.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/dense_output_explicit_euler.cpp 2011-01-21 11:56:06 EST (Fri, 21 Jan 2011)
@@ -10,18 +10,14 @@
  copy at http://www.boost.org/LICENSE_1_0.txt)
 */
 
-#define BOOST_TEST_MODULE odeint_dense_output_explicit_euler
 
 #include <tr1/array>
 #include <fstream>
 #include <iostream>
 
-#include <boost/test/unit_test.hpp>
-
 #include <boost/numeric/odeint.hpp>
 #include <boost/numeric/odeint/stepper/implicit_euler.hpp>
 
-using namespace boost::unit_test;
 using namespace boost::numeric::odeint;
 
 typedef double value_type;
@@ -40,9 +36,7 @@
 }
 
 
-BOOST_AUTO_TEST_SUITE( dense_output_explicit_euler_test )
-
-BOOST_AUTO_TEST_CASE( test_euler )
+int main( int argc , char **argv )
 {
     using std::abs;
 
@@ -78,10 +72,5 @@
             t += dt;
     }
 
-// // compare with analytic solution of above system
-// BOOST_CHECK_MESSAGE( abs( x(0) - 20.0/81.0 ) < eps , x(0) - 20.0/81.0 );
-// BOOST_CHECK_MESSAGE( abs( x(1) - 10.0/9.0 ) < eps , x(0) - 10.0/9.0 );
-
 }
 
-BOOST_AUTO_TEST_SUITE_END()

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/Jamfile 2011-01-21 11:56:06 EST (Fri, 21 Jan 2011)
@@ -23,6 +23,4 @@
          [ run standard_operations.cpp ]
          [ run standard_algebra.cpp ]
          [ run implicit_euler.cpp ]
- [ run dense_output_explicit_euler.cpp ]
- [ run dense_output_dopri5.cpp ]
          ;

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_dopri5.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_dopri5.cpp 2011-01-21 11:56:06 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,87 +0,0 @@
-/*
- * check_dense_output_dopri5.cpp
- *
- * Created on: Nov 1, 2010
- * Author: karsten
- */
-
-#define BOOST_TEST_MODULE odeint_dense_output_dopri5
-
-#include <tr1/array>
-#include <fstream>
-#include <iostream>
-
-#include <boost/test/unit_test.hpp>
-
-#include <boost/numeric/odeint.hpp>
-#include <boost/numeric/odeint/stepper/implicit_euler.hpp>
-
-using namespace boost::unit_test;
-using namespace boost::numeric::odeint;
-
-typedef double value_type;
-typedef std::tr1::array< double , 2 > state_type;
-
-inline std::ostream& operator<<( std::ostream &out , const state_type &x )
-{
- out << x[0] << "\t" << x[1];
- return out;
-}
-
-inline void sys( const state_type &x , state_type &dxdt , const value_type t )
-{
- dxdt[0] = x[1];
- dxdt[1] = -x[0];
-}
-
-
-BOOST_AUTO_TEST_SUITE( dense_output_dopri5_test )
-
-BOOST_AUTO_TEST_CASE( test_dopri5 )
-{
- using std::abs;
-
- typedef explicit_error_dopri5< state_type > dopri5_type;
- typedef controlled_error_stepper< dopri5_type > controlled_stepper_type;
- dopri5_type dopri5;
- controlled_stepper_type controlled_stepper( dopri5 );
- dense_output_dopri5< controlled_stepper_type > stepper( controlled_stepper );
-
- state_type x0;
- x0[0] = 0.0;
- x0[1] = 1.0;
-
- stepper.initialize( x0 , 0.0 , 0.1 );
-// stepper.do_step( sys );
-
- std::ofstream stepper_out( "dopri5_stepper_states.dat" );
- std::ofstream states_out( "dopri5_states.dat" );
-
-
- double t = stepper.current_time();
- double t_end = 10.0;
- double dt = 0.02;
- state_type x;
- while( t < t_end )
- {
- if( t < stepper.current_time() )
- {
- stepper.calc_state( t , x );
- states_out << t << "\t" << x << std::endl;
- }
- else
- {
- stepper.do_step( sys );
- stepper_out << stepper.current_time() << "\t" << stepper.current_state() << std::endl;
- continue;
- }
- t += dt;
- }
-
-// // compare with analytic solution of above system
-// BOOST_CHECK_MESSAGE( abs( x(0) - 20.0/81.0 ) < eps , x(0) - 20.0/81.0 );
-// BOOST_CHECK_MESSAGE( abs( x(1) - 10.0/9.0 ) < eps , x(0) - 10.0/9.0 );
-
-}
-
-BOOST_AUTO_TEST_SUITE_END()

Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_explicit_euler.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/dense_output_explicit_euler.cpp 2011-01-21 11:56:06 EST (Fri, 21 Jan 2011)
+++ (empty file)
@@ -1,87 +0,0 @@
-/* Boost check_implicit_euler.cpp test file
-
- Copyright 2009 Karsten Ahnert
- Copyright 2009 Mario Mulansky
-
- This file tests the use of the euler stepper
-
- 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)
-*/
-
-#define BOOST_TEST_MODULE odeint_dense_output_explicit_euler
-
-#include <tr1/array>
-#include <fstream>
-#include <iostream>
-
-#include <boost/test/unit_test.hpp>
-
-#include <boost/numeric/odeint.hpp>
-#include <boost/numeric/odeint/stepper/implicit_euler.hpp>
-
-using namespace boost::unit_test;
-using namespace boost::numeric::odeint;
-
-typedef double value_type;
-typedef std::tr1::array< double , 2 > state_type;
-
-inline std::ostream& operator<<( std::ostream &out , const state_type &x )
-{
- out << x[0] << "\t" << x[1];
- return out;
-}
-
-inline void sys( const state_type &x , state_type &dxdt , const value_type t )
-{
- dxdt[0] = x[1];
- dxdt[1] = -x[0];
-}
-
-
-BOOST_AUTO_TEST_SUITE( dense_output_explicit_euler_test )
-
-BOOST_AUTO_TEST_CASE( test_euler )
-{
- using std::abs;
-
- dense_output_explicit_euler< state_type > stepper;
- state_type x0;
- x0[0] = 0.0;
- x0[1] = 1.0;
-
- stepper.initialize( x0 , 0.0 , 0.1 );
-// stepper.do_step( sys );
-
- std::ofstream stepper_out( "stepper_states.dat" );
- std::ofstream states_out( "states.dat" );
-
-
- double t = stepper.current_time();
- double t_end = 10.0;
- double dt = 0.02;
- state_type x;
- while( t < t_end )
- {
- if( t < stepper.current_time() )
- {
- stepper.calc_state( t , x );
- states_out << t << "\t" << x << std::endl;
- }
- else
- {
- stepper.do_step( sys );
- stepper_out << stepper.current_time() << "\t" << stepper.current_state() << std::endl;
- continue;
- }
- t += dt;
- }
-
-// // compare with analytic solution of above system
-// BOOST_CHECK_MESSAGE( abs( x(0) - 20.0/81.0 ) < eps , x(0) - 20.0/81.0 );
-// BOOST_CHECK_MESSAGE( abs( x(1) - 10.0/9.0 ) < eps , x(0) - 10.0/9.0 );
-
-}
-
-BOOST_AUTO_TEST_SUITE_END()


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