summaryrefslogtreecommitdiffstats
path: root/src/vZ/Adaptive.hpp
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-10-06 23:00:58 -0400
committerTavian Barnes <tavianator@gmail.com>2010-10-06 23:00:58 -0400
commit486a188b074c0c4f3ad771f536159e1bd2045fe2 (patch)
tree490bf76b27b404cfd65ed3380ec4c57d1b10ffc7 /src/vZ/Adaptive.hpp
parent25cc2bf981d52f0c7688b1e380b795f0cda8a852 (diff)
downloadvz-486a188b074c0c4f3ad771f536159e1bd2045fe2.tar.xz
Add Bogacki-Shampine method.
Diffstat (limited to 'src/vZ/Adaptive.hpp')
-rw-r--r--src/vZ/Adaptive.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vZ/Adaptive.hpp b/src/vZ/Adaptive.hpp
index 74de0db..256bda6 100644
--- a/src/vZ/Adaptive.hpp
+++ b/src/vZ/Adaptive.hpp
@@ -41,6 +41,8 @@ namespace vZ
Scalar atol() const { return m_atol; }
Scalar rtol() const { return m_rtol; }
+ unsigned int rejections() const { return m_rejections; }
+
protected:
typedef typename GenericRKIntegrator<Y>::ACoefficients ACoefficients;
typedef typename GenericRKIntegrator<Y>::BCoefficients BCoefficients;
@@ -49,7 +51,7 @@ namespace vZ
GenericAdaptiveIntegrator(Function f, unsigned int order,
ACoefficients a, BCoefficients b,
BCoefficients bStar)
- : GenericRKIntegrator<Y>(f), m_order(order),
+ : GenericRKIntegrator<Y>(f), m_order(order), m_rejections(0),
m_a(a), m_b(b), m_bStar(bStar)
{ }
virtual ~GenericAdaptiveIntegrator() { }
@@ -59,6 +61,7 @@ namespace vZ
private:
Scalar m_atol, m_rtol;
unsigned int m_order;
+ unsigned int m_rejections;
ACoefficients m_a;
BCoefficients m_b, m_bStar;
};
@@ -94,6 +97,7 @@ namespace vZ
if (delta > scale) {
// Reject the step
this->h(newH);
+ ++m_rejections;
} else {
rejected = false;
}