From 5f71f467e4500fd09187f6ead53babc1c69e2627 Mon Sep 17 00:00:00 2001 From: Dmitri Goloubentsev Date: Mon, 22 Apr 2024 12:15:11 +0100 Subject: [PATCH] Compilation fixes --- .../commodities/commoditycurve.hpp | 12 ++++++++ ql/experimental/credit/defaultevent.hpp | 4 +-- .../finitedifferences/fdmvppstepcondition.hpp | 15 +++++----- ql/experimental/math/latentmodel.hpp | 8 +++--- .../zabrinterpolatedsmilesection.hpp | 6 ++++ ql/models/equity/hestonslvfdmmodel.hpp | 28 +++++++++---------- 6 files changed, 46 insertions(+), 27 deletions(-) diff --git a/ql/experimental/commodities/commoditycurve.hpp b/ql/experimental/commodities/commoditycurve.hpp index 5416cc5343e..3d9b4607170 100644 --- a/ql/experimental/commodities/commoditycurve.hpp +++ b/ql/experimental/commodities/commoditycurve.hpp @@ -111,6 +111,18 @@ namespace QuantLib { return c1.name() == c2.name(); } + inline const CommodityType& CommodityCurve::commodityType() const { + return commodityType_; + } + + inline const UnitOfMeasure& CommodityCurve::unitOfMeasure() const { + return unitOfMeasure_; + } + + inline const Currency& CommodityCurve::currency() const { + return currency_; + } + inline const std::string& CommodityCurve::name() const { return name_; } diff --git a/ql/experimental/credit/defaultevent.hpp b/ql/experimental/credit/defaultevent.hpp index c1fa62ee8eb..8b907609394 100644 --- a/ql/experimental/credit/defaultevent.hpp +++ b/ql/experimental/credit/defaultevent.hpp @@ -107,8 +107,8 @@ namespace QuantLib { Currency curr, Seniority bondsSen, // Settlement information: - const Date& settleDate = Null(), - Real recoveryRate = 0.4); + const Date& settleDate, + Real recoveryRate); Date date() const override; bool isRestructuring() const { return eventType_.isRestructuring(); } diff --git a/ql/experimental/finitedifferences/fdmvppstepcondition.hpp b/ql/experimental/finitedifferences/fdmvppstepcondition.hpp index a3c6b5eeae0..590504a2ec0 100644 --- a/ql/experimental/finitedifferences/fdmvppstepcondition.hpp +++ b/ql/experimental/finitedifferences/fdmvppstepcondition.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include namespace QuantLib { @@ -35,16 +36,16 @@ namespace QuantLib { class FdmInnerValueCalculator; struct FdmVPPStepConditionParams { - const Real heatRate; - const Real pMin; const Real pMax; - const Size tMinUp; const Size tMinDown; - const Real startUpFuel; const Real startUpFixCost; - const Real fuelCostAddon; + Real heatRate; + Real pMin; Real pMax; + Size tMinUp; Size tMinDown; + Real startUpFuel; Real startUpFixCost; + Real fuelCostAddon; }; struct FdmVPPStepConditionMesher { - const Size stateDirection; - const ext::shared_ptr mesher; + Size stateDirection; + ext::shared_ptr mesher; }; class FdmVPPStepCondition : public StepCondition { diff --git a/ql/experimental/math/latentmodel.hpp b/ql/experimental/math/latentmodel.hpp index ffcf4224b95..2098fa73e7a 100644 --- a/ql/experimental/math/latentmodel.hpp +++ b/ql/experimental/math/latentmodel.hpp @@ -512,7 +512,7 @@ namespace QuantLib { explicit LatentModel( const std::vector >& factorsWeights, const typename copulaType::initTraits& ini = - copulaType::initTraits()); + typename copulaType::initTraits()); /*! Constructs a LM with an arbitrary number of latent variables depending only on one random factor but contributing to each latent variable through different weights. @@ -524,7 +524,7 @@ namespace QuantLib { */ explicit LatentModel(const std::vector& factorsWeight, const typename copulaType::initTraits& ini = - copulaType::initTraits()); + typename copulaType::initTraits()); /*! Constructs a LM with an arbitrary number of latent variables depending only on one random factor with the same weight for all latent variables. @@ -538,7 +538,7 @@ namespace QuantLib { */ explicit LatentModel(Real correlSqr, Size nVariables, - const typename copulaType::initTraits& ini = copulaType::initTraits()); + const typename copulaType::initTraits& ini = typename copulaType::initTraits()); /*! Constructs a LM with an arbitrary number of latent variables depending only on one random factor with the same weight for all latent variables. The weight is observed and this constructor is @@ -554,7 +554,7 @@ namespace QuantLib { explicit LatentModel(const Handle& singleFactorCorrel, Size nVariables, const typename copulaType::initTraits& ini = - copulaType::initTraits()); + typename copulaType::initTraits()); //! Provides values of the factors \f$ a_{i,k} \f$ const std::vector >& factorWeights() const { diff --git a/ql/experimental/volatility/zabrinterpolatedsmilesection.hpp b/ql/experimental/volatility/zabrinterpolatedsmilesection.hpp index fcfbbfae2bb..3c415fea5c9 100644 --- a/ql/experimental/volatility/zabrinterpolatedsmilesection.hpp +++ b/ql/experimental/volatility/zabrinterpolatedsmilesection.hpp @@ -171,6 +171,12 @@ inline Real ZabrInterpolatedSmileSection::rho() const { return zabrInterpolation_->rho(); } +template +inline Real ZabrInterpolatedSmileSection::gamma() const { + calculate(); + return zabrInterpolation_->gamma(); +} + template inline Real ZabrInterpolatedSmileSection::rmsError() const { calculate(); diff --git a/ql/models/equity/hestonslvfdmmodel.hpp b/ql/models/equity/hestonslvfdmmodel.hpp index 284b3961ff4..c1476f7291f 100644 --- a/ql/models/equity/hestonslvfdmmodel.hpp +++ b/ql/models/equity/hestonslvfdmmodel.hpp @@ -41,33 +41,33 @@ class SimpleQuote; class LocalVolTermStructure; struct HestonSLVFokkerPlanckFdmParams { - const Size xGrid, vGrid; - const Size tMaxStepsPerYear, tMinStepsPerYear; - const Real tStepNumberDecay; + Size xGrid, vGrid; + Size tMaxStepsPerYear, tMinStepsPerYear; + Real tStepNumberDecay; // Rannacher smoothing steps at the beginning - const Size nRannacherTimeSteps; + Size nRannacherTimeSteps; - const Size predictionCorretionSteps; + Size predictionCorretionSteps; // local volatility forward equation - const Real x0Density; - const Real localVolEpsProb; - const Size maxIntegrationIterations; + Real x0Density; + Real localVolEpsProb; + Size maxIntegrationIterations; // variance mesher definition - const Real vLowerEps, vUpperEps, vMin; - const Real v0Density, vLowerBoundDensity, vUpperBoundDensity; + Real vLowerEps, vUpperEps, vMin; + Real v0Density, vLowerBoundDensity, vUpperBoundDensity; // do not calculate leverage function if prob is smaller than eps - const Real leverageFctPropEps; + Real leverageFctPropEps; // algorithm to get to the start configuration at time point one - const FdmHestonGreensFct::Algorithm greensAlgorithm; - const FdmSquareRootFwdOp::TransformationType trafoType; + FdmHestonGreensFct::Algorithm greensAlgorithm; + FdmSquareRootFwdOp::TransformationType trafoType; // define finite difference scheme - const FdmSchemeDesc schemeDesc; + FdmSchemeDesc schemeDesc; }; class HestonSLVFDMModel : public LazyObject {