27 const ext::shared_ptr<CappedFlooredCoupon> &underlying)
29 underlying->date(), underlying->nominal(),
30 underlying->accrualStartDate(), underlying->accrualEndDate(),
31 underlying->fixingDays(), underlying->index(),
32 underlying->gearing(), underlying->spread(),
33 underlying->referencePeriodStart(),
34 underlying->referencePeriodEnd(), underlying->dayCounter(),
35 underlying->isInArrears()),
36 underlying_(underlying) {
48 Rate floorletRate = 0.0;
50 floorletRate =
underlying_->underlying()->pricer()->floorletRate(
52 Rate capletRate = 0.0;
61 Real(floorletRate - capletRate) :
62 Real(floorletRate + capletRate);
110 const ext::shared_ptr<FloatingRateCouponPricer> &pricer) {
116 : underlyingLeg_(
std::move(underlyingLeg)) {}
118 StrippedCappedFlooredCouponLeg::operator
Leg()
const {
120 resultLeg.reserve(underlyingLeg_.size());
121 ext::shared_ptr<CappedFlooredCoupon> c;
122 for (
const auto& i : underlyingLeg_) {
123 if ((c = ext::dynamic_pointer_cast<CappedFlooredCoupon>(i)) !=
nullptr) {
125 ext::make_shared<StrippedCappedFlooredCoupon>(c));
127 resultLeg.push_back(i);
degenerate base class for the Acyclic Visitor pattern
base floating-rate coupon class
virtual void setPricer(const ext::shared_ptr< FloatingRateCouponPricer > &)
void accept(AcyclicVisitor &) override
ext::shared_ptr< FloatingRateCouponPricer > pricer() const
virtual void calculate() const
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
void performCalculations() const override
void deepUpdate() override
StrippedCappedFlooredCoupon(const ext::shared_ptr< CappedFlooredCoupon > &underlying)
Rate rate() const override
Coupon interface.
void accept(AcyclicVisitor &) override
Visitability.
void setPricer(const ext::shared_ptr< FloatingRateCouponPricer > &pricer) override
Rate effectiveCap() const
effective cap
Rate effectiveFloor() const
effective floor
ext::shared_ptr< CappedFlooredCoupon > underlying_
Rate convexityAdjustment() const override
convexity adjustment
StrippedCappedFlooredCouponLeg(Leg underlyingLeg)
Visitor for a specific class
virtual void visit(T &)=0
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
ext::shared_ptr< BlackVolTermStructure > v
strips the embedded option from cap floored coupons