From 90f6cedb9eae73fdf0c44c34874c7e67f39e02c2 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 7 Oct 2010 00:02:53 -0400 Subject: Add iteration count to Integrator. --- tests/Midpoint.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/Midpoint.cpp') diff --git a/tests/Midpoint.cpp b/tests/Midpoint.cpp index c16fb76..b544ed1 100644 --- a/tests/Midpoint.cpp +++ b/tests/Midpoint.cpp @@ -23,15 +23,16 @@ main() double expected = std::exp(2.0); std::cout << std::setprecision(10) - << "Numerical: " << actual << std::endl - << "Expected: " << expected << std::endl; + << "Numerical: " << actual << std::endl + << "Expected: " << expected << std::endl + << "iterations: " << integrator.iterations() << std::endl; double error = std::fabs(expected - actual)/expected; if (error > 1.4e-4) { - std::cerr << "Error: " << 100.0*error << "%" << std::endl; + std::cerr << "Error: " << 100.0*error << "%" << std::endl; return EXIT_FAILURE; } else { - std::cout << "Error: " << 100.0*error << "%" << std::endl; + std::cout << "Error: " << 100.0*error << "%" << std::endl; return EXIT_SUCCESS; } } -- cgit v1.2.3