From be5d2713fa4440176a589047beee05a544c513cf Mon Sep 17 00:00:00 2001 From: Eugene Toder Date: Mon, 26 Jun 2023 15:31:25 -0400 Subject: [PATCH] Add missing includes and reference --- QuantExt/qle/cashflows/averageonindexedcoupon.cpp | 1 + QuantExt/qle/cashflows/overnightindexedcoupon.cpp | 1 + QuantExt/qle/math/computeenvironment.hpp | 1 + QuantExt/qle/math/openclenvironment.hpp | 2 ++ QuantExt/qle/math/randomvariable_opcodes.hpp | 3 +++ .../numericalintegrationindexcdsoptionengine.cpp | 6 +++--- 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/QuantExt/qle/cashflows/averageonindexedcoupon.cpp b/QuantExt/qle/cashflows/averageonindexedcoupon.cpp index 0bcea19146..e7d20d17d0 100644 --- a/QuantExt/qle/cashflows/averageonindexedcoupon.cpp +++ b/QuantExt/qle/cashflows/averageonindexedcoupon.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include using namespace QuantLib; diff --git a/QuantExt/qle/cashflows/overnightindexedcoupon.cpp b/QuantExt/qle/cashflows/overnightindexedcoupon.cpp index ee6e14d601..e8343042f4 100644 --- a/QuantExt/qle/cashflows/overnightindexedcoupon.cpp +++ b/QuantExt/qle/cashflows/overnightindexedcoupon.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include using std::vector; diff --git a/QuantExt/qle/math/computeenvironment.hpp b/QuantExt/qle/math/computeenvironment.hpp index 1c44deeded..91ba63682d 100644 --- a/QuantExt/qle/math/computeenvironment.hpp +++ b/QuantExt/qle/math/computeenvironment.hpp @@ -24,6 +24,7 @@ #include +#include #include namespace QuantExt { diff --git a/QuantExt/qle/math/openclenvironment.hpp b/QuantExt/qle/math/openclenvironment.hpp index f1c3fcf265..82986dd1b4 100644 --- a/QuantExt/qle/math/openclenvironment.hpp +++ b/QuantExt/qle/math/openclenvironment.hpp @@ -24,6 +24,8 @@ #include +#include + namespace QuantExt { class OpenClFramework : public ComputeFramework { diff --git a/QuantExt/qle/math/randomvariable_opcodes.hpp b/QuantExt/qle/math/randomvariable_opcodes.hpp index ba3351f122..45208f2727 100644 --- a/QuantExt/qle/math/randomvariable_opcodes.hpp +++ b/QuantExt/qle/math/randomvariable_opcodes.hpp @@ -18,6 +18,9 @@ #pragma once +#include +#include + namespace QuantExt { struct RandomVariableOpCode { diff --git a/QuantExt/qle/pricingengines/numericalintegrationindexcdsoptionengine.cpp b/QuantExt/qle/pricingengines/numericalintegrationindexcdsoptionengine.cpp index 7749889e45..4bccce364e 100644 --- a/QuantExt/qle/pricingengines/numericalintegrationindexcdsoptionengine.cpp +++ b/QuantExt/qle/pricingengines/numericalintegrationindexcdsoptionengine.cpp @@ -227,7 +227,7 @@ void NumericalIntegrationIndexCdsOptionEngine::doCalc() const { brent.setLowerBound(1.0E-8); try { fepAdjustedForwardSpread = brent.solve(target, 1.0E-7, arguments_.swap->fairSpreadClean(), 0.0001); - } catch (const std::exception e) { + } catch (const std::exception& e) { QL_FAIL( "NumericalIntegrationIndexCdsOptionEngine::doCalc(): failed to calibrate forward spread: " << e.what()); } @@ -248,7 +248,7 @@ void NumericalIntegrationIndexCdsOptionEngine::doCalc() const { Brent brent2; try { exerciseBoundary = brent2.solve(payoff, 1.0E-7, 0.0, 0.0001); - } catch (const std::exception e) { + } catch (const std::exception& e) { QL_FAIL( "NumericalIntegrationIndexCdsOptionEngine::doCalc(): failed to find exercise boundary: " << e.what()); } @@ -276,7 +276,7 @@ void NumericalIntegrationIndexCdsOptionEngine::doCalc() const { std::exp(-0.5 * x * x) / boost::math::constants::root_two_pi(); }, lowerIntegrationBound, upperIntegrationBound); - } catch (const std::exception e) { + } catch (const std::exception& e) { QL_FAIL( "NumericalIntegrationIndexCdsOptionEngine::doCalc(): failed to compute option payoff: " << e.what()); }