From 0f5b47c6e6b6b7f48808840c771517b98cf64304 Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Mon, 20 Jul 2020 14:26:59 +0200 Subject: [PATCH] Remove features deprecated in version 1.16 --- .../operators/fdmornsteinuhlenbeckop.cpp | 30 ------------ .../operators/fdmornsteinuhlenbeckop.hpp | 11 ----- .../volatility/swaption/swaptionvolmatrix.cpp | 47 ------------------- .../volatility/swaption/swaptionvolmatrix.hpp | 13 ----- 4 files changed, 101 deletions(-) diff --git a/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.cpp b/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.cpp index 595ba032d16..29c61065d2b 100644 --- a/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.cpp +++ b/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.cpp @@ -59,36 +59,6 @@ namespace QuantLib { *Array(mesher->layout()->size(), 1.0)), Array()); } - FdmOrnsteinUhlenbeckOp::FdmOrnsteinUhlenbeckOp( - const ext::shared_ptr& mesher, - const ext::shared_ptr& process, - const ext::shared_ptr& rTS, - const FdmBoundaryConditionSet&, - Size direction) - : mesher_ (mesher), - process_ (process), - rTS_ (rTS), - direction_(direction), - m_ (direction, mesher), - mapX_ (direction, mesher) { - - const ext::shared_ptr layout=mesher_->layout(); - - Array drift(layout->size()); - const Array x(mesher_->locations(direction)); - - for (FdmLinearOpIterator iter=layout->begin(), endIter=layout->end(); - iter!=endIter; ++iter) { - const Size i = iter.index(); - drift[i] = process_->drift(0.0, x[i]); - } - - m_.axpyb(drift, FirstDerivativeOp(direction, mesher), - SecondDerivativeOp(direction, mesher) - .mult(0.5*square()(process_->volatility()) - *Array(mesher->layout()->size(), 1.0)), Array()); - } - Size FdmOrnsteinUhlenbeckOp::size() const { return mesher_->layout()->dim().size();; } diff --git a/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.hpp b/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.hpp index bc69a10f38c..de90277a7d3 100644 --- a/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.hpp +++ b/ql/methods/finitedifferences/operators/fdmornsteinuhlenbeckop.hpp @@ -44,17 +44,6 @@ namespace QuantLib { const ext::shared_ptr& rTS, Size direction = 0); - /*! \deprecated use the other constructor. - Deprecated in version 1.16. - */ - QL_DEPRECATED - FdmOrnsteinUhlenbeckOp( - const ext::shared_ptr& mesher, - const ext::shared_ptr& p, - const ext::shared_ptr& rTS, - const FdmBoundaryConditionSet& bcSet, - Size direction = 0); - Size size() const; void setTime(Time t1, Time t2); diff --git a/ql/termstructures/volatility/swaption/swaptionvolmatrix.cpp b/ql/termstructures/volatility/swaption/swaptionvolmatrix.cpp index 7b8839e1ff0..e95d1c46f51 100644 --- a/ql/termstructures/volatility/swaption/swaptionvolmatrix.cpp +++ b/ql/termstructures/volatility/swaption/swaptionvolmatrix.cpp @@ -254,53 +254,6 @@ namespace QuantLib { } - SwaptionVolatilityMatrix::SwaptionVolatilityMatrix( - const Date& today, - const std::vector& optionDates, - const std::vector& swapT, - const Matrix& vols, - const DayCounter& dc, - const bool flatExtrapolation, - const VolatilityType type, - const Matrix& shifts) - : SwaptionVolatilityDiscrete(optionDates, swapT, today, Calendar(), Following, dc), - volHandles_(vols.rows()), shiftValues_(vols.rows()), - volatilities_(vols.rows(), vols.columns()), - shifts_(shifts.rows(),shifts.columns(),0.0), volatilityType_(type) { - - checkInputs(vols.rows(), vols.columns(), shifts.rows(), shifts.columns()); - - // fill dummy handles to allow generic handle-based - // computations later on - for (Size i=0; i(ext::shared_ptr(new - SimpleQuote(vols[i][j]))); - shiftValues_[i][j] = shifts.rows() > 0 ? shifts[i][j] : 0.0; - } - } - if (flatExtrapolation) { - interpolation_ = - FlatExtrapolator2D(ext::make_shared( - swapLengths_.begin(), swapLengths_.end(), - optionTimes_.begin(), optionTimes_.end(), volatilities_)); - interpolationShifts_ = - FlatExtrapolator2D(ext::make_shared( - swapLengths_.begin(), swapLengths_.end(), - optionTimes_.begin(), optionTimes_.end(), shifts_)); - } else { - interpolation_ = BilinearInterpolation( - swapLengths_.begin(), swapLengths_.end(), optionTimes_.begin(), - optionTimes_.end(), volatilities_); - interpolationShifts_ = BilinearInterpolation( - swapLengths_.begin(), swapLengths_.end(), optionTimes_.begin(), - optionTimes_.end(), shifts_); - } - } - - void SwaptionVolatilityMatrix::checkInputs(Size volRows, Size volsColumns, Size shiftRows, diff --git a/ql/termstructures/volatility/swaption/swaptionvolmatrix.hpp b/ql/termstructures/volatility/swaption/swaptionvolmatrix.hpp index b69556e2825..8aa24f8bbad 100644 --- a/ql/termstructures/volatility/swaption/swaptionvolmatrix.hpp +++ b/ql/termstructures/volatility/swaption/swaptionvolmatrix.hpp @@ -107,19 +107,6 @@ namespace QuantLib { bool flatExtrapolation = false, VolatilityType type = ShiftedLognormal, const Matrix& shifts = Matrix()); - /*! \deprecated Use the constructor also taking a calendar and - business-day convention instead. - Deprecated in version 1.16. - */ - QL_DEPRECATED - SwaptionVolatilityMatrix(const Date& referenceDate, - const std::vector& optionDates, - const std::vector& swapTenors, - const Matrix& volatilities, - const DayCounter& dayCounter, - bool flatExtrapolation = false, - VolatilityType type = ShiftedLognormal, - const Matrix& shifts = Matrix()); //! \name LazyObject interface //@{