diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index a348aad9c3f..7aff9ea4fd6 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -6,7 +6,7 @@ on: pull_request: jobs: coverage: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Setup @@ -22,7 +22,7 @@ jobs: - name: Capture baseline run: | mkdir -p coverage tmp - lcov --no-external --capture --ignore-errors mismatch --initial --directory . --output-file ./tmp/lcov_base.info + lcov --no-external --capture --initial --directory . --output-file ./tmp/lcov_base.info - name: Run tests run: | ./test-suite/quantlib-test-suite --log_level=message @@ -31,7 +31,7 @@ jobs: make -C Examples check-examples - name: Capture coverage run: | - lcov --no-external --capture --ignore-errors mismatch --directory . --output-file ./tmp/lcov_run.info + lcov --no-external --capture --directory . --output-file ./tmp/lcov_run.info lcov --add-tracefile ./tmp/lcov_base.info --add-tracefile ./tmp/lcov_run.info --output-file ./tmp/lcov_total.info lcov --remove ./tmp/lcov_total.info "$PWD/Examples/*" "$PWD/test-suite/*" --output-file ./coverage/lcov.info - name: Upload coverage to Coveralls diff --git a/.github/workflows/devenv-images.yml b/.github/workflows/devenv-images.yml index f2fb566da40..c1eb19ec231 100644 --- a/.github/workflows/devenv-images.yml +++ b/.github/workflows/devenv-images.yml @@ -6,7 +6,7 @@ on: description: 'Boost version' required: true env: - ROLLING: noble + ROLLING: oracular jobs: docker-images: runs-on: ubuntu-latest diff --git a/.github/workflows/macos-nondefault.yml b/.github/workflows/macos-nondefault.yml index 2b4f1d9a81d..7a9286516c9 100644 --- a/.github/workflows/macos-nondefault.yml +++ b/.github/workflows/macos-nondefault.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-12, macos-13, macos-14] + os: [macos-13, macos-14] classes: [boost, std] include: - classes: std diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index fa61ac1d010..a034797d727 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -6,7 +6,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-12, macos-13, macos-14] + os: [macos-13, macos-14] steps: - uses: actions/checkout@v4 - name: Setup diff --git a/LICENSE.TXT b/LICENSE.TXT index e4a21ec6a40..382b42300cd 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -169,6 +169,7 @@ QuantLib is Copyright (C) 2023 Paul Xi Cao Copyright (C) 2024 Jacques du Toit + Copyright (C) 2024 Jongbong An QuantLib includes code taken from Peter Jäckel's book "Monte Carlo Methods in Finance". diff --git a/QuantLib.vcxproj b/QuantLib.vcxproj index 693c8ffd603..b11f40de9d9 100644 --- a/QuantLib.vcxproj +++ b/QuantLib.vcxproj @@ -664,32 +664,23 @@ - - - - - - - - - @@ -792,7 +783,6 @@ - @@ -849,6 +839,7 @@ + @@ -1222,7 +1213,6 @@ - @@ -1234,7 +1224,6 @@ - @@ -1359,7 +1348,6 @@ - @@ -1608,14 +1596,11 @@ - - - @@ -2138,6 +2123,7 @@ + @@ -2330,7 +2316,6 @@ - @@ -2650,7 +2635,6 @@ - diff --git a/QuantLib.vcxproj.filters b/QuantLib.vcxproj.filters index aa93c147263..1aa50931d2d 100644 --- a/QuantLib.vcxproj.filters +++ b/QuantLib.vcxproj.filters @@ -450,12 +450,6 @@ methods\finitedifferences - - methods\finitedifferences - - - methods\finitedifferences - methods\finitedifferences @@ -672,6 +666,9 @@ indexes\ibor + + indexes\ibor + indexes\ibor @@ -1485,9 +1482,6 @@ models\marketmodels - - models\marketmodels - models\marketmodels @@ -2535,18 +2529,9 @@ pricingengines\vanilla - - pricingengines\vanilla - - - pricingengines\vanilla - pricingengines\vanilla - - pricingengines\vanilla - pricingengines\vanilla @@ -3135,15 +3120,6 @@ experimental\exoticoptions - - experimental\exoticoptions - - - experimental\exoticoptions - - - experimental\exoticoptions - experimental\exoticoptions @@ -3159,9 +3135,6 @@ pricingengines\barrier - - experimental\exoticoptions - experimental\exoticoptions @@ -3171,9 +3144,6 @@ experimental\exoticoptions - - experimental\exoticoptions - experimental\exoticoptions @@ -3192,9 +3162,6 @@ experimental\exoticoptions - - experimental\exoticoptions - experimental\exoticoptions @@ -3210,9 +3177,6 @@ experimental\exoticoptions - - experimental\exoticoptions - experimental\exoticoptions @@ -3489,9 +3453,6 @@ experimental\termstructures - - experimental\termstructures - experimental\varianceoption @@ -3642,12 +3603,6 @@ experimental\barrieroption - - experimental\exoticoptions - - - experimental\exoticoptions - experimental\inflation @@ -4616,6 +4571,9 @@ indexes\ibor + + indexes\ibor + indexes\ibor @@ -4865,9 +4823,6 @@ math - - math - math\statistics @@ -5795,9 +5750,6 @@ pricingengines\vanilla - - pricingengines\vanilla - pricingengines\vanilla diff --git a/cmake/GenerateHeaders.cmake b/cmake/GenerateHeaders.cmake index e993b62956c..a1eecb5fb47 100644 --- a/cmake/GenerateHeaders.cmake +++ b/cmake/GenerateHeaders.cmake @@ -38,30 +38,15 @@ function(generate_dir_headers source_dir binary_dir) file(GLOB children_hpp RELATIVE ${source_dir} "${source_dir}/*.hpp") list(FILTER children_hpp EXCLUDE REGEX "all.hpp") - # These headers were moved to another location. - # Therefore, we can ignore them as they only contain a warning and the new includes. - if (${source_dir} MATCHES "experimental" AND ${source_dir} MATCHES "exoticoptions") - list(FILTER children_hpp EXCLUDE REGEX "margrabeoption.hpp") - list(FILTER children_hpp EXCLUDE REGEX "analyticamericanmargrabeengine.hpp") - list(FILTER children_hpp EXCLUDE REGEX "analyticeuropeanmargrabeengine.hpp") - list(FILTER children_hpp EXCLUDE REGEX "compoundoption.hpp") - list(FILTER children_hpp EXCLUDE REGEX "analyticcompoundoptionengine.hpp") - list(FILTER children_hpp EXCLUDE REGEX "simplechooseroption.hpp") - list(FILTER children_hpp EXCLUDE REGEX "analyticsimplechooserengine.hpp") - list(FILTER children_hpp EXCLUDE REGEX "complexchooseroption.hpp") - list(FILTER children_hpp EXCLUDE REGEX "analyticcomplexchooserengine.hpp") - endif () - - list(FILTER children_hpp EXCLUDE REGEX "multicurvesensitivities.hpp") - list(FILTER children_hpp EXCLUDE REGEX "shoutcondition.hpp") - list(FILTER children_hpp EXCLUDE REGEX "fdcondition.hpp") - list(FILTER children_hpp EXCLUDE REGEX "pdeshortrate.hpp") - list(FILTER children_hpp EXCLUDE REGEX "fddividendengine.hpp") - list(FILTER children_hpp EXCLUDE REGEX "fdstepconditionengine.hpp") - list(FILTER children_hpp EXCLUDE REGEX "duffsdeviceinnerproduct.hpp") list(FILTER children_hpp EXCLUDE REGEX "dividendvanillaoption.hpp") list(FILTER children_hpp EXCLUDE REGEX "averageoiscouponpricer.hpp") list(FILTER children_hpp EXCLUDE REGEX "subperiodcoupon.hpp") + list(FILTER children_hpp EXCLUDE REGEX "fdmultiperiodengine.hpp") + list(FILTER children_hpp EXCLUDE REGEX "fdvanillaengine.hpp") + list(FILTER children_hpp EXCLUDE REGEX "sampledcurve.hpp") + list(FILTER children_hpp EXCLUDE REGEX "bsmtermoperator.hpp") + list(FILTER children_hpp EXCLUDE REGEX "fdtypedefs.hpp") + list(FILTER children_hpp EXCLUDE REGEX "parallelevolver.hpp") file(GLOB children_dir RELATIVE ${source_dir} "${source_dir}/*") list(FILTER children_dir EXCLUDE REGEX "CMakeFiles") diff --git a/ql/CMakeLists.txt b/ql/CMakeLists.txt index 283124b6a89..3e409c1be57 100644 --- a/ql/CMakeLists.txt +++ b/ql/CMakeLists.txt @@ -235,6 +235,7 @@ set(QL_SOURCES indexes/ibor/euribor.cpp indexes/ibor/eurlibor.cpp indexes/ibor/fedfunds.cpp + indexes/ibor/kofr.cpp indexes/ibor/libor.cpp indexes/ibor/shibor.cpp indexes/ibor/sofr.cpp @@ -429,7 +430,6 @@ set(QL_SOURCES math/randomnumbers/xoshiro256starstaruniformrng.cpp math/richardsonextrapolation.cpp math/rounding.cpp - math/sampledcurve.cpp math/statistics/discrepancystatistics.cpp math/statistics/generalstatistics.cpp math/statistics/histogram.cpp @@ -752,7 +752,6 @@ set(QL_SOURCES pricingengines/vanilla/fdhestonvanillaengine.cpp pricingengines/vanilla/fdsabrvanillaengine.cpp pricingengines/vanilla/fdsimplebsswingengine.cpp - pricingengines/vanilla/fdvanillaengine.cpp pricingengines/vanilla/hestonexpansionengine.cpp pricingengines/vanilla/integralengine.cpp pricingengines/vanilla/jumpdiffusionengine.cpp @@ -1091,32 +1090,23 @@ set(QL_HEADERS experimental/credit/spotlosslatentmodel.hpp experimental/credit/spreadedhazardratecurve.hpp experimental/credit/syntheticcdo.hpp - experimental/exoticoptions/analyticamericanmargrabeengine.hpp - experimental/exoticoptions/analyticcomplexchooserengine.hpp - experimental/exoticoptions/analyticcompoundoptionengine.hpp - experimental/exoticoptions/analyticeuropeanmargrabeengine.hpp experimental/exoticoptions/analyticholderextensibleoptionengine.hpp experimental/exoticoptions/analyticpartialtimebarrieroptionengine.hpp experimental/exoticoptions/analyticpdfhestonengine.hpp - experimental/exoticoptions/analyticsimplechooserengine.hpp experimental/exoticoptions/analytictwoassetbarrierengine.hpp experimental/exoticoptions/analytictwoassetcorrelationengine.hpp experimental/exoticoptions/analyticwriterextensibleoptionengine.hpp - experimental/exoticoptions/complexchooseroption.hpp - experimental/exoticoptions/compoundoption.hpp experimental/exoticoptions/continuousarithmeticasianlevyengine.hpp experimental/exoticoptions/continuousarithmeticasianvecerengine.hpp experimental/exoticoptions/everestoption.hpp experimental/exoticoptions/himalayaoption.hpp experimental/exoticoptions/holderextensibleoption.hpp experimental/exoticoptions/kirkspreadoptionengine.hpp - experimental/exoticoptions/margrabeoption.hpp experimental/exoticoptions/mceverestengine.hpp experimental/exoticoptions/mchimalayaengine.hpp experimental/exoticoptions/mcpagodaengine.hpp experimental/exoticoptions/pagodaoption.hpp experimental/exoticoptions/partialtimebarrieroption.hpp - experimental/exoticoptions/simplechooseroption.hpp experimental/exoticoptions/spreadoption.hpp experimental/exoticoptions/twoassetbarrieroption.hpp experimental/exoticoptions/twoassetcorrelationoption.hpp @@ -1206,7 +1196,6 @@ set(QL_HEADERS experimental/swaptions/irregularswaption.hpp experimental/termstructures/basisswapratehelpers.hpp experimental/termstructures/crosscurrencyratehelpers.hpp - experimental/termstructures/multicurvesensitivities.hpp experimental/variancegamma/analyticvariancegammaengine.hpp experimental/variancegamma/fftengine.hpp experimental/variancegamma/fftvanillaengine.hpp @@ -1262,6 +1251,7 @@ set(QL_HEADERS indexes/ibor/gbplibor.hpp indexes/ibor/jibar.hpp indexes/ibor/jpylibor.hpp + indexes/ibor/kofr.hpp indexes/ibor/libor.hpp indexes/ibor/mosprime.hpp indexes/ibor/nzdlibor.hpp @@ -1617,7 +1607,6 @@ set(QL_HEADERS methods/finitedifferences/parallelevolver.hpp methods/finitedifferences/pde.hpp methods/finitedifferences/pdebsm.hpp - methods/finitedifferences/pdeshortrate.hpp methods/finitedifferences/schemes/boundaryconditionschemehelper.hpp methods/finitedifferences/schemes/craigsneydscheme.hpp methods/finitedifferences/schemes/cranknicolsonscheme.hpp @@ -1628,7 +1617,6 @@ set(QL_HEADERS methods/finitedifferences/schemes/methodoflinesscheme.hpp methods/finitedifferences/schemes/modifiedcraigsneydscheme.hpp methods/finitedifferences/schemes/trbdf2scheme.hpp - methods/finitedifferences/shoutcondition.hpp methods/finitedifferences/solvers/fdm1dimsolver.hpp methods/finitedifferences/solvers/fdm2dblackscholessolver.hpp methods/finitedifferences/solvers/fdm2dimsolver.hpp @@ -1740,7 +1728,6 @@ set(QL_HEADERS models/marketmodels/driftcomputation/lmmdriftcalculator.hpp models/marketmodels/driftcomputation/lmmnormaldriftcalculator.hpp models/marketmodels/driftcomputation/smmdriftcalculator.hpp - models/marketmodels/duffsdeviceinnerproduct.hpp models/marketmodels/evolutiondescription.hpp models/marketmodels/evolver.hpp models/marketmodels/evolvers/lognormalcmswapratepc.hpp @@ -1967,14 +1954,11 @@ set(QL_HEADERS pricingengines/vanilla/fdblackscholesshoutengine.hpp pricingengines/vanilla/fdcirvanillaengine.hpp pricingengines/vanilla/fdcevvanillaengine.hpp - pricingengines/vanilla/fdconditions.hpp - pricingengines/vanilla/fddividendengine.hpp pricingengines/vanilla/fdhestonhullwhitevanillaengine.hpp pricingengines/vanilla/fdhestonvanillaengine.hpp pricingengines/vanilla/fdmultiperiodengine.hpp pricingengines/vanilla/fdsabrvanillaengine.hpp pricingengines/vanilla/fdsimplebsswingengine.hpp - pricingengines/vanilla/fdstepconditionengine.hpp pricingengines/vanilla/fdvanillaengine.hpp pricingengines/vanilla/hestonexpansionengine.hpp pricingengines/vanilla/integralengine.hpp diff --git a/ql/cashflows/digitalcmscoupon.cpp b/ql/cashflows/digitalcmscoupon.cpp index 5225357c81f..7ec59e84350 100644 --- a/ql/cashflows/digitalcmscoupon.cpp +++ b/ql/cashflows/digitalcmscoupon.cpp @@ -185,11 +185,6 @@ namespace QuantLib { return *this; } - DigitalCmsLeg& DigitalCmsLeg::withReplication() { - replication_ = ext::make_shared(); - return *this; - } - DigitalCmsLeg& DigitalCmsLeg::withNakedOption(bool nakedOption) { nakedOption_ = nakedOption; return *this; diff --git a/ql/cashflows/digitalcmscoupon.hpp b/ql/cashflows/digitalcmscoupon.hpp index 8a6ccc2374f..824042e6f63 100644 --- a/ql/cashflows/digitalcmscoupon.hpp +++ b/ql/cashflows/digitalcmscoupon.hpp @@ -83,11 +83,6 @@ namespace QuantLib { DigitalCmsLeg& withPutPayoffs(Rate payoff); DigitalCmsLeg& withPutPayoffs(const std::vector& payoffs); DigitalCmsLeg& withReplication(const ext::shared_ptr&); - /*! \deprecated Use the overload that passes a replication instead. - Deprecated in version 1.32. - */ - [[deprecated("Use the overload that passes a replication instead")]] - DigitalCmsLeg& withReplication(); DigitalCmsLeg& withNakedOption(bool nakedOption = true); operator Leg() const; diff --git a/ql/cashflows/digitalcoupon.cpp b/ql/cashflows/digitalcoupon.cpp index 37d89ad4391..61f7173a606 100644 --- a/ql/cashflows/digitalcoupon.cpp +++ b/ql/cashflows/digitalcoupon.cpp @@ -238,9 +238,7 @@ namespace QuantLib { rate_ = underlyingRate + callCsi_ * callPayoff() + putCsi_ * putPayoff(); } else if (fixingDate == today) { // might have been fixed - Rate pastFixing = - IndexManager::instance().getHistory((underlying_->index())->name())[fixingDate]; - if (pastFixing != Null()) { + if (underlying_->index()->hasHistoricalFixing(fixingDate)) { rate_ = underlyingRate + callCsi_ * callPayoff() + putCsi_ * putPayoff(); } else { rate_ = underlyingRate + callCsi_ * callOptionRate() + putCsi_ * putOptionRate(); diff --git a/ql/cashflows/digitaliborcoupon.cpp b/ql/cashflows/digitaliborcoupon.cpp index d3c465fbb76..b0cd505750a 100644 --- a/ql/cashflows/digitaliborcoupon.cpp +++ b/ql/cashflows/digitaliborcoupon.cpp @@ -185,11 +185,6 @@ namespace QuantLib { return *this; } - DigitalIborLeg& DigitalIborLeg::withReplication() { - replication_ = ext::make_shared(); - return *this; - } - DigitalIborLeg& DigitalIborLeg::withNakedOption(bool nakedOption) { nakedOption_ = nakedOption; return *this; diff --git a/ql/cashflows/digitaliborcoupon.hpp b/ql/cashflows/digitaliborcoupon.hpp index 293bfdcb62c..758856b6b45 100644 --- a/ql/cashflows/digitaliborcoupon.hpp +++ b/ql/cashflows/digitaliborcoupon.hpp @@ -83,11 +83,6 @@ namespace QuantLib { DigitalIborLeg& withPutPayoffs(Rate payoff); DigitalIborLeg& withPutPayoffs(const std::vector& payoffs); DigitalIborLeg& withReplication(const ext::shared_ptr&); - /*! \deprecated Use the overload that passes a replication instead. - Deprecated in version 1.32. - */ - [[deprecated("Use the overload that passes a replication instead")]] - DigitalIborLeg& withReplication(); DigitalIborLeg& withNakedOption(bool nakedOption = true); operator Leg() const; diff --git a/ql/cashflows/overnightindexedcouponpricer.cpp b/ql/cashflows/overnightindexedcouponpricer.cpp index 98d78ff9863..81f98b775f8 100644 --- a/ql/cashflows/overnightindexedcouponpricer.cpp +++ b/ql/cashflows/overnightindexedcouponpricer.cpp @@ -56,7 +56,7 @@ namespace QuantLib { const ext::shared_ptr index = ext::dynamic_pointer_cast(coupon_->index()); - const auto& pastFixings = IndexManager::instance().getHistory(index->name()); + const auto& pastFixings = index->timeSeries(); const auto& fixingDates = coupon_->fixingDates(); const auto& valueDates = coupon_->valueDates(); @@ -194,11 +194,13 @@ namespace QuantLib { Real accumulatedRate = 0.0; + const auto& pastFixings = index->timeSeries(); + // already fixed part Date today = Settings::instance().evaluationDate(); while (i < n && fixingDates[i] < today) { // rate must have been fixed - Rate pastFixing = IndexManager::instance().getHistory(index->name())[fixingDates[i]]; + Rate pastFixing = pastFixings[fixingDates[i]]; QL_REQUIRE(pastFixing != Null(), "Missing " << index->name() << " fixing for " << fixingDates[i]); accumulatedRate += pastFixing * dt[i]; @@ -209,8 +211,7 @@ namespace QuantLib { if (i < n && fixingDates[i] == today) { // might have been fixed try { - Rate pastFixing = - IndexManager::instance().getHistory(index->name())[fixingDates[i]]; + Rate pastFixing = pastFixings[fixingDates[i]]; if (pastFixing != Null()) { accumulatedRate += pastFixing * dt[i]; ++i; diff --git a/ql/experimental/commodities/commodityindex.cpp b/ql/experimental/commodities/commodityindex.cpp index cc3b7b6ab20..06b1f11a750 100644 --- a/ql/experimental/commodities/commodityindex.cpp +++ b/ql/experimental/commodities/commodityindex.cpp @@ -37,10 +37,8 @@ namespace QuantLib { calendar_(std::move(calendar)), lotQuantity_(lotQuantity), forwardCurve_(std::move(forwardCurve)), exchangeContracts_(std::move(exchangeContracts)), nearbyOffset_(nearbyOffset) { - quotes_ = IndexManager::instance().getHistory(indexName); - IndexManager::instance().setHistory(indexName, quotes_); registerWith(Settings::instance().evaluationDate()); - registerWith(IndexManager::instance().notifier(name())); + registerWith(notifier()); if (forwardCurve_ != nullptr) // registerWith(forwardCurve_); diff --git a/ql/experimental/commodities/commodityindex.hpp b/ql/experimental/commodities/commodityindex.hpp index fe1f8597a08..31876eca5d5 100644 --- a/ql/experimental/commodities/commodityindex.hpp +++ b/ql/experimental/commodities/commodityindex.hpp @@ -25,15 +25,14 @@ #define quantlib_commodity_index_hpp #include -#include +#include namespace QuantLib { class TermStructure; //! base class for commodity indexes - class CommodityIndex : public Observable, - public Observer { + class CommodityIndex : public Index { public: CommodityIndex(const std::string& name, CommodityType commodityType, @@ -46,7 +45,11 @@ namespace QuantLib { int nearbyOffset); //! \name Index interface //@{ - std::string name() const; + std::string name() const override; + Calendar fixingCalendar() const override; + bool isValidFixingDate(const Date& fixingDate) const override; + Real fixing(const Date& fixingDate, + bool forecastTodaysFixing = false) const override; //@} //! \name Observer interface //@{ @@ -57,31 +60,71 @@ namespace QuantLib { const CommodityType& commodityType() const; const Currency& currency() const; const UnitOfMeasure& unitOfMeasure() const; - const Calendar& calendar() const; const ext::shared_ptr& forwardCurve() const; Real lotQuantity() const; - - Real price(const Date& date); Real forwardPrice(const Date& date) const; Date lastQuoteDate() const; + bool empty() const; + bool forwardCurveEmpty() const; //@} - void addQuote(const Date& quoteDate, Real quote); + /*! \deprecated Use fixingCalendar instead. + Deprecated in version 1.37. + */ + [[deprecated("Use fixingCalendar instead")]] + const Calendar& calendar() const { + return calendar_; + } + + /*! \deprecated Use fixing instead. + Deprecated in version 1.37. + */ + [[deprecated("Use fixing instead")]] + Real price(const Date& date) { + return fixing(date); + } + + /*! \deprecated Use addFixing instead. + Deprecated in version 1.37. + */ + [[deprecated("Use fixing instead")]] + void addQuote(const Date& quoteDate, Real quote) { + addFixing(quoteDate, quote); + } + + /*! \deprecated Use addFixings instead. + Deprecated in version 1.37. + */ + [[deprecated("Use addFixings instead")]] void addQuotes(const std::map& quotes) { - std::string tag = name(); - quotes_ = IndexManager::instance().getHistory(tag); for (auto quote : quotes) { - quotes_[quote.first] = quote.second; + addFixing(quote.first, quote.second); } - IndexManager::instance().setHistory(tag, quotes_); } - void clearQuotes() const; - //! returns TRUE if the quote date is valid - bool isValidQuoteDate(const Date& quoteDate) const; - bool empty() const; - bool forwardCurveEmpty() const; - const TimeSeries& quotes() const; + /*! \deprecated Use clearFixings instead. + Deprecated in version 1.37. + */ + [[deprecated("Use clearFixings instead")]] + void clearQuotes() { + clearFixings(); + } + + /*! \deprecated Use isValidFixingDate instead. + Deprecated in version 1.37. + */ + [[deprecated("Use isValidFixingDate instead")]] + bool isValidQuoteDate(const Date& quoteDate) const { + return isValidFixingDate(quoteDate); + } + + /*! \deprecated Use timeSeries instead. + Deprecated in version 1.37. + */ + [[deprecated("Use timeSeries instead")]] + const TimeSeries& quotes() const { + return timeSeries(); + } friend std::ostream& operator<<(std::ostream&, const CommodityIndex&); protected: @@ -91,7 +134,6 @@ namespace QuantLib { Currency currency_; Calendar calendar_; Real lotQuantity_; - TimeSeries quotes_; ext::shared_ptr forwardCurve_; Real forwardCurveUomConversionFactor_ = 1; ext::shared_ptr exchangeContracts_; @@ -113,6 +155,18 @@ namespace QuantLib { return name_; } + inline Calendar CommodityIndex::fixingCalendar() const { + return calendar_; + } + + inline bool CommodityIndex::isValidFixingDate(const Date& fixingDate) const { + return fixingCalendar().isBusinessDay(fixingDate); + } + + inline Real CommodityIndex::fixing(const Date& date, bool) const { + return pastFixing(date); + } + inline const CommodityType& CommodityIndex::commodityType() const { return commodityType_; } @@ -125,10 +179,6 @@ namespace QuantLib { return currency_; } - inline const Calendar& CommodityIndex::calendar() const { - return calendar_; - } - inline Real CommodityIndex::lotQuantity() const { return lotQuantity_; } @@ -138,21 +188,6 @@ namespace QuantLib { return forwardCurve_; } - inline const TimeSeries& CommodityIndex::quotes() const { - return quotes_; - } - - inline Real CommodityIndex::price(const Date& date) { - auto hq = quotes_.find(date); - if (hq->second == Null()) { - ++hq; - if (hq == quotes_.end()) - //if (hq->second == Null()) - return Null(); - } - return hq->second; - } - inline Real CommodityIndex::forwardPrice(const Date& date) const { try { Real forwardPrice = @@ -165,13 +200,11 @@ namespace QuantLib { } inline Date CommodityIndex::lastQuoteDate() const { - if (quotes_.empty()) - return Date::minDate(); - return quotes_.lastDate(); + return timeSeries().lastDate(); } inline bool CommodityIndex::empty() const { - return quotes_.empty(); + return timeSeries().empty(); } inline bool CommodityIndex::forwardCurveEmpty() const { @@ -180,24 +213,6 @@ namespace QuantLib { return false; } - inline void CommodityIndex::addQuote(const Date& quoteDate, Real quote) { - //QL_REQUIRE(isValidQuoteDate(quoteDate), - // "Quote date " << quoteDate.weekday() << ", " << - // quoteDate << " is not valid"); - std::string tag = name(); - quotes_ = IndexManager::instance().getHistory(tag); - quotes_[quoteDate] = quote; - IndexManager::instance().setHistory(tag, quotes_); - } - - inline void CommodityIndex::clearQuotes() const { - IndexManager::instance().clearHistory(name()); - } - - inline bool CommodityIndex::isValidQuoteDate(const Date& quoteDate) const { - return calendar().isBusinessDay(quoteDate); - } - } #endif diff --git a/ql/experimental/commodities/energybasisswap.cpp b/ql/experimental/commodities/energybasisswap.cpp index afb0d3e086a..6dcffbe3d3b 100644 --- a/ql/experimental/commodities/energybasisswap.cpp +++ b/ql/experimental/commodities/energybasisswap.cpp @@ -170,8 +170,8 @@ namespace QuantLib { Real receiveQuoteValue = 0; if (stepDate <= lastQuoteDate) { - payQuoteValue = payIndex_->price(stepDate); - receiveQuoteValue = receiveIndex_->price(stepDate); + payQuoteValue = payIndex_->fixing(stepDate); + receiveQuoteValue = receiveIndex_->fixing(stepDate); } else { payQuoteValue = payIndex_->forwardPrice(stepDate); receiveQuoteValue = diff --git a/ql/experimental/commodities/energyfuture.cpp b/ql/experimental/commodities/energyfuture.cpp index 49c65ebd968..c02647e9bbb 100644 --- a/ql/experimental/commodities/energyfuture.cpp +++ b/ql/experimental/commodities/energyfuture.cpp @@ -76,7 +76,7 @@ namespace QuantLib { Date lastQuoteDate = index_->lastQuoteDate(); if (lastQuoteDate >= evaluationDate - 1) { - quoteValue = index_->price(evaluationDate); + quoteValue = index_->fixing(evaluationDate); } else { quoteValue = index_->forwardPrice(evaluationDate); std::ostringstream message; diff --git a/ql/experimental/commodities/energyvanillaswap.cpp b/ql/experimental/commodities/energyvanillaswap.cpp index ad5825288b6..7b073eeb5cd 100644 --- a/ql/experimental/commodities/energyvanillaswap.cpp +++ b/ql/experimental/commodities/energyvanillaswap.cpp @@ -140,7 +140,7 @@ namespace QuantLib { Real quoteValue = 0; if (stepDate <= lastQuoteDate) { - quoteValue = index_->price(stepDate); + quoteValue = index_->fixing(stepDate); } else { quoteValue = index_->forwardPrice(stepDate); } diff --git a/ql/experimental/coupons/digitalcmsspreadcoupon.cpp b/ql/experimental/coupons/digitalcmsspreadcoupon.cpp index a982ba6b440..64d486b5f8c 100644 --- a/ql/experimental/coupons/digitalcmsspreadcoupon.cpp +++ b/ql/experimental/coupons/digitalcmsspreadcoupon.cpp @@ -184,11 +184,6 @@ namespace QuantLib { return *this; } - DigitalCmsSpreadLeg& DigitalCmsSpreadLeg::withReplication() { - replication_ = ext::make_shared(); - return *this; - } - DigitalCmsSpreadLeg& DigitalCmsSpreadLeg::withNakedOption(bool nakedOption) { nakedOption_ = nakedOption; return *this; diff --git a/ql/experimental/coupons/digitalcmsspreadcoupon.hpp b/ql/experimental/coupons/digitalcmsspreadcoupon.hpp index 169447ed8d1..df0f906a70a 100644 --- a/ql/experimental/coupons/digitalcmsspreadcoupon.hpp +++ b/ql/experimental/coupons/digitalcmsspreadcoupon.hpp @@ -81,11 +81,6 @@ namespace QuantLib { DigitalCmsSpreadLeg& withPutPayoffs(Rate payoff); DigitalCmsSpreadLeg& withPutPayoffs(const std::vector& payoffs); DigitalCmsSpreadLeg& withReplication(const ext::shared_ptr&); - /*! \deprecated Use the overload that passes a replication instead. - Deprecated in version 1.32. - */ - [[deprecated("Use the overload that passes a replication instead")]] - DigitalCmsSpreadLeg& withReplication(); DigitalCmsSpreadLeg& withNakedOption(bool nakedOption = true); operator Leg() const; diff --git a/ql/experimental/exoticoptions/Makefile.am b/ql/experimental/exoticoptions/Makefile.am index 3bbbe2bd090..d14a9c0cc10 100644 --- a/ql/experimental/exoticoptions/Makefile.am +++ b/ql/experimental/exoticoptions/Makefile.am @@ -4,32 +4,23 @@ AM_CPPFLAGS = -I${top_builddir} -I${top_srcdir} this_includedir=${includedir}/${subdir} this_include_HEADERS = \ all.hpp \ - analyticamericanmargrabeengine.hpp \ - analyticcomplexchooserengine.hpp \ - analyticcompoundoptionengine.hpp \ - analyticeuropeanmargrabeengine.hpp \ analyticholderextensibleoptionengine.hpp \ analyticpartialtimebarrieroptionengine.hpp \ analyticpdfhestonengine.hpp \ - analyticsimplechooserengine.hpp \ analytictwoassetbarrierengine.hpp \ analytictwoassetcorrelationengine.hpp \ analyticwriterextensibleoptionengine.hpp \ - complexchooseroption.hpp \ - compoundoption.hpp \ continuousarithmeticasianlevyengine.hpp \ continuousarithmeticasianvecerengine.hpp \ everestoption.hpp \ himalayaoption.hpp \ holderextensibleoption.hpp \ kirkspreadoptionengine.hpp \ - margrabeoption.hpp \ mceverestengine.hpp \ mchimalayaengine.hpp \ mcpagodaengine.hpp \ pagodaoption.hpp \ partialtimebarrieroption.hpp \ - simplechooseroption.hpp \ spreadoption.hpp \ twoassetbarrieroption.hpp \ twoassetcorrelationoption.hpp \ @@ -83,16 +74,7 @@ all.hpp: Makefile.am echo "/* This file is automatically generated; do not edit. */" > ${srcdir}/$@ echo "/* Add the files to be included into Makefile.am instead. */" >> ${srcdir}/$@ echo >> ${srcdir}/$@ - for i in $(filter-out all.hpp \ - margrabeoption.hpp \ - analyticamericanmargrabeengine.hpp \ - analyticeuropeanmargrabeengine.hpp \ - compoundoption.hpp \ - analyticcompoundoptionengine.hpp \ - simplechooseroption.hpp \ - analyticsimplechooserengine.hpp \ - complexchooseroption.hpp \ - analyticcomplexchooserengine.hpp, $(this_include_HEADERS)); do \ + for i in $(filter-out all.hpp, $(this_include_HEADERS)); do \ echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \ done echo >> ${srcdir}/$@ diff --git a/ql/experimental/exoticoptions/analyticamericanmargrabeengine.hpp b/ql/experimental/exoticoptions/analyticamericanmargrabeengine.hpp deleted file mode 100644 index c8658a2c819..00000000000 --- a/ql/experimental/exoticoptions/analyticamericanmargrabeengine.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2010 Master IMAFA - Polytech'Nice Sophia - Université de Nice Sophia Antipolis - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.32 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/exoticoptions/analyticcomplexchooserengine.hpp b/ql/experimental/exoticoptions/analyticcomplexchooserengine.hpp deleted file mode 100644 index 8f7d91d31ca..00000000000 --- a/ql/experimental/exoticoptions/analyticcomplexchooserengine.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2014 Master IMAFA - Polytech'Nice Sophia - Université de Nice Sophia Antipolis - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.32 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/exoticoptions/analyticcompoundoptionengine.hpp b/ql/experimental/exoticoptions/analyticcompoundoptionengine.hpp deleted file mode 100644 index 23d6603bf27..00000000000 --- a/ql/experimental/exoticoptions/analyticcompoundoptionengine.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2009 Dimitri Reiswich - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.32 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/exoticoptions/analyticeuropeanmargrabeengine.hpp b/ql/experimental/exoticoptions/analyticeuropeanmargrabeengine.hpp deleted file mode 100644 index 77b1b9f02ce..00000000000 --- a/ql/experimental/exoticoptions/analyticeuropeanmargrabeengine.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2010 Master IMAFA - Polytech'Nice Sophia - Université de Nice Sophia Antipolis - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.32 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/exoticoptions/analyticsimplechooserengine.hpp b/ql/experimental/exoticoptions/analyticsimplechooserengine.hpp deleted file mode 100644 index c1c389f8044..00000000000 --- a/ql/experimental/exoticoptions/analyticsimplechooserengine.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2010 Master IMAFA - Polytech'Nice Sophia - Université de Nice Sophia Antipolis - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.32 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/exoticoptions/complexchooseroption.hpp b/ql/experimental/exoticoptions/complexchooseroption.hpp deleted file mode 100644 index 673a3d76a82..00000000000 --- a/ql/experimental/exoticoptions/complexchooseroption.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2014 Master IMAFA - Polytech'Nice Sophia - Université de Nice Sophia Antipolis - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.32 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/exoticoptions/compoundoption.hpp b/ql/experimental/exoticoptions/compoundoption.hpp deleted file mode 100644 index e3b27458cb8..00000000000 --- a/ql/experimental/exoticoptions/compoundoption.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2009 Dimitri Reiswich - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.32 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/exoticoptions/margrabeoption.hpp b/ql/experimental/exoticoptions/margrabeoption.hpp deleted file mode 100644 index 4f758cb247c..00000000000 --- a/ql/experimental/exoticoptions/margrabeoption.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2010 Master IMAFA - Polytech'Nice Sophia - Université de Nice Sophia Antipolis - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.32 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/exoticoptions/simplechooseroption.hpp b/ql/experimental/exoticoptions/simplechooseroption.hpp deleted file mode 100644 index 32e032bc24a..00000000000 --- a/ql/experimental/exoticoptions/simplechooseroption.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2010 Master IMAFA - Polytech'Nice Sophia - Université de Nice Sophia Antipolis - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.32 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/termstructures/Makefile.am b/ql/experimental/termstructures/Makefile.am index 8c4743d0d3b..e7d989a53af 100644 --- a/ql/experimental/termstructures/Makefile.am +++ b/ql/experimental/termstructures/Makefile.am @@ -5,8 +5,7 @@ this_includedir=${includedir}/${subdir} this_include_HEADERS = \ all.hpp \ basisswapratehelpers.hpp \ - crosscurrencyratehelpers.hpp \ - multicurvesensitivities.hpp + crosscurrencyratehelpers.hpp cpp_files = \ basisswapratehelpers.cpp \ @@ -39,7 +38,7 @@ all.hpp: Makefile.am echo "/* This file is automatically generated; do not edit. */" > ${srcdir}/$@ echo "/* Add the files to be included into Makefile.am instead. */" >> ${srcdir}/$@ echo >> ${srcdir}/$@ - for i in $(filter-out all.hpp multicurvesensitivities.hpp, $(this_include_HEADERS)); do \ + for i in $(filter-out all.hpp, $(this_include_HEADERS)); do \ echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \ done echo >> ${srcdir}/$@ diff --git a/ql/experimental/termstructures/basisswapratehelpers.hpp b/ql/experimental/termstructures/basisswapratehelpers.hpp index 975399f9634..a1971a11ffc 100644 --- a/ql/experimental/termstructures/basisswapratehelpers.hpp +++ b/ql/experimental/termstructures/basisswapratehelpers.hpp @@ -53,6 +53,8 @@ namespace QuantLib { Real impliedQuote() const override; void accept(AcyclicVisitor&) override; + // NOLINTNEXTLINE(cppcoreguidelines-noexcept-swap,performance-noexcept-swap) + ext::shared_ptr swap() const { return swap_; } private: void initializeDates() override; void setTermStructure(YieldTermStructure*) override; @@ -94,6 +96,8 @@ namespace QuantLib { Real impliedQuote() const override; void accept(AcyclicVisitor&) override; + // NOLINTNEXTLINE(cppcoreguidelines-noexcept-swap,performance-noexcept-swap) + ext::shared_ptr swap() const { return swap_; } private: void initializeDates() override; void setTermStructure(YieldTermStructure*) override; diff --git a/ql/experimental/termstructures/multicurvesensitivities.hpp b/ql/experimental/termstructures/multicurvesensitivities.hpp deleted file mode 100644 index 14d22630baf..00000000000 --- a/ql/experimental/termstructures/multicurvesensitivities.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/*! - Copyright (C) 2016 Michael von den Driesch - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -#ifndef quantlib_multicurve_sensitivity_hpp -#define quantlib_multicurve_sensitivity_hpp - -// Deprecated in version 1.32 -#pragma message("Warning: this file is empty and will disappear in a future release; do not include it.") - -#endif diff --git a/ql/functional.hpp b/ql/functional.hpp index 4bb48692666..f4968bd66fa 100644 --- a/ql/functional.hpp +++ b/ql/functional.hpp @@ -66,12 +66,6 @@ namespace QuantLib::ext { #pragma GCC diagnostic pop #endif - /*! \deprecated To check if a function is empty, use it in a bool context - instead of comparing it to QL_NULL_FUNCTION. - Deprecated in version 1.32. - */ - #define QL_NULL_FUNCTION nullptr - } diff --git a/ql/grid.hpp b/ql/grid.hpp index 077c541717e..b23efc5bca9 100644 --- a/ql/grid.hpp +++ b/ql/grid.hpp @@ -28,10 +28,28 @@ namespace QuantLib { + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. + */ + [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] Array CenteredGrid(Real center, Real dx, Size steps); + + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. + */ + [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] Array BoundedGrid(Real xMin, Real xMax, Size steps); + + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. + */ + [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] Array BoundedLogGrid(Real xMin, Real xMax, Size steps); + // inline definitions inline Array CenteredGrid(Real center, Real dx, Size steps) { diff --git a/ql/index.cpp b/ql/index.cpp index c5bb900a15e..3a181837bae 100644 --- a/ql/index.cpp +++ b/ql/index.cpp @@ -25,9 +25,7 @@ namespace QuantLib { Real fixing, bool forceOverwrite) { checkNativeFixingsAllowed(); - addFixings(&fixingDate, (&fixingDate)+1, - &fixing, - forceOverwrite); + addFixings(&fixingDate, (&fixingDate) + 1, &fixing, forceOverwrite); } void Index::addFixings(const TimeSeries& t, @@ -44,7 +42,9 @@ namespace QuantLib { void Index::clearFixings() { checkNativeFixingsAllowed(); + QL_DEPRECATED_DISABLE_WARNING IndexManager::instance().clearHistory(name()); + QL_DEPRECATED_ENABLE_WARNING } void Index::checkNativeFixingsAllowed() { diff --git a/ql/index.hpp b/ql/index.hpp index 6419700ff64..b7da8d98b96 100644 --- a/ql/index.hpp +++ b/ql/index.hpp @@ -69,7 +69,9 @@ namespace QuantLib { virtual Real pastFixing(const Date& fixingDate) const; //! returns the fixing TimeSeries const TimeSeries& timeSeries() const { + QL_DEPRECATED_DISABLE_WARNING return IndexManager::instance().getHistory(name()); + QL_DEPRECATED_ENABLE_WARNING } //! check if index allows for native fixings. /*! If this returns false, calls to addFixing and similar @@ -100,53 +102,30 @@ namespace QuantLib { ValueIterator vBegin, bool forceOverwrite = false) { checkNativeFixingsAllowed(); - std::string tag = name(); - TimeSeries h = IndexManager::instance().getHistory(tag); - bool noInvalidFixing = true, noDuplicatedFixing = true; - Date invalidDate, duplicatedDate; - Real nullValue = Null(); - Real invalidValue = Null(); - Real duplicatedValue = Null(); - while (dBegin != dEnd) { - bool validFixing = isValidFixingDate(*dBegin); - Real currentValue = h[*dBegin]; - bool missingFixing = forceOverwrite || currentValue == nullValue; - if (validFixing) { - if (missingFixing) - h[*(dBegin++)] = *(vBegin++); - else if (close(currentValue, *(vBegin))) { - ++dBegin; - ++vBegin; - } else { - noDuplicatedFixing = false; - duplicatedDate = *(dBegin++); - duplicatedValue = *(vBegin++); - } - } else { - noInvalidFixing = false; - invalidDate = *(dBegin++); - invalidValue = *(vBegin++); - } - } - IndexManager::instance().setHistory(tag, h); - QL_REQUIRE(noInvalidFixing, "At least one invalid fixing provided: " - << invalidDate.weekday() << " " << invalidDate << ", " - << invalidValue); - QL_REQUIRE(noDuplicatedFixing, "At least one duplicated fixing provided: " - << duplicatedDate << ", " << duplicatedValue - << " while " << h[duplicatedDate] - << " value is already present"); + IndexManager::instance().addFixings( + name(), dBegin, dEnd, vBegin, forceOverwrite, + [this](const Date& d) { return isValidFixingDate(d); }); } //! clears all stored historical fixings void clearFixings(); + protected: + ext::shared_ptr notifier() const { + QL_DEPRECATED_DISABLE_WARNING + return IndexManager::instance().notifier(name()); + QL_DEPRECATED_ENABLE_WARNING + } + private: //! check if index allows for native fixings void checkNativeFixingsAllowed(); + }; inline bool Index::hasHistoricalFixing(const Date& fixingDate) const { + QL_DEPRECATED_DISABLE_WARNING return IndexManager::instance().hasHistoricalFixing(name(), fixingDate); + QL_DEPRECATED_ENABLE_WARNING } inline Real Index::pastFixing(const Date& fixingDate) const { diff --git a/ql/indexes/equityindex.cpp b/ql/indexes/equityindex.cpp index 1443539b9d9..6f55a1a0ada 100644 --- a/ql/indexes/equityindex.cpp +++ b/ql/indexes/equityindex.cpp @@ -57,7 +57,7 @@ namespace QuantLib { registerWith(dividend_); registerWith(spot_); registerWith(Settings::instance().evaluationDate()); - registerWith(IndexManager::instance().notifier(EquityIndex::name())); + registerWith(notifier()); } Real EquityIndex::fixing(const Date& fixingDate, bool forecastTodaysFixing) const { @@ -107,4 +107,4 @@ namespace QuantLib { return ext::make_shared(name(), fixingCalendar(), currency(), interest, dividend, spot); } -} \ No newline at end of file +} diff --git a/ql/indexes/ibor/Makefile.am b/ql/indexes/ibor/Makefile.am index cc7721a4c0c..f0e17bf957a 100644 --- a/ql/indexes/ibor/Makefile.am +++ b/ql/indexes/ibor/Makefile.am @@ -23,6 +23,7 @@ this_include_HEADERS = \ gbplibor.hpp \ jibar.hpp \ jpylibor.hpp \ + kofr.hpp \ libor.hpp \ mosprime.hpp \ nzdlibor.hpp \ @@ -50,6 +51,7 @@ cpp_files = \ euribor.cpp \ eurlibor.cpp \ fedfunds.cpp \ + kofr.cpp \ libor.cpp \ shibor.cpp \ sofr.cpp \ diff --git a/ql/indexes/ibor/all.hpp b/ql/indexes/ibor/all.hpp index 4dbae78eaa9..52d07e304d0 100644 --- a/ql/indexes/ibor/all.hpp +++ b/ql/indexes/ibor/all.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/ql/methods/finitedifferences/pdeshortrate.hpp b/ql/indexes/ibor/kofr.cpp similarity index 64% rename from ql/methods/finitedifferences/pdeshortrate.hpp rename to ql/indexes/ibor/kofr.cpp index 5ccc4745c7a..2c0c7654871 100644 --- a/ql/methods/finitedifferences/pdeshortrate.hpp +++ b/ql/indexes/ibor/kofr.cpp @@ -1,7 +1,7 @@ /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* - Copyright (C) 2005 Joseph Wang + Copyright (C) 2024 Jongbong An This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ @@ -17,12 +17,15 @@ FOR A PARTICULAR PURPOSE. See the license for more details. */ -#ifndef quantlib_pdeshortrate_hpp -#define quantlib_pdeshortrate_hpp +#include +#include +#include +#include +#include -// Deprecated in version 1.32 -#pragma message("Warning: this file is empty and will disappear in a future release; do not include it.") - - -#endif +namespace QuantLib { + Kofr::Kofr(const Handle& h) + : OvernightIndex( + "KOFR", 0, KRWCurrency(), SouthKorea(SouthKorea::Settlement), Actual365Fixed(), h) {} +} diff --git a/ql/models/marketmodels/duffsdeviceinnerproduct.hpp b/ql/indexes/ibor/kofr.hpp similarity index 56% rename from ql/models/marketmodels/duffsdeviceinnerproduct.hpp rename to ql/indexes/ibor/kofr.hpp index 90325dc6aa3..4f23ac702f5 100644 --- a/ql/models/marketmodels/duffsdeviceinnerproduct.hpp +++ b/ql/indexes/ibor/kofr.hpp @@ -1,7 +1,7 @@ /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* - Copyright (C) 2006 Ferdinando Ametrano + Copyright (C) 2024 Jongbong An This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ @@ -17,12 +17,28 @@ FOR A PARTICULAR PURPOSE. See the license for more details. */ +/*! \file kofr.hpp + \brief %KOFR index +*/ -#ifndef quantlib_duffs_device_inner_product_hpp -#define quantlib_duffs_device_inner_product_hpp - -// Deprecated in version 1.32 -#pragma message("Warning: this file is empty and will disappear in a future release; do not include it.") - +#ifndef quantlib_kofr_hpp +#define quantlib_kofr_hpp + +#include + +namespace QuantLib { + + //! %KOFR index. + /*! Korea Overnight Financing Repo Rate (KOFR) published by Korea Securities Depository (KSD) + Please refer to + (1) https://www.bok.or.kr/eng/main/contents.do?menuNo=400399 (Overview) + (2) https://www.kofr.kr/main.jsp (Detailed information) + */ + class Kofr : public OvernightIndex { + public: + explicit Kofr(const Handle& h = {}); + }; + +} #endif diff --git a/ql/indexes/indexmanager.cpp b/ql/indexes/indexmanager.cpp index 19f4c4f77de..a9c68ac832a 100644 --- a/ql/indexes/indexmanager.cpp +++ b/ql/indexes/indexmanager.cpp @@ -26,15 +26,30 @@ namespace QuantLib { } const TimeSeries& IndexManager::getHistory(const std::string& name) const { - return data_[name].value(); + return data_[name]; } void IndexManager::setHistory(const std::string& name, TimeSeries history) { + QL_DEPRECATED_DISABLE_WARNING + notifier(name)->notifyObservers(); + QL_DEPRECATED_ENABLE_WARNING data_[name] = std::move(history); } + void IndexManager::addFixing(const std::string& name, + const Date& fixingDate, + Real fixing, + bool forceOverwrite) { + addFixings(name, &fixingDate, (&fixingDate) + 1, &fixing, forceOverwrite); + } + ext::shared_ptr IndexManager::notifier(const std::string& name) const { - return data_[name]; + auto n = notifiers_.find(name); + if(n != notifiers_.end()) + return n->second; + auto o = ext::make_shared(); + notifiers_[name] = o; + return o; } std::vector IndexManager::histories() const { @@ -45,14 +60,25 @@ namespace QuantLib { return temp; } - void IndexManager::clearHistory(const std::string& name) { data_.erase(name); } + void IndexManager::clearHistory(const std::string& name) { + QL_DEPRECATED_DISABLE_WARNING + notifier(name)->notifyObservers(); + QL_DEPRECATED_ENABLE_WARNING + data_.erase(name); + } - void IndexManager::clearHistories() { data_.clear(); } + void IndexManager::clearHistories() { + QL_DEPRECATED_DISABLE_WARNING + for (auto const& d : data_) + notifier(d.first)->notifyObservers(); + QL_DEPRECATED_ENABLE_WARNING + data_.clear(); + } bool IndexManager::hasHistoricalFixing(const std::string& name, const Date& fixingDate) const { auto const& indexIter = data_.find(name); return (indexIter != data_.end()) && - ((*indexIter).second.value()[fixingDate] != Null()); + ((*indexIter).second[fixingDate] != Null()); } } diff --git a/ql/indexes/indexmanager.hpp b/ql/indexes/indexmanager.hpp index 0115aabfe93..d553eedc62f 100644 --- a/ql/indexes/indexmanager.hpp +++ b/ql/indexes/indexmanager.hpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -36,28 +37,55 @@ namespace QuantLib { /*! \note index names are case insensitive */ class IndexManager : public Singleton { friend class Singleton; + friend class Index; private: IndexManager() = default; public: - //! returns whether historical fixings were stored for the index - bool hasHistory(const std::string& name) const; - //! returns the (possibly empty) history of the index fixings - const TimeSeries& getHistory(const std::string& name) const; - //! stores the historical fixings of the index - void setHistory(const std::string& name, TimeSeries history); - //! observer notifying of changes in the index fixings - ext::shared_ptr notifier(const std::string& name) const; //! returns all names of the indexes for which fixings were stored std::vector histories() const; - //! clears the historical fixings of the index - void clearHistory(const std::string& name); //! clears all stored fixings void clearHistories(); - //! returns whether a specific historical fixing was stored for the index and date + + // deprecated in order to be moved into the private section + + /*! \deprecated Use Index::hasHistoricalFixing instead. + Deprecated in version 1.37. + */ + [[deprecated("Use Index::hasHistoricalFixing instead")]] + bool hasHistory(const std::string& name) const; + + /*! \deprecated Use Index::timeSeries instead. + Deprecated in version 1.37. + */ + [[deprecated("Use Index::timeSeries instead")]] + const TimeSeries& getHistory(const std::string& name) const; + + /*! \deprecated Use Index::clearFixings instead. + Deprecated in version 1.37. + */ + [[deprecated("Use Index::clearFixings instead")]] + void clearHistory(const std::string& name); + + /*! \deprecated Use Index::hasHistoricalFixing instead. + Deprecated in version 1.37. + */ + [[deprecated("Use Index::hasHistoricalFixing instead")]] bool hasHistoricalFixing(const std::string& name, const Date& fixingDate) const; + /*! \deprecated Use Index::addFixings instead. + Deprecated in version 1.37. + */ + [[deprecated("Use Index::addFixings instead")]] + void setHistory(const std::string& name, TimeSeries history); + + /*! \deprecated Register with the relevant index instead. + Deprecated in version 1.37. + */ + [[deprecated("Register with the relevant index instead")]] + ext::shared_ptr notifier(const std::string& name) const; + private: struct CaseInsensitiveCompare { bool operator()(const std::string& s1, const std::string& s2) const { @@ -67,7 +95,60 @@ namespace QuantLib { } }; - mutable std::map>, CaseInsensitiveCompare> data_; + mutable std::map, CaseInsensitiveCompare> data_; + mutable std::map> notifiers_; + + //! add a fixing + void addFixing(const std::string& name, + const Date& fixingDate, + Real fixing, + bool forceOverwrite = false); + //! add fixings + template + void addFixings(const std::string& name, + DateIterator dBegin, + DateIterator dEnd, + ValueIterator vBegin, + bool forceOverwrite = false, + const std::function& isValidFixingDate = {}) { + auto& h = data_[name]; + bool noInvalidFixing = true, noDuplicatedFixing = true; + Date invalidDate, duplicatedDate; + Real nullValue = Null(); + Real invalidValue = Null(); + Real duplicatedValue = Null(); + while (dBegin != dEnd) { + bool validFixing = isValidFixingDate ? isValidFixingDate(*dBegin) : true; + Real currentValue = h[*dBegin]; + bool missingFixing = forceOverwrite || currentValue == nullValue; + if (validFixing) { + if (missingFixing) + h[*(dBegin++)] = *(vBegin++); + else if (close(currentValue, *(vBegin))) { + ++dBegin; + ++vBegin; + } else { + noDuplicatedFixing = false; + duplicatedDate = *(dBegin++); + duplicatedValue = *(vBegin++); + } + } else { + noInvalidFixing = false; + invalidDate = *(dBegin++); + invalidValue = *(vBegin++); + } + } + QL_DEPRECATED_DISABLE_WARNING + notifier(name)->notifyObservers(); + QL_DEPRECATED_ENABLE_WARNING + QL_REQUIRE(noInvalidFixing, "At least one invalid fixing provided: " + << invalidDate.weekday() << " " << invalidDate << ", " + << invalidValue); + QL_REQUIRE(noDuplicatedFixing, "At least one duplicated fixing provided: " + << duplicatedDate << ", " << duplicatedValue + << " while " << h[duplicatedDate] + << " value is already present"); + } }; } diff --git a/ql/indexes/inflationindex.cpp b/ql/indexes/inflationindex.cpp index 66d1c5c54ad..5cb89e02067 100644 --- a/ql/indexes/inflationindex.cpp +++ b/ql/indexes/inflationindex.cpp @@ -126,7 +126,7 @@ namespace QuantLib { frequency_(frequency), availabilityLag_(availabilityLag), currency_(std::move(currency)) { name_ = region_.name() + " " + familyName_; registerWith(Settings::instance().evaluationDate()); - registerWith(IndexManager::instance().notifier(InflationIndex::name())); + registerWith(notifier()); } Calendar InflationIndex::fixingCalendar() const { diff --git a/ql/indexes/interestrateindex.cpp b/ql/indexes/interestrateindex.cpp index d4e9fab0d70..d98e26539ca 100644 --- a/ql/indexes/interestrateindex.cpp +++ b/ql/indexes/interestrateindex.cpp @@ -57,7 +57,7 @@ namespace QuantLib { name_ = out.str(); registerWith(Settings::instance().evaluationDate()); - registerWith(IndexManager::instance().notifier(InterestRateIndex::name())); + registerWith(notifier()); } Rate InterestRateIndex::fixing(const Date& fixingDate, diff --git a/ql/instruments/overnightindexfuture.cpp b/ql/instruments/overnightindexfuture.cpp index 784e4811b04..7cb1bc90027 100644 --- a/ql/instruments/overnightindexfuture.cpp +++ b/ql/instruments/overnightindexfuture.cpp @@ -46,8 +46,7 @@ namespace QuantLib { Date d1 = valueDate_; // d1 could be a holiday Date fixingDate = calendar.adjust(d1, Preceding); - const TimeSeries& history = IndexManager::instance() - .getHistory(overnightIndex_->name()); + const auto& history = overnightIndex_->timeSeries(); Real fwd; while (d1 < maturityDate_) { Date d2 = calendar.advance(d1, 1, Days); @@ -86,8 +85,7 @@ namespace QuantLib { forwardDiscountStart = today; // for valuations inside the reference period, index quotes // must have been populated in the history - const TimeSeries& history = IndexManager::instance() - .getHistory(overnightIndex_->name()); + const auto& history = overnightIndex_->timeSeries(); Date d1 = valueDate_; // d1 could be a holiday Date fixingDate = calendar.adjust(d1, Preceding); diff --git a/ql/math/Makefile.am b/ql/math/Makefile.am index 46ccd1efc77..bff247cdf0a 100644 --- a/ql/math/Makefile.am +++ b/ql/math/Makefile.am @@ -53,8 +53,7 @@ cpp_files = \ primenumbers.cpp \ quadratic.cpp \ richardsonextrapolation.cpp \ - rounding.cpp \ - sampledcurve.cpp + rounding.cpp if UNITY_BUILD @@ -92,7 +91,7 @@ all.hpp: Makefile.am echo "/* This file is automatically generated; do not edit. */" > ${srcdir}/$@ echo "/* Add the files to be included into Makefile.am instead. */" >> ${srcdir}/$@ echo >> ${srcdir}/$@ - for i in $(filter-out all.hpp, $(this_include_HEADERS)); do \ + for i in $(filter-out all.hpp sampledcurve.hpp, $(this_include_HEADERS)); do \ echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \ done echo >> ${srcdir}/$@ diff --git a/ql/math/all.hpp b/ql/math/all.hpp index 7df092f2b55..4640f657c9b 100644 --- a/ql/math/all.hpp +++ b/ql/math/all.hpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/ql/math/sampledcurve.cpp b/ql/math/sampledcurve.cpp deleted file mode 100644 index 8cd0fa46d1f..00000000000 --- a/ql/math/sampledcurve.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2005 Joseph Wang - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -#include - -namespace QuantLib { - - Real SampledCurve::valueAtCenter() const { - QL_REQUIRE(!empty(), "empty sampled curve"); - Size jmid = size()/2; - if (size() % 2 == 1) - return values_[jmid]; - else - return (values_[jmid]+values_[jmid-1])/2.0; - } - - Real SampledCurve::firstDerivativeAtCenter() const { - QL_REQUIRE(size()>=3, - "the size of the curve must be at least 3"); - Size jmid = size()/2; - if (size() % 2 == 1) { - return (values_[jmid+1]-values_[jmid-1])/ - (grid_[jmid+1]-grid_[jmid-1]); - } else { - return (values_[jmid]-values_[jmid-1])/ - (grid_[jmid]-grid_[jmid-1]); - } - } - - Real SampledCurve::secondDerivativeAtCenter() const { - QL_REQUIRE(size()>=4, - "the size of the curve must be at least 4"); - Size jmid = size()/2; - if (size() % 2 == 1) { - Real deltaPlus = (values_[jmid+1]-values_[jmid])/ - (grid_[jmid+1]-grid_[jmid]); - Real deltaMinus = (values_[jmid]-values_[jmid-1])/ - (grid_[jmid]-grid_[jmid-1]); - Real dS = (grid_[jmid+1]-grid_[jmid-1])/2.0; - return (deltaPlus-deltaMinus)/dS; - } else { - Real deltaPlus = (values_[jmid+1]-values_[jmid-1])/ - (grid_[jmid+1]-grid_[jmid-1]); - Real deltaMinus = (values_[jmid]-values_[jmid-2])/ - (grid_[jmid]-grid_[jmid-2]); - return (deltaPlus-deltaMinus)/ - (grid_[jmid]-grid_[jmid-1]); - } - } - - void SampledCurve::regrid(const Array &new_grid) { - CubicInterpolation priceSpline(grid_.begin(), grid_.end(), - values_.begin(), - CubicInterpolation::Spline, false, - CubicInterpolation::SecondDerivative, 0.0, - CubicInterpolation::SecondDerivative, 0.0); - priceSpline.update(); - Array newValues(new_grid.size()); - Array::iterator val; - Array::const_iterator grid; - for (val = newValues.begin(), grid = new_grid.begin() ; - grid != new_grid.end(); - ++val, ++grid) { - *val = priceSpline(*grid, true); - } - values_.swap(newValues); - grid_ = new_grid; - } - -} - diff --git a/ql/math/sampledcurve.hpp b/ql/math/sampledcurve.hpp index 0b747466c76..bd303add80d 100644 --- a/ql/math/sampledcurve.hpp +++ b/ql/math/sampledcurve.hpp @@ -17,237 +17,11 @@ FOR A PARTICULAR PURPOSE. See the license for more details. */ -/*! \file sampledcurve.hpp - \brief a class that contains a sampled curve -*/ - #ifndef quantlib_sampled_curve_hpp #define quantlib_sampled_curve_hpp -#include -#include -#include - -namespace QuantLib { - - /*! \deprecated Use the new finite-differences framework instead. - Deprecated in version 1.32. - */ - class [[deprecated("Use the new finite-differences framework instead")]] SampledCurve { - public: - SampledCurve(Size gridSize = 0); - SampledCurve(const Array &grid); - - //! \name inspectors - //@{ - const Array& grid() const; - Array& grid(); - const Array& values() const; - Array& values(); - Real gridValue(Size i) const; - Real& gridValue(Size i); - Real value(Size i) const; - Real& value(Size i); - Size size() const; - bool empty() const; - //@} - - //! \name modifiers - //@{ - void setGrid(const Array&); - void setValues(const Array&); - template - void sample(const F& f) { - Array::iterator i, j; - for(i=grid_.begin(), j = values_.begin(); - i != grid_.end(); ++i, ++j) - *j = f(*i); - } - //@} - - //! \name calculations - //@{ - /*! \todo replace or complement with a more general function - valueAt(spot) - */ - Real valueAtCenter() const; - /*! \todo replace or complement with a more general function - firstDerivativeAt(spot) - */ - Real firstDerivativeAtCenter() const; - /*! \todo replace or complement with a more general function - secondDerivativeAt(spot) - */ - Real secondDerivativeAtCenter() const; - //@} - - //! \name utilities - //@{ - QL_DEPRECATED_DISABLE_WARNING - void swap(SampledCurve&) noexcept; - QL_DEPRECATED_ENABLE_WARNING - void setLogGrid(Real min, Real max) { - setGrid(BoundedLogGrid(min, max, size()-1)); - } - void regridLogGrid(Real min, Real max) { - regrid(BoundedLogGrid(min, max, size() - 1), - [](Real x) -> Real { return std::log(x); }); - } - void shiftGrid(Real s) { - grid_ += s; - } - void scaleGrid(Real s) { - grid_ *= s; - } - - void regrid(const Array &new_grid); - -#if defined(__GNUC__) && (__GNUC__ >= 7) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wnoexcept-type" -#endif - - template - void regrid(const Array &new_grid, - T func) { - Array transformed_grid(grid_.size()); - - std::transform(grid_.begin(), grid_.end(), - transformed_grid.begin(), func); - CubicInterpolation priceSpline(transformed_grid.begin(), - transformed_grid.end(), - values_.begin(), - CubicInterpolation::Spline, false, - CubicInterpolation::SecondDerivative, 0.0, - CubicInterpolation::SecondDerivative, 0.0); - priceSpline.update(); - - Array newValues = new_grid; - std::transform(newValues.begin(), newValues.end(), - newValues.begin(), func); - for (Real& newValue : newValues) { - newValue = priceSpline(newValue, true); - } - values_.swap(newValues); - grid_ = new_grid; - } - -#if defined(__GNUC__) && (__GNUC__ >= 7) -#pragma GCC diagnostic pop -#endif - - QL_DEPRECATED_DISABLE_WARNING - template - const SampledCurve& transform(T x) { - std::transform(values_.begin(), values_.end(), - values_.begin(), x); - return *this; - } - - template - const SampledCurve& transformGrid(T x) { - std::transform(grid_.begin(), grid_.end(), - grid_.begin(), x); - return *this; - } - QL_DEPRECATED_ENABLE_WARNING - //@} - private: - Array grid_; - Array values_; - }; - - QL_DEPRECATED_DISABLE_WARNING - - /* \relates SampledCurve */ - void swap(SampledCurve&, SampledCurve&) noexcept; - - /*! \deprecated Use the new finite-differences framework instead. - Deprecated in version 1.32. - */ - [[deprecated("Use the new finite-differences framework instead")]] - typedef SampledCurve SampledCurveSet; - - QL_DEPRECATED_ENABLE_WARNING - - - // inline definitions - - QL_DEPRECATED_DISABLE_WARNING - - inline SampledCurve::SampledCurve(Size gridSize) - : grid_(gridSize), values_(gridSize) {} - - inline SampledCurve::SampledCurve(const Array& grid) - : grid_(grid), values_(grid.size()) {} - - inline Array& SampledCurve::grid() { - return grid_; - } - - inline const Array& SampledCurve::grid() const { - return grid_; - } - - inline const Array& SampledCurve::values() const { - return values_; - } - - inline Array& SampledCurve::values() { - return values_; - } - - inline Real SampledCurve::gridValue(Size i) const { - return grid_[i]; - } - - inline Real& SampledCurve::gridValue(Size i) { - return grid_[i]; - } - - inline Real SampledCurve::value(Size i) const { - return values_[i]; - } - - inline Real& SampledCurve::value(Size i) { - return values_[i]; - } - - inline Size SampledCurve::size() const { - return grid_.size(); - } - - inline bool SampledCurve::empty() const { - return grid_.empty(); - } - - inline void SampledCurve::setGrid(const Array &g) { - grid_ = g; - } - - inline void SampledCurve::setValues(const Array &g) { - values_ = g; - } - - inline void SampledCurve::swap(SampledCurve& from) noexcept { - grid_.swap(from.grid_); - values_.swap(from.values_); - } - - inline void swap(SampledCurve& c1, SampledCurve& c2) noexcept { - c1.swap(c2); - } - - inline std::ostream& operator<<(std::ostream& out, - const SampledCurve& a) { - out << "[ " << a.grid() << "; " - << a.values() << " ]"; - return out; - } - - QL_DEPRECATED_ENABLE_WARNING - -} +// Deprecated in version 1.37 +#pragma message("Warning: this file is empty and will disappear in a future release; do not include it.") #endif diff --git a/ql/math/transformedgrid.hpp b/ql/math/transformedgrid.hpp index 5ef2861efaa..9658b3b2153 100644 --- a/ql/math/transformedgrid.hpp +++ b/ql/math/transformedgrid.hpp @@ -30,11 +30,11 @@ namespace QuantLib { - //! transformed grid - /*! This package encapuslates an array of grid points. It is used primarily - in PDE calculations. + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. */ - class TransformedGrid { + class [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] TransformedGrid { public: TransformedGrid (const Array &grid) : grid_(grid), transformedGrid_(grid), @@ -93,7 +93,14 @@ namespace QuantLib { Array dx_; }; - class LogGrid : public TransformedGrid { + + QL_DEPRECATED_DISABLE_WARNING + + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. + */ + class [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] LogGrid : public TransformedGrid { public: LogGrid(const Array &grid) : TransformedGrid(grid, [](Real x) -> Real { return std::log(x); }){}; @@ -101,6 +108,8 @@ namespace QuantLib { Real logGrid(Size i) const { return transformedGrid(i);} }; + QL_DEPRECATED_ENABLE_WARNING + } diff --git a/ql/methods/finitedifferences/Makefile.am b/ql/methods/finitedifferences/Makefile.am index c6a4f056e92..e077fd986ba 100644 --- a/ql/methods/finitedifferences/Makefile.am +++ b/ql/methods/finitedifferences/Makefile.am @@ -23,8 +23,6 @@ this_include_HEADERS = \ parallelevolver.hpp \ pde.hpp \ pdebsm.hpp \ - pdeshortrate.hpp \ - shoutcondition.hpp \ stepcondition.hpp \ trbdf2.hpp \ tridiagonaloperator.hpp \ @@ -69,7 +67,7 @@ all.hpp: Makefile.am echo "/* This file is automatically generated; do not edit. */" > ${srcdir}/$@ echo "/* Add the files to be included into Makefile.am instead. */" >> ${srcdir}/$@ echo >> ${srcdir}/$@ - for i in $(filter-out all.hpp shoutcondition.hpp pdeshortrate.hpp, $(this_include_HEADERS)); do \ + for i in $(filter-out all.hpp bsmtermoperator.hpp fdtypedefs.hpp parallelevolver.hpp, $(this_include_HEADERS)); do \ echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \ done echo >> ${srcdir}/$@ diff --git a/ql/methods/finitedifferences/all.hpp b/ql/methods/finitedifferences/all.hpp index 872f8b6b9cc..d549c19549a 100644 --- a/ql/methods/finitedifferences/all.hpp +++ b/ql/methods/finitedifferences/all.hpp @@ -3,19 +3,16 @@ #include #include -#include #include #include #include #include #include #include -#include #include #include #include #include -#include #include #include #include diff --git a/ql/methods/finitedifferences/bsmoperator.cpp b/ql/methods/finitedifferences/bsmoperator.cpp index 04f08d76bf2..b5490f2dd46 100644 --- a/ql/methods/finitedifferences/bsmoperator.cpp +++ b/ql/methods/finitedifferences/bsmoperator.cpp @@ -24,6 +24,8 @@ namespace QuantLib { + QL_DEPRECATED_DISABLE_WARNING + BSMOperator::BSMOperator(Size size, Real dx, Rate r, Rate q, Volatility sigma) : TridiagonalOperator(size) { @@ -49,4 +51,6 @@ namespace QuantLib { } } + QL_DEPRECATED_ENABLE_WARNING + } diff --git a/ql/methods/finitedifferences/bsmoperator.hpp b/ql/methods/finitedifferences/bsmoperator.hpp index 2cfcf9b7080..c2e74750978 100644 --- a/ql/methods/finitedifferences/bsmoperator.hpp +++ b/ql/methods/finitedifferences/bsmoperator.hpp @@ -30,9 +30,11 @@ namespace QuantLib { - //! Black-Scholes-Merton differential operator - /*! \ingroup findiff */ - class BSMOperator : public TridiagonalOperator { + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. + */ + class [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] BSMOperator : public TridiagonalOperator { public: BSMOperator() = default; BSMOperator(Size size, Real dx, Rate r, Rate q, Volatility sigma); diff --git a/ql/methods/finitedifferences/bsmtermoperator.hpp b/ql/methods/finitedifferences/bsmtermoperator.hpp index e47f8c38a6c..34114882e05 100644 --- a/ql/methods/finitedifferences/bsmtermoperator.hpp +++ b/ql/methods/finitedifferences/bsmtermoperator.hpp @@ -17,26 +17,11 @@ FOR A PARTICULAR PURPOSE. See the license for more details. */ -/*! \file bsmtermoperator.hpp - \brief differential operator for Black-Scholes-Merton equation -*/ - #ifndef quantlib_bsm_term_operator_hpp #define quantlib_bsm_term_operator_hpp -#include -#include -#include -#include - -namespace QuantLib { - - /*! \deprecated Use the new finite-differences framework instead. - Deprecated in version 1.32. - */ - [[deprecated("Use the new finite-differences framework instead")]] - typedef PdeOperator BSMTermOperator; -} +// Deprecated in version 1.37 +#pragma message("Warning: this file is empty and will disappear in a future release; do not include it.") #endif diff --git a/ql/methods/finitedifferences/fdtypedefs.hpp b/ql/methods/finitedifferences/fdtypedefs.hpp index 01bd49b51ec..2d7675e0564 100644 --- a/ql/methods/finitedifferences/fdtypedefs.hpp +++ b/ql/methods/finitedifferences/fdtypedefs.hpp @@ -24,38 +24,8 @@ #ifndef quantlib_fd_typedefs_hpp #define quantlib_fd_typedefs_hpp -#include -#include - -namespace QuantLib { - - /*! \deprecated Define your typedef if needed. - Deprecated in version 1.32. - */ - [[deprecated("Define your typedef if needed")]] - typedef FiniteDifferenceModel< - CrankNicolson > - StandardFiniteDifferenceModel; - - QL_DEPRECATED_DISABLE_WARNING - - /*! \deprecated Define your typedef if needed. - Deprecated in version 1.32. - */ - [[deprecated("Define your typedef if needed")]] - typedef FiniteDifferenceModel > > - StandardSystemFiniteDifferenceModel; - - QL_DEPRECATED_ENABLE_WARNING - - /*! \deprecated Define your typedef if needed. - Deprecated in version 1.32. - */ - [[deprecated("Define your typedef if needed")]] - typedef StepCondition StandardStepCondition; - -} +// Deprecated in version 1.37 +#pragma message("Warning: this file is empty and will disappear in a future release; do not include it.") #endif diff --git a/ql/methods/finitedifferences/parallelevolver.hpp b/ql/methods/finitedifferences/parallelevolver.hpp index a293267df8c..a6f67b10060 100644 --- a/ql/methods/finitedifferences/parallelevolver.hpp +++ b/ql/methods/finitedifferences/parallelevolver.hpp @@ -32,98 +32,8 @@ #ifndef quantlib_system_evolver_hpp #define quantlib_system_evolver_hpp -#include -#include -#include -#include - -namespace QuantLib { - - /*! \deprecated Use the new finite-differences framework instead. - Deprecated in version 1.32. - */ - template - class [[deprecated("Use the new finite-differences framework instead")]] StepConditionSet { - typedef ext::shared_ptr > itemType; - std::vector stepConditions_; - public: - void applyTo(std::vector& a, Time t) const { - //#pragma omp parallel for - for (Size i=0; i < stepConditions_.size(); i++) { - stepConditions_[i]->applyTo(a[i], t); - } - } - void push_back(const itemType& a) { - stepConditions_.push_back(a); - } - }; - - template - class BoundaryConditionSet { - std::vector bcSet_; - public: - void push_back(const bc_set& a) { - bcSet_.push_back(a); - } - const bc_set& operator[](Size i) const { - return bcSet_[i]; - } - }; - - /*! \deprecated Use the new finite-differences framework instead. - Deprecated in version 1.32. - */ - template - class [[deprecated("Use the new finite-differences framework instead")]] ParallelEvolverTraits { - public: - typedef std::vector array_type; - typedef std::vector operator_type; - typedef std::vector bc_type; - typedef BoundaryConditionSet bc_set; - QL_DEPRECATED_DISABLE_WARNING - typedef StepConditionSet condition_type; - QL_DEPRECATED_ENABLE_WARNING - }; - - /*! \deprecated Use the new finite-differences framework instead. - Deprecated in version 1.32. - */ - template - class [[deprecated("Use the new finite-differences framework instead")]] ParallelEvolver { - public: - // typedefs - QL_DEPRECATED_DISABLE_WARNING - typedef ParallelEvolverTraits traits; - QL_DEPRECATED_ENABLE_WARNING - typedef typename traits::operator_type operator_type; - typedef typename traits::array_type array_type; - typedef typename traits::bc_set bc_set; - // constructors - ParallelEvolver(const operator_type& L, - const bc_set& bcs) { - evolvers_.reserve(L.size()); - for (Size i=0; i < L.size(); i++) { - evolvers_.push_back(ext::shared_ptr(new - Evolver(L[i], bcs[i]))); - } - } - void step(array_type& a, - Time t) { - //#pragma omp parallel for - for (Size i=0; i < evolvers_.size(); i++) { - evolvers_[i]->step(a[i], t); - } - } - void setStep(Time dt) { - for (Size i=0; i < evolvers_.size(); i++) { - evolvers_[i]->setStep(dt); - } - } - private: - std::vector > evolvers_; - }; - -} +// Deprecated in version 1.37 +#pragma message("Warning: this file is empty and will disappear in a future release; do not include it.") #endif diff --git a/ql/methods/finitedifferences/pde.hpp b/ql/methods/finitedifferences/pde.hpp index b765c2a5103..844a607b28b 100644 --- a/ql/methods/finitedifferences/pde.hpp +++ b/ql/methods/finitedifferences/pde.hpp @@ -29,12 +29,18 @@ #include namespace QuantLib { - class PdeSecondOrderParabolic { + + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. + */ + class [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] PdeSecondOrderParabolic { public: virtual ~PdeSecondOrderParabolic() = default; virtual Real diffusion(Time t, Real x) const = 0; virtual Real drift(Time t, Real x) const = 0; virtual Real discount(Time t, Real x) const = 0; + QL_DEPRECATED_DISABLE_WARNING virtual void generateOperator(Time t, const TransformedGrid& tg, TridiagonalOperator& L) const { for (Size i = 1; i < tg.size() - 1; i++) { @@ -51,8 +57,12 @@ namespace QuantLib { } }; + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. + */ template - class PdeConstantCoeff : public PdeSecondOrderParabolic { + class [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] PdeConstantCoeff : public PdeSecondOrderParabolic { public: PdeConstantCoeff(const typename PdeClass::argument_type &process, Time t, Real x) { @@ -71,8 +81,14 @@ namespace QuantLib { Real discount_; }; + QL_DEPRECATED_ENABLE_WARNING + + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. + */ template - class GenericTimeSetter:public TridiagonalOperator::TimeSetter { + class [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] GenericTimeSetter:public TridiagonalOperator::TimeSetter { public: template GenericTimeSetter(const Array &grid, T process) : @@ -86,17 +102,23 @@ namespace QuantLib { PdeClass pde_; }; + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. + */ template - class PdeOperator:public TridiagonalOperator { + class [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] PdeOperator:public TridiagonalOperator { public: template PdeOperator(const Array& grid, T process, Time residualTime = 0.0) : TridiagonalOperator(grid.size()) { + QL_DEPRECATED_DISABLE_WARNING timeSetter_ = ext::shared_ptr >( new GenericTimeSetter(grid, process)); + QL_DEPRECATED_ENABLE_WARNING setTime(residualTime); } }; diff --git a/ql/methods/finitedifferences/pdebsm.hpp b/ql/methods/finitedifferences/pdebsm.hpp index d04df702573..334e2f1f70d 100644 --- a/ql/methods/finitedifferences/pdebsm.hpp +++ b/ql/methods/finitedifferences/pdebsm.hpp @@ -30,10 +30,15 @@ namespace QuantLib { - class PdeBSM : public PdeSecondOrderParabolic { + QL_DEPRECATED_DISABLE_WARNING + + /*! \deprecated Part of the old FD framework; copy this function + in your codebase if needed. + Deprecated in version 1.37. + */ + class [[deprecated("Part of the old FD framework; copy this function in your codebase if needed")]] PdeBSM : public PdeSecondOrderParabolic { public: - typedef ext::shared_ptr - argument_type; + typedef ext::shared_ptr argument_type; typedef LogGrid grid_type; PdeBSM(argument_type process) : process_(std::move(process)){}; Real diffusion(Time t, Real x) const override { return process_->diffusion(t, x); } @@ -48,6 +53,8 @@ namespace QuantLib { const argument_type process_; }; + QL_DEPRECATED_ENABLE_WARNING + } diff --git a/ql/methods/finitedifferences/shoutcondition.hpp b/ql/methods/finitedifferences/shoutcondition.hpp deleted file mode 100644 index 28f16eaa156..00000000000 --- a/ql/methods/finitedifferences/shoutcondition.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl - Copyright (C) 2003, 2004, 2005 StatPro Italia srl - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -#ifndef quantlib_fd_shout_condition_hpp -#define quantlib_fd_shout_condition_hpp - -// Deprecated in version 1.32 -#pragma message("Warning: this file is empty and will disappear in a future release; do not include it.") - - -#endif diff --git a/ql/models/marketmodels/Makefile.am b/ql/models/marketmodels/Makefile.am index 701c5075664..1826bc55f5f 100644 --- a/ql/models/marketmodels/Makefile.am +++ b/ql/models/marketmodels/Makefile.am @@ -11,7 +11,6 @@ this_include_HEADERS = \ constrainedevolver.hpp \ curvestate.hpp \ discounter.hpp \ - duffsdeviceinnerproduct.hpp \ evolutiondescription.hpp \ evolver.hpp \ forwardforwardmappings.hpp \ @@ -80,7 +79,7 @@ all.hpp: Makefile.am echo "/* This file is automatically generated; do not edit. */" > ${srcdir}/$@ echo "/* Add the files to be included into Makefile.am instead. */" >> ${srcdir}/$@ echo >> ${srcdir}/$@ - for i in $(filter-out all.hpp duffsdeviceinnerproduct.hpp, $(this_include_HEADERS)); do \ + for i in $(filter-out all.hpp, $(this_include_HEADERS)); do \ echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \ done echo >> ${srcdir}/$@ diff --git a/ql/pricingengines/vanilla/Makefile.am b/ql/pricingengines/vanilla/Makefile.am index e9fa5cc3df7..c316b9cf923 100644 --- a/ql/pricingengines/vanilla/Makefile.am +++ b/ql/pricingengines/vanilla/Makefile.am @@ -30,16 +30,13 @@ this_include_HEADERS = \ fdblackscholesvanillaengine.hpp \ fdblackscholesshoutengine.hpp \ fdcevvanillaengine.hpp \ - fddividendengine.hpp \ fdhestonhullwhitevanillaengine.hpp \ fdhestonvanillaengine.hpp \ fdcirvanillaengine.hpp \ fdmultiperiodengine.hpp \ fdsabrvanillaengine.hpp \ fdsimplebsswingengine.hpp \ - fdstepconditionengine.hpp \ - fdvanillaengine.hpp \ - fdconditions.hpp \ + fdvanillaengine.hpp \ mcamericanengine.hpp \ mcdigitalengine.hpp \ mceuropeanengine.hpp \ @@ -49,7 +46,7 @@ this_include_HEADERS = \ mcvanillaengine.hpp \ qdfpamericanengine.hpp \ qdplusamericanengine.hpp - + cpp_files = \ analyticbsmhullwhiteengine.cpp \ analyticdigitalamericanengine.cpp \ @@ -81,7 +78,6 @@ cpp_files = \ fdcirvanillaengine.cpp \ fdsabrvanillaengine.cpp \ fdsimplebsswingengine.cpp \ - fdvanillaengine.cpp \ mcamericanengine.cpp \ mcdigitalengine.cpp \ mchestonhullwhiteengine.cpp \ @@ -114,7 +110,7 @@ all.hpp: Makefile.am echo "/* This file is automatically generated; do not edit. */" > ${srcdir}/$@ echo "/* Add the files to be included into Makefile.am instead. */" >> ${srcdir}/$@ echo >> ${srcdir}/$@ - for i in $(filter-out all.hpp fdconditions.hpp fddividendengine.hpp fdstepconditionengine.hpp, $(this_include_HEADERS)); do \ + for i in $(filter-out all.hpp fdmultiperiodengine.hpp fdvanillaengine.hpp, $(this_include_HEADERS)); do \ echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \ done echo >> ${srcdir}/$@ diff --git a/ql/pricingengines/vanilla/all.hpp b/ql/pricingengines/vanilla/all.hpp index d2db86ead6d..4fc04856115 100644 --- a/ql/pricingengines/vanilla/all.hpp +++ b/ql/pricingengines/vanilla/all.hpp @@ -30,10 +30,8 @@ #include #include #include -#include #include #include -#include #include #include #include diff --git a/ql/pricingengines/vanilla/fdconditions.hpp b/ql/pricingengines/vanilla/fdconditions.hpp deleted file mode 100644 index baf4ca1f22f..00000000000 --- a/ql/pricingengines/vanilla/fdconditions.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2005 Joseph Wang - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -#ifndef quantlib_fd_conditions_hpp -#define quantlib_fd_conditions_hpp - -// Deprecated in version 1.32 -#pragma message("Warning: this file is empty and will disappear in a future release; do not include it.") - - -#endif diff --git a/ql/pricingengines/vanilla/fddividendengine.hpp b/ql/pricingengines/vanilla/fddividendengine.hpp deleted file mode 100644 index 23e051723de..00000000000 --- a/ql/pricingengines/vanilla/fddividendengine.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2005 Joseph Wang - Copyright (C) 2007, 2009 StatPro Italia srl - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -#ifndef quantlib_fd_dividend_engine_hpp -#define quantlib_fd_dividend_engine_hpp - -// Deprecated in version 1.32 -#pragma message("Warning: this file is empty and will disappear in a future release; do not include it.") - - -#endif diff --git a/ql/pricingengines/vanilla/fdmultiperiodengine.hpp b/ql/pricingengines/vanilla/fdmultiperiodengine.hpp index bae66c733d5..59158c45076 100644 --- a/ql/pricingengines/vanilla/fdmultiperiodengine.hpp +++ b/ql/pricingengines/vanilla/fdmultiperiodengine.hpp @@ -18,205 +18,11 @@ FOR A PARTICULAR PURPOSE. See the license for more details. */ -/*! \file fdmultiperiodengine.hpp - \brief base engine for options with events happening at specific times -*/ - #ifndef quantlib_fd_multi_period_engine_hpp #define quantlib_fd_multi_period_engine_hpp -#include -#include -#include -#include -#include - -namespace QuantLib { - - QL_DEPRECATED_DISABLE_WARNING - - /*! \deprecated Use the new finite-differences framework instead. - Deprecated in version 1.32. - */ - template