Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65681 - sandbox/odeint/branches/karsten/libs/numeric/odeint/test
From: mario.mulansky_at_[hidden]
Date: 2010-09-29 13:39:16


Author: mariomulansky
Date: 2010-09-29 13:39:09 EDT (Wed, 29 Sep 2010)
New Revision: 65681
URL: http://svn.boost.org/trac/boost/changeset/65681

Log:
fixed bug in check_implicit_euler
Text files modified:
   sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_implicit_euler.cpp | 8 ++++++--
   1 files changed, 6 insertions(+), 2 deletions(-)

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_implicit_euler.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_implicit_euler.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/check_implicit_euler.cpp 2010-09-29 13:39:09 EDT (Wed, 29 Sep 2010)
@@ -38,7 +38,7 @@
     jacobi( 0 , 0 ) = 1;
     jacobi( 0 , 1 ) = 2;
     jacobi( 1 , 0 ) = 0;
- jacobi( 1 , 1 ) = 3;
+ jacobi( 1 , 1 ) = 1;
 }
 
 BOOST_AUTO_TEST_SUITE( implicit_euler_test )
@@ -53,7 +53,11 @@
 
     stepper.do_step( sys , jacobi , x , 0.0 , 0.1 );
 
- BOOST_CHECK_MESSAGE( abs( x(0) - 0.1 ) < eps , x[0] - 0.1 );
+ using std::abs;
+
+ // 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-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