43 {
45 results_.errorEstimate = Null<Real>();
46
47 QL_REQUIRE(!
fx_.empty(),
"fx handle not set");
48 QL_REQUIRE(!
ts1_.empty(),
"ts1 handle not set");
49 QL_REQUIRE(!
ts2_.empty(),
"ts2 handle not set");
50
51 QL_REQUIRE(
ts1_->referenceDate() ==
ts2_->referenceDate(),
"reference dates do not match");
52
53 Date npvDate = Settings::instance().evaluationDate();
54
56
59
60 bool includeRefDateFlows = Settings::instance().includeReferenceDateEvents();
61
62 for (Size i = 0; i <
arguments_.legs.size(); ++i) {
63 try {
64 Handle<YieldTermStructure> yts;
69 } else {
72 }
74 CashFlows::npv(
arguments_.legs[i], **yts, includeRefDateFlows, npvDate, npvDate);
76 CashFlows::bps(
arguments_.legs[i], **yts, includeRefDateFlows, npvDate, npvDate);
77 } catch (std::exception& e) {
78 QL_FAIL(io::ordinal(i + 1) << " leg: " << e.what());
79 }
81 }
82
83 static Spread basisPoint = 1.0e-4;
86}
const Instrument::results * results_
Swap::arguments * arguments_