diff options
-rw-r--r-- | src/vZ/Adaptive.hpp | 2 | ||||
-rw-r--r-- | tests/HE12.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/vZ/Adaptive.hpp b/src/vZ/Adaptive.hpp index 864b038..74de0db 100644 --- a/src/vZ/Adaptive.hpp +++ b/src/vZ/Adaptive.hpp @@ -33,6 +33,8 @@ namespace vZ typedef typename GenericRKIntegrator<Y>::Scalar Scalar; typedef typename GenericRKIntegrator<Y>::Function Function; + GenericAdaptiveIntegrator& tol(Scalar tol) + { m_atol = tol; m_rtol = tol; return *this; } GenericAdaptiveIntegrator& atol(Scalar tol) { m_atol = tol; return *this; } GenericAdaptiveIntegrator& rtol(Scalar tol) { m_rtol = tol; return *this; } diff --git a/tests/HE12.cpp b/tests/HE12.cpp index 9a556ef..44d6943 100644 --- a/tests/HE12.cpp +++ b/tests/HE12.cpp @@ -14,9 +14,8 @@ f(double t, double y) int main() { - double tol = 1e-6; vZ::HE12Integrator integrator(f); - integrator.atol(tol).rtol(tol).y(1.0).x(0.0).h(0.02); + integrator.tol(1e-6).y(1.0).x(0.0).h(0.02); integrator.integrate(2.0); |