From f36933666dea83c91fbad94ac1851996872ed5ae Mon Sep 17 00:00:00 2001 From: Jonathan Sweemer Date: Thu, 21 Sep 2023 21:06:49 +0900 Subject: [PATCH] Pass through max evaluations to the solver --- ql/termstructures/iterativebootstrap.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ql/termstructures/iterativebootstrap.hpp b/ql/termstructures/iterativebootstrap.hpp index 7fac2eebadf..e9eb005c08a 100644 --- a/ql/termstructures/iterativebootstrap.hpp +++ b/ql/termstructures/iterativebootstrap.hpp @@ -99,7 +99,8 @@ namespace detail { Real maxFactor = 2.0, Real minFactor = 2.0, bool dontThrow = false, - Size dontThrowSteps = 10); + Size dontThrowSteps = 10, + Size maxEvaluations = MAX_FUNCTION_EVALUATIONS); void setup(Curve* ts); void calculate() const; private: @@ -132,12 +133,15 @@ namespace detail { Real maxFactor, Real minFactor, bool dontThrow, - Size dontThrowSteps) + Size dontThrowSteps, + Size maxEvaluations) : accuracy_(accuracy), minValue_(minValue), maxValue_(maxValue), maxAttempts_(maxAttempts), maxFactor_(maxFactor), minFactor_(minFactor), dontThrow_(dontThrow), dontThrowSteps_(dontThrowSteps), ts_(nullptr), loopRequired_(Interpolator::global) { QL_REQUIRE(maxFactor_ >= 1.0, "Expected that maxFactor would be at least 1.0 but got " << maxFactor_); QL_REQUIRE(minFactor_ >= 1.0, "Expected that minFactor would be at least 1.0 but got " << minFactor_); + firstSolver_.setMaxEvaluations(maxEvaluations); + solver_.setMaxEvaluations(maxEvaluations); } template