Skip to content

Commit

Permalink
Merge pull request #786.
Browse files Browse the repository at this point in the history
Remove features deprecated in version 1.15.
  • Loading branch information
lballabio authored Mar 24, 2020
2 parents 3c9c195 + 3aaaafd commit 9bfbf3d
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 264 deletions.
6 changes: 0 additions & 6 deletions ql/cashflows/cpicouponpricer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ namespace QuantLib {

CPICouponPricer::CPICouponPricer() {}

CPICouponPricer::CPICouponPricer(
const Handle<CPIVolatilitySurface>& capletVol)
: capletVol_(capletVol) {
registerWith(capletVol_);
}

CPICouponPricer::CPICouponPricer(
const Handle<CPIVolatilitySurface>& capletVol,
const Handle<YieldTermStructure>& nominalTermStructure)
Expand Down
6 changes: 0 additions & 6 deletions ql/cashflows/cpicouponpricer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ namespace QuantLib {
class CPICouponPricer : public InflationCouponPricer {
public:
CPICouponPricer();
/*! \deprecated Use the constructor also taking an explicit
nominal term structure.
Deprecated in version 1.15.
*/
QL_DEPRECATED
explicit CPICouponPricer(const Handle<CPIVolatilitySurface>& capletVol);
CPICouponPricer(const Handle<CPIVolatilitySurface>& capletVol,
const Handle<YieldTermStructure>& nominalTermStructure);

Expand Down
8 changes: 0 additions & 8 deletions ql/cashflows/inflationcouponpricer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ namespace QuantLib {

YoYInflationCouponPricer::YoYInflationCouponPricer() {}

YoYInflationCouponPricer::YoYInflationCouponPricer(
const Handle<YoYOptionletVolatilitySurface>& capletVol)
: capletVol_(capletVol) {
registerWith(capletVol_);
}

YoYInflationCouponPricer::YoYInflationCouponPricer(
const Handle<YoYOptionletVolatilitySurface>& capletVol,
const Handle<YieldTermStructure>& nominalTermStructure)
Expand Down Expand Up @@ -207,6 +201,4 @@ namespace QuantLib {
stdDev);
}



}
31 changes: 0 additions & 31 deletions ql/cashflows/inflationcouponpricer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ namespace QuantLib {
class YoYInflationCouponPricer : public InflationCouponPricer {
public:
YoYInflationCouponPricer();
/*! \deprecated Use the constructor also taking an explicit
nominal term structure.
Deprecated in version 1.15.
*/
QL_DEPRECATED
explicit YoYInflationCouponPricer(
const Handle<YoYOptionletVolatilitySurface>& capletVol);
YoYInflationCouponPricer(
const Handle<YoYOptionletVolatilitySurface>& capletVol,
const Handle<YieldTermStructure>& nominalTermStructure);
Expand Down Expand Up @@ -145,14 +138,6 @@ namespace QuantLib {
class BlackYoYInflationCouponPricer : public YoYInflationCouponPricer {
public:
BlackYoYInflationCouponPricer() {}
/*! \deprecated Use the constructor also taking an explicit
nominal term structure.
Deprecated in version 1.15.
*/
QL_DEPRECATED
explicit BlackYoYInflationCouponPricer(
const Handle<YoYOptionletVolatilitySurface>& capletVol)
: YoYInflationCouponPricer(capletVol, Handle<YieldTermStructure>()) {}
BlackYoYInflationCouponPricer(
const Handle<YoYOptionletVolatilitySurface>& capletVol,
const Handle<YieldTermStructure>& nominalTermStructure)
Expand All @@ -167,14 +152,6 @@ namespace QuantLib {
class UnitDisplacedBlackYoYInflationCouponPricer : public YoYInflationCouponPricer {
public:
UnitDisplacedBlackYoYInflationCouponPricer() {}
/*! \deprecated Use the constructor also taking an explicit
nominal term structure.
Deprecated in version 1.15.
*/
QL_DEPRECATED
explicit UnitDisplacedBlackYoYInflationCouponPricer(
const Handle<YoYOptionletVolatilitySurface>& capletVol)
: YoYInflationCouponPricer(capletVol, Handle<YieldTermStructure>()) {}
UnitDisplacedBlackYoYInflationCouponPricer(
const Handle<YoYOptionletVolatilitySurface>& capletVol,
const Handle<YieldTermStructure>& nominalTermStructure)
Expand All @@ -189,14 +166,6 @@ namespace QuantLib {
class BachelierYoYInflationCouponPricer : public YoYInflationCouponPricer {
public:
BachelierYoYInflationCouponPricer() {}
/*! \deprecated Use the constructor also taking an explicit
nominal term structure.
Deprecated in version 1.15.
*/
QL_DEPRECATED
explicit BachelierYoYInflationCouponPricer(
const Handle<YoYOptionletVolatilitySurface>& capletVol)
: YoYInflationCouponPricer(capletVol, Handle<YieldTermStructure>()) {}
BachelierYoYInflationCouponPricer(
const Handle<YoYOptionletVolatilitySurface>& capletVol,
const Handle<YieldTermStructure>& nominalTermStructure)
Expand Down
14 changes: 0 additions & 14 deletions ql/instruments/makeyoyinflationcapfloor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,6 @@ namespace QuantLib {
nominal_(1000000.0)
{}

MakeYoYInflationCapFloor::MakeYoYInflationCapFloor(
YoYInflationCapFloor::Type capFloorType,
const Size& length, const Calendar& cal,
const ext::shared_ptr<YoYInflationIndex>& index,
const Period& observationLag, Rate strike,
const Period& forwardStart)
: capFloorType_(capFloorType), length_(length),
calendar_(cal), index_(index), observationLag_(observationLag),
strike_(strike), firstCapletExcluded_(false),
asOptionlet_(false), effectiveDate_(Date()), forwardStart_(forwardStart),
dayCounter_(Thirty360()), roll_(ModifiedFollowing), fixingDays_(0),
nominal_(1000000.0)
{}

MakeYoYInflationCapFloor::operator YoYInflationCapFloor() const {
ext::shared_ptr<YoYInflationCapFloor> capfloor = *this;
return *capfloor;
Expand Down
16 changes: 0 additions & 16 deletions ql/instruments/makeyoyinflationcapfloor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,6 @@ namespace QuantLib {
const ext::shared_ptr<YoYInflationIndex>& index,
const Size& length, const Calendar& cal,
const Period& observationLag);
/*! \deprecated Use the other constructor. In order to
specify the strike, you'll have to call either
withStrike (with an explicit strike) or
withAtmStrike (to get a strike at the money on
the passed nominal term structure). In order
to specify a forward start, you'll have to call
withForwardStart.
Deprecated in version 1.15.
*/
QL_DEPRECATED
MakeYoYInflationCapFloor(
YoYInflationCapFloor::Type capFloorType,
const Size& length, const Calendar& cal,
const ext::shared_ptr<YoYInflationIndex>& index,
const Period& observationLag, Rate strike = Null<Rate>(),
const Period& forwardStart=0*Days);
MakeYoYInflationCapFloor& withNominal(Real n);
MakeYoYInflationCapFloor& withEffectiveDate(const Date& effectiveDate);
MakeYoYInflationCapFloor& withFirstCapletExcluded();
Expand Down
36 changes: 0 additions & 36 deletions ql/pricingengines/inflation/inflationcapfloorengines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ namespace QuantLib {
}


YoYInflationCapFloorEngine::YoYInflationCapFloorEngine(
const ext::shared_ptr<YoYInflationIndex>& index,
const Handle<YoYOptionletVolatilitySurface>& volatility)
: index_(index), volatility_(volatility) {
registerWith(index_);
registerWith(volatility_);
}


void YoYInflationCapFloorEngine::setVolatility(
const Handle<YoYOptionletVolatilitySurface> &v) {
if (!volatility_.empty())
Expand Down Expand Up @@ -150,12 +141,6 @@ namespace QuantLib {
const Handle<YieldTermStructure>& nominalTermStructure)
: YoYInflationCapFloorEngine(index, volatility, nominalTermStructure) {}

YoYInflationBlackCapFloorEngine::YoYInflationBlackCapFloorEngine(
const ext::shared_ptr<YoYInflationIndex>& index,
const Handle<YoYOptionletVolatilitySurface>& volatility)
: YoYInflationCapFloorEngine(index, volatility,
Handle<YieldTermStructure>()) {}


Real YoYInflationBlackCapFloorEngine::optionletImpl(Option::Type type, Rate strike,
Rate forward, Real stdDev,
Expand All @@ -174,13 +159,6 @@ namespace QuantLib {
const Handle<YieldTermStructure>& nominalTermStructure)
: YoYInflationCapFloorEngine(index, volatility, nominalTermStructure) {}

YoYInflationUnitDisplacedBlackCapFloorEngine
::YoYInflationUnitDisplacedBlackCapFloorEngine(
const ext::shared_ptr<YoYInflationIndex>& index,
const Handle<YoYOptionletVolatilitySurface>& volatility)
: YoYInflationCapFloorEngine(index, volatility,
Handle<YieldTermStructure>()) {}


Real YoYInflationUnitDisplacedBlackCapFloorEngine::optionletImpl(
Option::Type type, Rate strike,
Expand All @@ -199,12 +177,6 @@ namespace QuantLib {
const Handle<YieldTermStructure>& nominalTermStructure)
: YoYInflationCapFloorEngine(index, volatility, nominalTermStructure) {}

YoYInflationBachelierCapFloorEngine::YoYInflationBachelierCapFloorEngine(
const ext::shared_ptr<YoYInflationIndex>& index,
const Handle<YoYOptionletVolatilitySurface>& volatility)
: YoYInflationCapFloorEngine(index, volatility,
Handle<YieldTermStructure>()) {}


Real YoYInflationBachelierCapFloorEngine::optionletImpl(Option::Type type, Rate strike,
Rate forward, Real stdDev,
Expand All @@ -214,13 +186,5 @@ namespace QuantLib {
forward, stdDev, d);
}









}

27 changes: 0 additions & 27 deletions ql/pricingengines/inflation/inflationcapfloorengines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ namespace QuantLib {
YoYInflationCapFloorEngine(const ext::shared_ptr<YoYInflationIndex>&,
const Handle<YoYOptionletVolatilitySurface>& vol,
const Handle<YieldTermStructure>& nominalTermStructure);
/*! \deprecated Use the constructor with an explicit nominal curve.
Deprecated in version 1.15.
*/
QL_DEPRECATED
YoYInflationCapFloorEngine(const ext::shared_ptr<YoYInflationIndex>&,
const Handle<YoYOptionletVolatilitySurface>& vol);

ext::shared_ptr<YoYInflationIndex> index() const { return index_;}
Handle<YoYOptionletVolatilitySurface> volatility() const { return volatility_; }
Expand Down Expand Up @@ -79,13 +73,6 @@ namespace QuantLib {
YoYInflationBlackCapFloorEngine(const ext::shared_ptr<YoYInflationIndex>&,
const Handle<YoYOptionletVolatilitySurface>& vol,
const Handle<YieldTermStructure>& nominalTermStructure);
/*! \deprecated Use the constructor with an explicit nominal curve.
Deprecated in version 1.15.
*/
QL_DEPRECATED
YoYInflationBlackCapFloorEngine(const ext::shared_ptr<YoYInflationIndex>&,
const Handle<YoYOptionletVolatilitySurface>&);

protected:
virtual Real optionletImpl(Option::Type, Real strike,
Real forward, Real stdDev,
Expand All @@ -101,13 +88,6 @@ namespace QuantLib {
const ext::shared_ptr<YoYInflationIndex>&,
const Handle<YoYOptionletVolatilitySurface>& vol,
const Handle<YieldTermStructure>& nominalTermStructure);
/*! \deprecated Use the constructor with an explicit nominal curve.
Deprecated in version 1.15.
*/
QL_DEPRECATED
YoYInflationUnitDisplacedBlackCapFloorEngine(
const ext::shared_ptr<YoYInflationIndex>&,
const Handle<YoYOptionletVolatilitySurface>&);
protected:
virtual Real optionletImpl(Option::Type, Real strike,
Real forward, Real stdDev,
Expand All @@ -123,13 +103,6 @@ namespace QuantLib {
const ext::shared_ptr<YoYInflationIndex>&,
const Handle<YoYOptionletVolatilitySurface>& vol,
const Handle<YieldTermStructure>& nominalTermStructure);
/*! \deprecated Use the constructor with an explicit nominal curve.
Deprecated in version 1.15.
*/
QL_DEPRECATED
YoYInflationBachelierCapFloorEngine(
const ext::shared_ptr<YoYInflationIndex>&,
const Handle<YoYOptionletVolatilitySurface>&);
protected:
virtual Real optionletImpl(Option::Type, Real strike,
Real forward, Real stdDev,
Expand Down
97 changes: 0 additions & 97 deletions ql/termstructures/inflation/inflationhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,53 +74,6 @@ namespace QuantLib {
}


ZeroCouponInflationSwapHelper::ZeroCouponInflationSwapHelper(
const Handle<Quote>& quote,
const Period& swapObsLag, // <= index availability lag
const Date& maturity,
const Calendar& calendar, // index may have null calendar as valid on every day
BusinessDayConvention paymentConvention,
const DayCounter& dayCounter,
const ext::shared_ptr<ZeroInflationIndex>& zii)
: BootstrapHelper<ZeroInflationTermStructure>(quote),
swapObsLag_(swapObsLag), maturity_(maturity), calendar_(calendar),
paymentConvention_(paymentConvention), dayCounter_(dayCounter),
zii_(zii) {

if (zii_->interpolated()) {
// if interpolated then simple
earliestDate_ = maturity_ - swapObsLag_;
latestDate_ = maturity_ - swapObsLag_;
} else {
// but if NOT interpolated then the value is valid
// for every day in an inflation period so you actually
// get an extended validity, however for curve building
// just put the first date because using that convention
// for the base date throughout
std::pair<Date,Date> limStart = inflationPeriod(maturity_ - swapObsLag_,
zii_->frequency());
earliestDate_ = limStart.first;
latestDate_ = limStart.first;
}

// check that the observation lag of the swap
// is compatible with the availability lag of the index AND
// it's interpolation (assuming the start day is spot)
if (zii_->interpolated()) {
Period pShift(zii_->frequency());
QL_REQUIRE(swapObsLag_ - pShift > zii_->availabilityLag(),
"inconsistency between swap observation of index "
<< swapObsLag_ <<
" index availability " << zii_->availabilityLag() <<
" index period " << pShift <<
" and index availability " << zii_->availabilityLag() <<
" need (obsLag-index period) > availLag");
}

registerWith(Settings::instance().evaluationDate());
}


Real ZeroCouponInflationSwapHelper::impliedQuote() const {
// what does the term structure imply?
// in this case just the same value ... trivial case
Expand Down Expand Up @@ -213,57 +166,7 @@ namespace QuantLib {
}


YearOnYearInflationSwapHelper::YearOnYearInflationSwapHelper(
const Handle<Quote>& quote,
const Period& swapObsLag,
const Date& maturity,
const Calendar& calendar,
BusinessDayConvention paymentConvention,
const DayCounter& dayCounter,
const ext::shared_ptr<YoYInflationIndex>& yii)
: BootstrapHelper<YoYInflationTermStructure>(quote),
swapObsLag_(swapObsLag), maturity_(maturity),
calendar_(calendar), paymentConvention_(paymentConvention),
dayCounter_(dayCounter), yii_(yii) {

if (yii_->interpolated()) {
// if interpolated then simple
earliestDate_ = maturity_ - swapObsLag_;
latestDate_ = maturity_ - swapObsLag_;
} else {
// but if NOT interpolated then the value is valid
// for every day in an inflation period so you actually
// get an extended validity, however for curve building
// just put the first date because using that convention
// for the base date throughout
std::pair<Date,Date> limStart = inflationPeriod(maturity_ - swapObsLag_,
yii_->frequency());
earliestDate_ = limStart.first;
latestDate_ = limStart.first;
}

// check that the observation lag of the swap
// is compatible with the availability lag of the index AND
// it's interpolation (assuming the start day is spot)
if (yii_->interpolated()) {
Period pShift(yii_->frequency());
QL_REQUIRE(swapObsLag_ - pShift > yii_->availabilityLag(),
"inconsistency between swap observation of index "
<< swapObsLag_ <<
" index availability " << yii_->availabilityLag() <<
" index period " << pShift <<
" and index availability " << yii_->availabilityLag() <<
" need (obsLag-index period) > availLag");
}

registerWith(Settings::instance().evaluationDate());
}


Real YearOnYearInflationSwapHelper::impliedQuote() const {
// what does the term structure imply?
// in this case just the same value ... trivial case
// (would not be so for an inflation-linked bond)
yyiis_->recalculate();
return yyiis_->fairRate();
}
Expand Down
Loading

0 comments on commit 9bfbf3d

Please sign in to comment.