summaryrefslogtreecommitdiffstats
path: root/tests/RK4.cpp
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-10-07 00:02:53 -0400
committerTavian Barnes <tavianator@gmail.com>2010-10-07 00:02:53 -0400
commit90f6cedb9eae73fdf0c44c34874c7e67f39e02c2 (patch)
treea4fc804d92981da2d8e4354093e0b6df99cc3ed5 /tests/RK4.cpp
parent2b438504e0fc68ea8224e88675247e555ee6a6e6 (diff)
downloadvz-90f6cedb9eae73fdf0c44c34874c7e67f39e02c2.tar.xz
Add iteration count to Integrator.
Diffstat (limited to 'tests/RK4.cpp')
-rw-r--r--tests/RK4.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/RK4.cpp b/tests/RK4.cpp
index 2090a1e..4b667d4 100644
--- a/tests/RK4.cpp
+++ b/tests/RK4.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 > 4.2e-8) {
- 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;
}
}