38 :
Swap(2), type_(type) {
51 QL_FAIL(
"Unknown Irregular-swap type");
57 for (Leg::const_iterator i =
legs_[0].begin(); i <
legs_[0].end(); ++i)
63 for (Leg::const_iterator i =
legs_[1].begin(); i <
legs_[1].end(); ++i)
90 for (
Size i=0; i<fixedCoupons.size(); ++i) {
91 ext::shared_ptr<FixedRateCoupon> coupon =
92 ext::dynamic_pointer_cast<FixedRateCoupon>(fixedCoupons[i]);
109 for (
Size i=0; i<floatingCoupons.size(); ++i) {
110 ext::shared_ptr<IborCoupon> coupon =
111 ext::dynamic_pointer_cast<IborCoupon>(floatingCoupons[i]);
203 "number of fixed start dates different from "
204 "number of fixed payment dates");
206 "number of fixed payment dates different from "
207 "number of fixed coupon amounts");
209 "number of floating start dates different from "
210 "number of floating payment dates");
212 "number of floating fixing dates different from "
213 "number of floating payment dates");
215 "number of floating accrual Times different from "
216 "number of floating payment dates");
218 "number of floating spreads different from "
219 "number of floating payment dates");
221 "number of floating payment dates different from "
222 "number of floating coupon amounts");
Cash-flow analysis functions.
Cash flow vector builders.
void calculate() const override
Arguments for irregular-swap calculation
std::vector< Date > floatingResetDates
std::vector< Real > floatingNominals
std::vector< Spread > floatingSpreads
std::vector< Real > fixedNominals
std::vector< Date > floatingFixingDates
std::vector< Date > fixedPayDates
std::vector< Date > fixedResetDates
void validate() const override
std::vector< Real > floatingCoupons
std::vector< Time > floatingAccrualTimes
std::vector< Real > fixedCoupons
std::vector< Date > floatingPayDates
Results from irregular-swap calculation
const Leg & floatingLeg() const
IrregularSwap(Type type, const Leg &fixLeg, const Leg &floatLeg)
Spread fairSpread() const
Real floatingLegBPS() const
void setupArguments(PricingEngine::arguments *args) const override
const Leg & fixedLeg() const
void setupExpired() const override
Real floatingLegNPV() const
void fetchResults(const PricingEngine::results *) const override
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
void validate() const override
void setupArguments(PricingEngine::arguments *) const override
std::vector< Real > legNPV_
std::vector< Real > legBPS_
void setupExpired() const override
void fetchResults(const PricingEngine::results *) const override
std::vector< Real > payer_
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Coupon paying a fixed annual rate.
Real Spread
spreads on interest rates
std::size_t Size
size of a container
Coupon paying a Libor-type index.
base class for Inter-Bank-Offered-Rate indexes
Irregular fixed-rate vs Libor swap.
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
ext::shared_ptr< YieldTermStructure > r
Interest-rate term structure.