31 const ext::optional<bool>& includeSettlementDateFlows,
42 "discounting term structure handle is empty");
51 settlementDate = refDate;
54 "settlement date (" << settlementDate <<
") before "
55 "discount curve reference date (" << refDate <<
")");
63 "npv date (" <<
npvDate_ <<
") before "
64 "discount curve reference date (" << refDate <<
")");
78 for (
Size i=0; i<
n; ++i) {
107 }
catch (std::exception &e) {
bool includeSettlementDateFlows_
const YieldTermStructure & discountCurve_
Cash-flow analysis functions.
static Date maturityDate(const Leg &leg)
static Date startDate(const Leg &leg)
static std::pair< Real, Real > npvbps(const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
NPV and BPS of the cash flows.
Handle< YieldTermStructure > discountCurve_
DiscountingSwapEngine(Handle< YieldTermStructure > discountCurve=Handle< YieldTermStructure >(), const ext::optional< bool > &includeSettlementDateFlows=ext::nullopt, Date settlementDate=Date(), Date npvDate=Date())
ext::optional< bool > includeSettlementDateFlows_
void calculate() const override
Swap::arguments arguments_
Shared handle to an observable.
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
bool & includeReferenceDateEvents()
static Settings & instance()
access to the unique instance
std::vector< Real > payer
std::vector< Real > legBPS
DiscountFactor npvDateDiscount
std::vector< DiscountFactor > endDiscounts
std::vector< DiscountFactor > startDiscounts
std::vector< Real > legNPV
Interest-rate term structure.
#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)
detail::ordinal_holder ordinal(Size)
outputs naturals as 1st, 2nd, 3rd...
std::size_t Size
size of a container
Maps optional to either the boost or std implementation.