QuantLib_Swap man page

Swap — Interest rate swap.  

Synopsis

#include <ql/instruments/swap.hpp>

Inherits Instrument.

Inherited by ArithmeticAverageOIS, AssetSwap, BMASwap, CPISwap, FloatFloatSwap, IrregularSwap, NonstandardSwap, OvernightIndexedSwap, VanillaSwap, YearOnYearInflationSwap, and ZeroCouponInflationSwap.

Public Member Functions

Additional interface

Date startDate () const
Date maturityDate () const
Real legBPS (Size j) const
Real legNPV (Size j) const
DiscountFactor startDiscounts (Size j) const
DiscountFactor endDiscounts (Size j) const
DiscountFactor npvDateDiscount () const
const Leg & leg (Size j) const

Protected Attributes

std::vector< Leg > legs_
std::vector< Real > payer_
std::vector< Real > legNPV_
std::vector< Real > legBPS_
std::vector< DiscountFactor > startDiscounts_
std::vector< DiscountFactor > endDiscounts_
DiscountFactor npvDateDiscount_

Constructors

Swap (const Leg &firstLeg, const Leg &secondLeg)
Swap (const std::vector< Leg > &legs, const std::vector< bool > &payer)
Swap (Size legs)

Instrument interface

bool isExpired () const
returns whether the instrument might have value greater than zero.
void setupArguments (PricingEngine::arguments *) const
void fetchResults (const PricingEngine::results *) const
void setupExpired () const

Additional Inherited Members

Detailed Description

Interest rate swap.

The cash flows belonging to the first leg are paid; the ones belonging to the second leg are received.

Constructor & Destructor Documentation

Swap (const Leg & firstLeg, const Leg & secondLeg)

The cash flows belonging to the first leg are paid; the ones belonging to the second leg are received.

Swap (const std::vector< Leg > & legs, const std::vector< bool > & payer)

Multi leg constructor.

Swap (Size legs) [protected]

This constructor can be used by derived classes that will build their legs themselves.

Member Function Documentation

void setupArguments (PricingEngine::arguments *) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overridden to fill it. This is mandatory in case a pricing engine is used.

Reimplemented from Instrument.

Reimplemented in ZeroCouponInflationSwap, VanillaSwap, and YearOnYearInflationSwap.

void fetchResults (const PricingEngine::results * r) const [virtual]

When a derived result structure is defined for an instrument, this method should be overridden to read from it. This is mandatory in case a pricing engine is used.

Reimplemented from Instrument.

Reimplemented in ZeroCouponInflationSwap, VanillaSwap, and YearOnYearInflationSwap.

void setupExpired () const [protected], [virtual]

This method must leave the instrument in a consistent state when the expiration condition is met.

Reimplemented from Instrument.

Author

Generated automatically by Doxygen for QuantLib from the source code.

Referenced By

endDiscounts(3), endDiscounts_(3), leg(3), legBPS(3), legBPS_(3), legNPV(3), legNPV_(3), legs_(3), npvDateDiscount(3), npvDateDiscount_(3), payer_(3), startDiscounts(3), startDiscounts_(3) and Swap(3) are aliases of QuantLib_Swap(3).

Fri Feb 10 2017 Version 1.9.1 QuantLib