_Z11fuzzedRatesR18FuzzedDataProviderm:
   33|    344|std::vector<Real> fuzzedRates(FuzzedDataProvider& fdp, const size_t length) {
   34|    344|    std::vector<Real> result;
   35|  80.1k|    for (size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (35:24): [True: 79.8k, False: 344]
  ------------------
   36|  79.8k|        result.push_back(fdp.ConsumeProbability<Real>());
   37|  79.8k|    }
   38|    344|    return result;
   39|    344|}
LLVMFuzzerTestOneInput:
   41|    344|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {
   42|    344|    FuzzedDataProvider fdp(Data, Size);
   43|       |    // Ensure settings are reset each iteration of the fuzzing loop.
   44|       |    // NOTE: this class manages the settings singleton using default
   45|       |    // (con/des)tructors.
   46|    344|    SavedSettings saved_settings;
   47|       |
   48|    344|    constexpr size_t kMaxSize = 512;
   49|    344|    auto length = fdp.ConsumeIntegralInRange<size_t>(0, kMaxSize);
   50|       |
   51|    344|    Date refDate = Settings::instance().evaluationDate();
   52|       |
   53|    344|    auto rates = fuzzedRates(fdp, length);
   54|    344|    Frequency freq = Monthly;
   55|       |
   56|  80.1k|    for (size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (56:24): [True: 79.8k, False: 344]
  ------------------
   57|       |
   58|  79.8k|        auto schedule = sinkingSchedule(refDate, Period(30, Years), freq, NullCalendar());
   59|  79.8k|        auto notionals = sinkingNotionals(Period(30, Years), freq, rates[i], 100.0);
   60|       |
   61|  79.8k|        AmortizingFixedRateBond myBond(0, notionals, schedule, {rates[i]},
   62|  79.8k|                                       ActualActual(ActualActual::ISMA));
   63|       |
   64|  79.8k|        Leg cashflows = myBond.cashflows();
   65|       |
   66|  79.8k|        Real lastTotalAmount = 0.0;
   67|  28.8M|        for (size_t k = 0; k < cashflows.size() / 2; ++k) {
  ------------------
  |  Branch (67:28): [True: 28.7M, False: 79.8k]
  ------------------
   68|  28.7M|            Real coupon = cashflows[2 * k]->amount();
   69|  28.7M|            Real principal = cashflows[2 * k + 1]->amount();
   70|  28.7M|            Real totalAmount = coupon + principal;
   71|       |            // Assert invariants, these should always be true.
   72|  28.7M|            assert(coupon > 0.0);
   73|  28.7M|            assert(principal > 0.0);
   74|  28.7M|            assert(totalAmount > lastTotalAmount);
   75|  28.7M|            lastTotalAmount = totalAmount;
   76|  28.7M|            _unused(lastTotalAmount);
  ------------------
  |  |   29|  28.7M|#define _unused(x) ((void)(x))
  ------------------
   77|  28.7M|        }
   78|  79.8k|    }
   79|    344|    return 0;
   80|    344|}

_ZNK8QuantLib12earlier_thanINS_8CashFlowEEclERKS1_S4_:
   83|   273M|                        const CashFlow& c2) const {
   84|   273M|            return c1.date() < c2.date();
   85|   273M|        }
_ZN8QuantLib8CashFlowD2Ev:
   42|  57.4M|        ~CashFlow() override = default;

_ZN8QuantLib6CouponC2ERKNS_4DateEdS3_S3_S3_S3_S3_:
   34|  28.7M|    : paymentDate_(paymentDate), nominal_(nominal), 
   35|  28.7M|      accrualStartDate_(accrualStartDate), accrualEndDate_(accrualEndDate),
   36|  28.7M|      refPeriodStart_(refPeriodStart), refPeriodEnd_(refPeriodEnd),
   37|  28.7M|      exCouponDate_(exCouponDate), accrualPeriod_(Null<Real>()) {
   38|  28.7M|        if (refPeriodStart_ == Date())
  ------------------
  |  Branch (38:13): [True: 0, False: 28.7M]
  ------------------
   39|      0|            refPeriodStart_ = accrualStartDate_;
   40|  28.7M|        if (refPeriodEnd_ == Date())
  ------------------
  |  Branch (40:13): [True: 0, False: 28.7M]
  ------------------
   41|      0|            refPeriodEnd_ = accrualEndDate_;
   42|  28.7M|    }

_ZNK8QuantLib6Coupon7nominalEv:
  100|  86.1M|    inline Real Coupon::nominal() const {
  101|  86.1M|        return nominal_;
  102|  86.1M|    }
_ZNK8QuantLib6Coupon4dateEv:
   53|   302M|        Date date() const override { return paymentDate_; }

_ZN8QuantLib15FixedRateCouponC1ERKNS_4DateEdNS_12InterestRateES3_S3_S3_S3_S3_:
   53|  28.7M|    : Coupon(paymentDate,
   54|  28.7M|             nominal,
   55|  28.7M|             accrualStartDate,
   56|  28.7M|             accrualEndDate,
   57|  28.7M|             refPeriodStart,
   58|  28.7M|             refPeriodEnd,
   59|  28.7M|             exCouponDate),
   60|  28.7M|      rate_(std::move(interestRate)) {}
_ZNK8QuantLib15FixedRateCoupon6amountEv:
   62|  28.7M|    Real FixedRateCoupon::amount() const {
   63|  28.7M|        calculate();
   64|  28.7M|        return amount_;
   65|  28.7M|    }
_ZNK8QuantLib15FixedRateCoupon19performCalculationsEv:
   67|  28.7M|    void FixedRateCoupon::performCalculations() const {
   68|  28.7M|        amount_ = nominal() * (rate_.compoundFactor(accrualStartDate_, accrualEndDate_,
   69|  28.7M|                                                    refPeriodStart_, refPeriodEnd_) -
   70|  28.7M|                               1.0);
   71|  28.7M|    }
_ZN8QuantLib12FixedRateLegC2ENS_8ScheduleE:
   93|  79.8k|    : schedule_(std::move(schedule)), paymentCalendar_(schedule_.calendar()) {}
_ZN8QuantLib12FixedRateLeg13withNotionalsERKNSt3__16vectorIdNS1_9allocatorIdEEEE:
  100|  79.8k|    FixedRateLeg& FixedRateLeg::withNotionals(const vector<Real>& notionals) {
  101|  79.8k|        notionals_ = notionals;
  102|  79.8k|        return *this;
  103|  79.8k|    }
_ZN8QuantLib12FixedRateLeg15withCouponRatesERKNSt3__16vectorIdNS1_9allocatorIdEEEERKNS_10DayCounterENS_11CompoundingENS_9FrequencyE:
  123|  79.8k|                                                Frequency freq) {
  124|  79.8k|        couponRates_.resize(rates.size());
  125|   159k|        for (Size i=0; i<rates.size(); ++i)
  ------------------
  |  Branch (125:24): [True: 79.8k, False: 79.8k]
  ------------------
  126|  79.8k|            couponRates_[i] = InterestRate(rates[i], dc, comp, freq);
  127|  79.8k|        return *this;
  128|  79.8k|    }
_ZN8QuantLib12FixedRateLeg21withPaymentAdjustmentENS_21BusinessDayConventionE:
  137|  79.8k|                                           BusinessDayConvention convention) {
  138|  79.8k|        paymentAdjustment_ = convention;
  139|  79.8k|        return *this;
  140|  79.8k|    }
_ZN8QuantLib12FixedRateLeg14withPaymentLagEi:
  159|  79.8k|    FixedRateLeg& FixedRateLeg::withPaymentLag(Integer lag) {
  160|  79.8k|        paymentLag_ = lag;
  161|  79.8k|        return *this;
  162|  79.8k|    }
_ZN8QuantLib12FixedRateLeg18withExCouponPeriodERKNS_6PeriodERKNS_8CalendarENS_21BusinessDayConventionEb:
  168|  79.8k|                                bool endOfMonth) {
  169|  79.8k|        exCouponPeriod_ = period;
  170|  79.8k|        exCouponCalendar_ = cal;
  171|  79.8k|        exCouponAdjustment_ = convention;
  172|  79.8k|        exCouponEndOfMonth_ = endOfMonth;
  173|  79.8k|        return *this;
  174|  79.8k|    }
_ZNK8QuantLib12FixedRateLegcvNSt3__16vectorIN5boost10shared_ptrINS_8CashFlowEEENS1_9allocatorIS6_EEEEEv:
  176|  79.8k|    FixedRateLeg::operator Leg() const {
  177|       |
  178|  79.8k|        QL_REQUIRE(!couponRates_.empty(), "no coupon rates given");
  ------------------
  |  |  117|  79.8k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  79.8k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  79.8k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
  179|  79.8k|        QL_REQUIRE(!notionals_.empty(), "no notional given");
  ------------------
  |  |  117|  79.8k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|   159k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|   159k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
  180|       |
  181|  79.8k|        Leg leg;
  182|  79.8k|        leg.reserve(schedule_.size()-1);
  183|       |
  184|       |        // first period might be short or long
  185|  79.8k|        Date start = schedule_.date(0), end = schedule_.date(1);
  186|  79.8k|        Date paymentDate = paymentCalendar_.advance(end, paymentLag_, Days, paymentAdjustment_);
  187|  79.8k|        Date exCouponDate;
  188|  79.8k|        InterestRate rate = couponRates_[0];
  189|  79.8k|        Real nominal = notionals_[0];
  190|       |
  191|  79.8k|        if (exCouponPeriod_ != Period())
  ------------------
  |  Branch (191:13): [True: 0, False: 79.8k]
  ------------------
  192|      0|        {
  193|      0|            exCouponDate = exCouponCalendar_.advance(paymentDate,
  194|      0|                                                     -exCouponPeriod_,
  195|      0|                                                     exCouponAdjustment_,
  196|      0|                                                     exCouponEndOfMonth_);
  197|      0|        }
  198|  79.8k|        Date ref = schedule_.hasTenor() &&
  ------------------
  |  Branch (198:20): [True: 79.8k, False: 0]
  ------------------
  199|  79.8k|            schedule_.hasIsRegular() && !schedule_.isRegular(1) ?
  ------------------
  |  Branch (199:13): [True: 79.8k, False: 0]
  |  Branch (199:41): [True: 0, False: 79.8k]
  ------------------
  200|      0|            schedule_.calendar().advance(end,
  201|      0|                                         -schedule_.tenor(),
  202|      0|                                         schedule_.businessDayConvention(),
  203|      0|                                         schedule_.endOfMonth())
  204|  79.8k|            : start;
  205|  79.8k|        InterestRate r(rate.rate(),
  206|  79.8k|                       firstPeriodDC_.empty() ? rate.dayCounter()
  ------------------
  |  Branch (206:24): [True: 79.8k, False: 0]
  ------------------
  207|  79.8k|                       : firstPeriodDC_,
  208|  79.8k|                       rate.compounding(), rate.frequency());
  209|  79.8k|        leg.push_back(ext::shared_ptr<CashFlow>(new
  210|  79.8k|            FixedRateCoupon(paymentDate, nominal, r,
  211|  79.8k|                            start, end, ref, end, exCouponDate)));
  212|       |        // regular periods
  213|  28.6M|        for (Size i=2; i<schedule_.size()-1; ++i) {
  ------------------
  |  Branch (213:24): [True: 28.5M, False: 79.8k]
  ------------------
  214|  28.5M|            start = end; end = schedule_.date(i);
  215|  28.5M|            Date paymentDate = paymentCalendar_.advance(end, paymentLag_, Days, paymentAdjustment_);
  216|  28.5M|            if (exCouponPeriod_ != Period())
  ------------------
  |  Branch (216:17): [True: 0, False: 28.5M]
  ------------------
  217|      0|            {
  218|      0|                exCouponDate = exCouponCalendar_.advance(paymentDate,
  219|      0|                                                         -exCouponPeriod_,
  220|      0|                                                         exCouponAdjustment_,
  221|      0|                                                         exCouponEndOfMonth_);
  222|      0|            }
  223|  28.5M|            if ((i-1) < couponRates_.size())
  ------------------
  |  Branch (223:17): [True: 0, False: 28.5M]
  ------------------
  224|      0|                rate = couponRates_[i-1];
  225|  28.5M|            else
  226|  28.5M|                rate = couponRates_.back();
  227|  28.5M|            if ((i-1) < notionals_.size())
  ------------------
  |  Branch (227:17): [True: 28.5M, False: 0]
  ------------------
  228|  28.5M|                nominal = notionals_[i-1];
  229|      0|            else
  230|      0|                nominal = notionals_.back();
  231|  28.5M|            leg.push_back(ext::shared_ptr<CashFlow>(new
  232|  28.5M|                FixedRateCoupon(paymentDate, nominal, rate,
  233|  28.5M|                                start, end, start, end, exCouponDate)));
  234|  28.5M|        }
  235|  79.8k|        if (schedule_.size() > 2) {
  ------------------
  |  Branch (235:13): [True: 79.8k, False: 0]
  ------------------
  236|       |            // last period might be short or long
  237|  79.8k|            Size N = schedule_.size();
  238|  79.8k|            start = end; end = schedule_.date(N-1);
  239|  79.8k|            Date paymentDate = paymentCalendar_.advance(end, paymentLag_, Days, paymentAdjustment_);
  240|  79.8k|            if (exCouponPeriod_ != Period())
  ------------------
  |  Branch (240:17): [True: 0, False: 79.8k]
  ------------------
  241|      0|            {
  242|      0|                exCouponDate = exCouponCalendar_.advance(paymentDate,
  243|      0|                                                         -exCouponPeriod_,
  244|      0|                                                         exCouponAdjustment_,
  245|      0|                                                         exCouponEndOfMonth_);
  246|      0|            }
  247|  79.8k|            if ((N-2) < couponRates_.size())
  ------------------
  |  Branch (247:17): [True: 0, False: 79.8k]
  ------------------
  248|      0|                rate = couponRates_[N-2];
  249|  79.8k|            else
  250|  79.8k|                rate = couponRates_.back();
  251|  79.8k|            if ((N-2) < notionals_.size())
  ------------------
  |  Branch (251:17): [True: 79.8k, False: 0]
  ------------------
  252|  79.8k|                nominal = notionals_[N-2];
  253|      0|            else
  254|      0|                nominal = notionals_.back();
  255|  79.8k|            InterestRate r( rate.rate(), lastPeriodDC_.empty() ?
  ------------------
  |  Branch (255:42): [True: 79.8k, False: 0]
  ------------------
  256|  79.8k|                rate.dayCounter() :
  257|  79.8k|                lastPeriodDC_ , rate.compounding(), rate.frequency() );
  258|  79.8k|            if ((schedule_.hasIsRegular() && schedule_.isRegular(N - 1)) ||
  ------------------
  |  Branch (258:18): [True: 79.8k, False: 0]
  |  Branch (258:46): [True: 79.8k, False: 0]
  ------------------
  259|  79.8k|                !schedule_.hasTenor()) {
  ------------------
  |  Branch (259:17): [True: 0, False: 0]
  ------------------
  260|  79.8k|                leg.push_back(ext::shared_ptr<CashFlow>(new
  261|  79.8k|                    FixedRateCoupon(paymentDate, nominal, r,
  262|  79.8k|                                    start, end, start, end, exCouponDate)));
  263|  79.8k|            } else {
  264|      0|                Date ref = schedule_.calendar().advance(
  265|      0|                                            start,
  266|      0|                                            schedule_.tenor(),
  267|      0|                                            schedule_.businessDayConvention(),
  268|      0|                                            schedule_.endOfMonth());
  269|      0|                leg.push_back(ext::shared_ptr<CashFlow>(new
  270|      0|                    FixedRateCoupon(paymentDate, nominal, r,
  271|      0|                                    start, end, start, ref, exCouponDate)));
  272|      0|            }
  273|  79.8k|        }
  274|  79.8k|        return leg;
  275|  79.8k|    }

_ZN8QuantLib14SimpleCashFlowC2EdRKNS_4DateE:
   27|  28.7M|    : amount_(amount), date_(date)
   28|  28.7M|    {
   29|  28.7M|        QL_REQUIRE(date_!=Date(), "null date SimpleCashFlow");
  ------------------
  |  |  117|  28.7M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.7M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  28.7M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  28.7M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 28.7M]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.7M|} \
  |  |  ------------------
  |  |  |  |   85|  28.7M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.7M|QL_MULTILINE_ASSERTION_END
  ------------------
   30|       |
   31|  28.7M|        QL_REQUIRE(amount_!=Null<Real>(), "null amount SimpleCashFlow");
  ------------------
  |  |  117|  28.7M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.7M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  57.4M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  57.4M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 28.7M]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.7M|} \
  |  |  ------------------
  |  |  |  |   85|  28.7M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.7M|QL_MULTILINE_ASSERTION_END
  ------------------
   32|  28.7M|    }

_ZNK8QuantLib14SimpleCashFlow4dateEv:
   41|   273M|        Date date() const override { return date_; }
_ZNK8QuantLib14SimpleCashFlow6amountEv:
   45|  28.7M|        Real amount() const override { return amount_; }
_ZN8QuantLib10RedemptionC1EdRKNS_4DateE:
   65|  79.8k|        : SimpleCashFlow(amount, date) {}
_ZN8QuantLib17AmortizingPaymentC1EdRKNS_4DateE:
   80|  28.6M|        : SimpleCashFlow(amount, date) {}

_ZN8QuantLib5EventD2Ev:
   42|  57.4M|        ~Event() override = default;

_ZN8QuantLib10InstrumentC2Ev:
   27|  79.8k|    : NPV_(Null<Real>()), errorEstimate_(Null<Real>()) {
   28|       |        // this makes sense in general (if the evaluation date
   29|       |        // changes, you probably want to recalculate) and can also
   30|       |        // help avoid some edge cases when lazy objects only forward
   31|       |        // their first notification.
   32|  79.8k|        registerWith(Settings::instance().evaluationDate());
   33|  79.8k|    }

_ZN8QuantLib4BondC2EjNS_8CalendarERKNS_4DateERKNSt3__16vectorIN5boost10shared_ptrINS_8CashFlowEEENS5_9allocatorISA_EEEE:
   39|  79.8k|    : settlementDays_(settlementDays), calendar_(std::move(calendar)), cashflows_(coupons),
   40|  79.8k|      issueDate_(issueDate) {
   41|       |
   42|  79.8k|        if (!coupons.empty()) {
  ------------------
  |  Branch (42:13): [True: 0, False: 79.8k]
  ------------------
   43|      0|            std::sort(cashflows_.begin(), cashflows_.end(),
   44|      0|                      earlier_than<ext::shared_ptr<CashFlow> >());
   45|       |
   46|      0|            if (issueDate_ != Date()) {
  ------------------
  |  Branch (46:17): [True: 0, False: 0]
  ------------------
   47|      0|                QL_REQUIRE(issueDate_<cashflows_[0]->date(),
  ------------------
  |  |  117|      0|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|      0|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|      0|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|      0|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|      0|} \
  |  |  ------------------
  |  |  |  |   85|      0|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|      0|QL_MULTILINE_ASSERTION_END
  ------------------
   48|      0|                           "issue date (" << issueDate_ <<
   49|      0|                           ") must be earlier than first payment date (" <<
   50|      0|                           cashflows_[0]->date() << ")");
   51|      0|            }
   52|       |
   53|      0|            maturityDate_ = coupons.back()->date();
   54|       |
   55|      0|            addRedemptionsToCashflows();
   56|      0|        }
   57|       |
   58|  79.8k|        registerWith(Settings::instance().evaluationDate());
   59|  79.8k|        for (const auto& cashflow : cashflows_)
  ------------------
  |  Branch (59:35): [True: 0, False: 79.8k]
  ------------------
   60|      0|            registerWith(cashflow);
   61|  79.8k|    }
_ZN8QuantLib4Bond25addRedemptionsToCashflowsERKNSt3__16vectorIdNS1_9allocatorIdEEEE:
  304|  79.8k|    void Bond::addRedemptionsToCashflows(const std::vector<Real>& redemptions) {
  305|       |        // First, we gather the notional information from the cashflows
  306|  79.8k|        calculateNotionalsFromCashflows();
  307|       |        // Then, we create the redemptions based on the notional
  308|       |        // information and we add them to the cashflows vector after
  309|       |        // the coupons.
  310|  79.8k|        redemptions_.clear();
  311|  28.8M|        for (Size i=1; i<notionalSchedule_.size(); ++i) {
  ------------------
  |  Branch (311:24): [True: 28.7M, False: 79.8k]
  ------------------
  312|  28.7M|            Real R = i < redemptions.size() ? redemptions[i] :
  ------------------
  |  Branch (312:22): [True: 0, False: 28.7M]
  ------------------
  313|  28.7M|                     !redemptions.empty()   ? redemptions.back() :
  ------------------
  |  Branch (313:22): [True: 28.7M, False: 0]
  ------------------
  314|  28.7M|                                              100.0;
  315|  28.7M|            Real amount = (R/100.0)*(notionals_[i-1]-notionals_[i]);
  316|  28.7M|            ext::shared_ptr<CashFlow> payment;
  317|  28.7M|            if (i < notionalSchedule_.size()-1)
  ------------------
  |  Branch (317:17): [True: 28.6M, False: 79.8k]
  ------------------
  318|  28.6M|                payment = ext::make_shared<AmortizingPayment>(amount,
  319|  28.6M|                                                    notionalSchedule_[i]);
  320|  79.8k|            else
  321|  79.8k|                payment = ext::make_shared<Redemption>(amount, notionalSchedule_[i]);
  322|  28.7M|            cashflows_.push_back(payment);
  323|  28.7M|            redemptions_.push_back(payment);
  324|  28.7M|        }
  325|       |        // stable_sort now moves the redemptions to the right places
  326|       |        // while ensuring that they follow coupons with the same date.
  327|  79.8k|        std::stable_sort(cashflows_.begin(), cashflows_.end(),
  328|  79.8k|                         earlier_than<ext::shared_ptr<CashFlow> >());
  329|  79.8k|    }
_ZN8QuantLib4Bond31calculateNotionalsFromCashflowsEv:
  363|  79.8k|    void Bond::calculateNotionalsFromCashflows() {
  364|  79.8k|        notionalSchedule_.clear();
  365|  79.8k|        notionals_.clear();
  366|       |
  367|  79.8k|        Date lastPaymentDate = Date();
  368|  79.8k|        notionalSchedule_.emplace_back();
  369|  28.7M|        for (auto& cashflow : cashflows_) {
  ------------------
  |  Branch (369:29): [True: 28.7M, False: 79.8k]
  ------------------
  370|  28.7M|            ext::shared_ptr<Coupon> coupon = ext::dynamic_pointer_cast<Coupon>(cashflow);
  371|  28.7M|            if (!coupon)
  ------------------
  |  Branch (371:17): [True: 0, False: 28.7M]
  ------------------
  372|      0|                continue;
  373|       |
  374|  28.7M|            Real notional = coupon->nominal();
  375|       |            // we add the notional only if it is the first one...
  376|  28.7M|            if (notionals_.empty()) {
  ------------------
  |  Branch (376:17): [True: 79.8k, False: 28.6M]
  ------------------
  377|  79.8k|                notionals_.push_back(coupon->nominal());
  378|  79.8k|                lastPaymentDate = coupon->date();
  379|  28.6M|            } else if (!close(notional, notionals_.back())) {
  ------------------
  |  Branch (379:24): [True: 28.6M, False: 0]
  ------------------
  380|       |                // ...or if it has changed.
  381|  28.6M|                notionals_.push_back(coupon->nominal());
  382|       |                // in this case, we also add the last valid date for
  383|       |                // the previous one...
  384|  28.6M|                notionalSchedule_.push_back(lastPaymentDate);
  385|       |                // ...and store the candidate for this one.
  386|  28.6M|                lastPaymentDate = coupon->date();
  387|  28.6M|            } else {
  388|       |                // otherwise, we just extend the valid range of dates
  389|       |                // for the current notional.
  390|      0|                lastPaymentDate = coupon->date();
  391|      0|            }
  392|  28.7M|        }
  393|  79.8k|        QL_REQUIRE(!notionals_.empty(), "no coupons provided");
  ------------------
  |  |  117|  79.8k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  79.8k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  79.8k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
  394|  79.8k|        notionals_.push_back(0.0);
  395|  79.8k|        notionalSchedule_.push_back(lastPaymentDate);
  396|  79.8k|    }

_ZNK8QuantLib4Bond9cashflowsEv:
  330|   159k|    inline const Leg& Bond::cashflows() const {
  331|   159k|        return cashflows_;
  332|   159k|    }

_ZN8QuantLib23AmortizingFixedRateBondC1EjRKNSt3__16vectorIdNS1_9allocatorIdEEEENS_8ScheduleES7_RKNS_10DayCounterENS_21BusinessDayConventionERKNS_4DateERKNS_6PeriodERKNS_8CalendarESC_bS7_i:
   41|  79.8k|    : Bond(settlementDays, schedule.calendar(), issueDate),
   42|  79.8k|      frequency_(schedule.tenor().frequency()),
   43|  79.8k|      dayCounter_(accrualDayCounter) {
   44|       |
   45|  79.8k|        maturityDate_ = schedule.endDate();
   46|       |
   47|  79.8k|        cashflows_ = FixedRateLeg(std::move(schedule))
   48|  79.8k|            .withNotionals(notionals)
   49|  79.8k|            .withCouponRates(coupons, accrualDayCounter)
   50|  79.8k|            .withPaymentAdjustment(paymentConvention)
   51|  79.8k|            .withExCouponPeriod(exCouponPeriod,
   52|  79.8k|                                exCouponCalendar,
   53|  79.8k|                                exCouponConvention,
   54|  79.8k|                                exCouponEndOfMonth)
   55|  79.8k|            .withPaymentLag(paymentLag);
   56|       |
   57|  79.8k|        addRedemptionsToCashflows(redemptions);
   58|       |
   59|  79.8k|        QL_ENSURE(!cashflows().empty(), "bond with no cashflows!");
  ------------------
  |  |  130|  79.8k|#define QL_ENSURE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  131|  79.8k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  132|  79.8k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (132:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  133|      0|    std::ostringstream _ql_msg_stream; \
  |  |  134|      0|    _ql_msg_stream << message; \
  |  |  135|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  136|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  137|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
   60|  79.8k|    }
_ZN8QuantLib15sinkingScheduleERKNS_4DateERKNS_6PeriodERKNS_9FrequencyERKNS_8CalendarE:
   66|  79.8k|                             const Calendar& paymentCalendar) {
   67|  79.8k|        Date maturityDate = startDate + bondLength;
   68|  79.8k|        Schedule retVal(startDate, maturityDate, Period(frequency),
   69|  79.8k|                        paymentCalendar, Unadjusted, Unadjusted,
   70|  79.8k|                        DateGeneration::Backward, false);
   71|  79.8k|        return retVal;
   72|  79.8k|    }
_ZN8QuantLib16sinkingNotionalsERKNS_6PeriodERKNS_9FrequencyEdd:
  126|  79.8k|                                       Real initialNotional) {
  127|  79.8k|        Integer nPeriods;
  128|  79.8k|        QL_REQUIRE(isSubPeriod(Period(sinkingFrequency), bondLength, nPeriods),
  ------------------
  |  |  117|  79.8k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  79.8k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  79.8k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
  129|  79.8k|                   "Bond frequency is incompatible with the maturity tenor");
  130|       |
  131|  79.8k|        std::vector<Real> notionals(nPeriods+1);
  132|  79.8k|        notionals.front() = initialNotional;
  133|  79.8k|        Real coupon = couponRate / static_cast<Real>(sinkingFrequency);
  134|  79.8k|        Real compoundedInterest = 1.0;
  135|  79.8k|        Real totalValue = std::pow(1.0+coupon, nPeriods);
  136|  28.7M|        for (Size i = 0; i < (Size)nPeriods-1; ++i) {
  ------------------
  |  Branch (136:26): [True: 28.6M, False: 79.8k]
  ------------------
  137|  28.6M|            compoundedInterest *= (1.0 + coupon);
  138|  28.6M|            Real currentNotional = 0.0;
  139|  28.6M|            if(coupon < 1.0e-12) {
  ------------------
  |  Branch (139:16): [True: 15.3M, False: 13.3M]
  ------------------
  140|  15.3M|                currentNotional = initialNotional*(1.0 - (i+1.0)/nPeriods);
  141|  15.3M|            } else {
  142|  13.3M|                currentNotional =
  143|  13.3M|                    initialNotional*(compoundedInterest - (compoundedInterest-1.0)/(1.0 - 1.0/totalValue));
  144|  13.3M|            }
  145|  28.6M|            notionals[i+1] = currentNotional;
  146|  28.6M|        }
  147|  79.8k|        notionals.back() = 0.0;
  148|       |
  149|  79.8k|        return notionals;
  150|  79.8k|    }
amortizingfixedratebond.cpp:_ZN8QuantLib12_GLOBAL__N_111isSubPeriodERKNS_6PeriodES3_Ri:
   93|  79.8k|                         Integer& numSubPeriods) {
   94|       |
   95|  79.8k|            std::pair<Integer, Integer> superDays(daysMinMax(superPeriod));
   96|  79.8k|            std::pair<Integer, Integer> subDays(daysMinMax(subPeriod));
   97|       |
   98|       |            //obtain the approximate time ratio
   99|  79.8k|            Real minPeriodRatio =
  100|  79.8k|                ((Real)superDays.first)/((Real)subDays.second);
  101|  79.8k|            Real maxPeriodRatio =
  102|  79.8k|                ((Real)superDays.second)/((Real)subDays.first);
  103|  79.8k|            auto lowRatio = static_cast<Integer>(std::floor(minPeriodRatio));
  104|  79.8k|            auto highRatio = static_cast<Integer>(std::ceil(maxPeriodRatio));
  105|       |
  106|  79.8k|            try {
  107|   638k|                for(Integer i=lowRatio; i <= highRatio; ++i) {
  ------------------
  |  Branch (107:41): [True: 638k, False: 0]
  ------------------
  108|   638k|                    Period testPeriod = subPeriod * i;
  109|   638k|                    if(testPeriod == superPeriod) {
  ------------------
  |  Branch (109:24): [True: 79.8k, False: 558k]
  ------------------
  110|  79.8k|                        numSubPeriods = i;
  111|  79.8k|                        return true;
  112|  79.8k|                    }
  113|   638k|                }
  114|  79.8k|            } catch(Error&) {
  115|      0|                return false;
  116|      0|            }
  117|       |
  118|      0|            return false;
  119|  79.8k|        }
amortizingfixedratebond.cpp:_ZN8QuantLib12_GLOBAL__N_110daysMinMaxERKNS_6PeriodE:
   76|   159k|        std::pair<Integer,Integer> daysMinMax(const Period& p) {
   77|   159k|            switch (p.units()) {
   78|      0|              case Days:
  ------------------
  |  Branch (78:15): [True: 0, False: 159k]
  ------------------
   79|      0|                return std::make_pair(p.length(), p.length());
   80|      0|              case Weeks:
  ------------------
  |  Branch (80:15): [True: 0, False: 159k]
  ------------------
   81|      0|                return std::make_pair(7*p.length(), 7*p.length());
   82|  79.8k|              case Months:
  ------------------
  |  Branch (82:15): [True: 79.8k, False: 79.8k]
  ------------------
   83|  79.8k|                return std::make_pair(28*p.length(), 31*p.length());
   84|  79.8k|              case Years:
  ------------------
  |  Branch (84:15): [True: 79.8k, False: 79.8k]
  ------------------
   85|  79.8k|                return std::make_pair(365*p.length(), 366*p.length());
   86|      0|              default:
  ------------------
  |  Branch (86:15): [True: 0, False: 159k]
  ------------------
   87|      0|                QL_FAIL("unknown time unit (" << Integer(p.units()) << ")");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
   88|   159k|            }
   89|   159k|        }

_ZN8QuantLib12InterestRateC2Ev:
   31|  79.8k|    : r_(Null<Real>()) {}
_ZN8QuantLib12InterestRateC2EdNS_10DayCounterENS_11CompoundingENS_9FrequencyE:
   34|   239k|    : r_(r), dc_(std::move(dc)), comp_(comp), freqMakesSense_(false) {
   35|       |
   36|   239k|        if (comp_==Compounded || comp_==SimpleThenCompounded || comp_==CompoundedThenSimple) {
  ------------------
  |  Branch (36:13): [True: 0, False: 239k]
  |  Branch (36:34): [True: 0, False: 239k]
  |  Branch (36:65): [True: 0, False: 239k]
  ------------------
   37|      0|            freqMakesSense_ = true;
   38|      0|            QL_REQUIRE(freq!=Once && freq!=NoFrequency,
  ------------------
  |  |  117|      0|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|      0|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|      0|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|      0|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:7): [True: 0, False: 0]
  |  |  |  Branch (119:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|      0|} \
  |  |  ------------------
  |  |  |  |   85|      0|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|      0|QL_MULTILINE_ASSERTION_END
  ------------------
   39|      0|                       "frequency not allowed for this interest rate");
   40|      0|            freq_ = Real(freq);
   41|      0|        }
   42|   239k|    }
_ZNK8QuantLib12InterestRate14compoundFactorEd:
   44|  28.7M|    Real InterestRate::compoundFactor(Time t) const {
   45|       |
   46|  28.7M|        QL_REQUIRE(t>=0.0, "negative time (" << t << ") not allowed");
  ------------------
  |  |  117|  28.7M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.7M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  28.7M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  28.7M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 28.7M]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.7M|} \
  |  |  ------------------
  |  |  |  |   85|  28.7M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.7M|QL_MULTILINE_ASSERTION_END
  ------------------
   47|  28.7M|        QL_REQUIRE(r_ != Null<Rate>(), "null interest rate");
  ------------------
  |  |  117|  28.7M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.7M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  57.4M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  57.4M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 28.7M]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.7M|} \
  |  |  ------------------
  |  |  |  |   85|  28.7M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.7M|QL_MULTILINE_ASSERTION_END
  ------------------
   48|  28.7M|        switch (comp_) {
   49|  28.7M|          case Simple:
  ------------------
  |  Branch (49:11): [True: 28.7M, False: 0]
  ------------------
   50|  28.7M|            return 1.0 + r_*t;
   51|      0|          case Compounded:
  ------------------
  |  Branch (51:11): [True: 0, False: 28.7M]
  ------------------
   52|      0|            return std::pow(1.0+r_/freq_, freq_*t);
   53|      0|          case Continuous:
  ------------------
  |  Branch (53:11): [True: 0, False: 28.7M]
  ------------------
   54|      0|            return std::exp(r_*t);
   55|      0|          case SimpleThenCompounded:
  ------------------
  |  Branch (55:11): [True: 0, False: 28.7M]
  ------------------
   56|      0|            if (t<=1.0/Real(freq_))
  ------------------
  |  Branch (56:17): [True: 0, False: 0]
  ------------------
   57|      0|                return 1.0 + r_*t;
   58|      0|            else
   59|      0|                return std::pow(1.0+r_/freq_, freq_*t);
   60|      0|          case CompoundedThenSimple:
  ------------------
  |  Branch (60:11): [True: 0, False: 28.7M]
  ------------------
   61|      0|            if (t>1.0/Real(freq_))
  ------------------
  |  Branch (61:17): [True: 0, False: 0]
  ------------------
   62|      0|                return 1.0 + r_*t;
   63|      0|            else
   64|      0|                return std::pow(1.0+r_/freq_, freq_*t);
   65|      0|          default:
  ------------------
  |  Branch (65:11): [True: 0, False: 28.7M]
  ------------------
   66|      0|            QL_FAIL("unknown compounding convention");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
   67|  28.7M|        }
   68|  28.7M|    }

_ZNK8QuantLib12InterestRate4rateEv:
   55|   159k|        Rate rate() const { return r_; }
_ZNK8QuantLib12InterestRate10dayCounterEv:
   56|   159k|        const DayCounter& dayCounter() const { return dc_; }
_ZNK8QuantLib12InterestRate11compoundingEv:
   57|   159k|        Compounding compounding() const { return comp_; }
_ZNK8QuantLib12InterestRate9frequencyEv:
   58|   159k|        Frequency frequency() const {
   59|   159k|            return freqMakesSense_ ? Frequency(Integer(freq_)) : NoFrequency;
  ------------------
  |  Branch (59:20): [True: 0, False: 159k]
  ------------------
   60|   159k|        }
_ZNK8QuantLib12InterestRate14compoundFactorERKNS_4DateES3_S3_S3_:
  101|  28.7M|                            const Date& refEnd = Date()) const {
  102|  28.7M|            QL_REQUIRE(d2>=d1,
  ------------------
  |  |  117|  28.7M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.7M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  28.7M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  28.7M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 28.7M]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.7M|} \
  |  |  ------------------
  |  |  |  |   85|  28.7M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.7M|QL_MULTILINE_ASSERTION_END
  ------------------
  103|  28.7M|                       "d1 (" << d1 << ") "
  104|  28.7M|                       "later than d2 (" << d2 << ")");
  105|  28.7M|            Time t = dc_.yearFraction(d1, d2, refStart, refEnd);
  106|  28.7M|            return compoundFactor(t);
  107|  28.7M|        }

_ZN8QuantLib5closeEdd:
   59|  28.6M|    inline bool close(Real x, Real y) {
   60|       |        // we're duplicating the code here instead of calling close(x,y,42)
   61|       |        // for optimization; this allows us to make tolerance constexpr
   62|       |        // and shave a few more cycles.
   63|       |
   64|       |        // Deals with +infinity and -infinity representations etc.
   65|  28.6M|        if (x == y)
  ------------------
  |  Branch (65:13): [True: 0, False: 28.6M]
  ------------------
   66|      0|            return true;
   67|       |
   68|  28.6M|        Real diff = std::fabs(x-y);
   69|  28.6M|        constexpr double tolerance = 42 * QL_EPSILON;
  ------------------
  |  |  179|  28.6M|#define QL_EPSILON             ((std::numeric_limits<QL_REAL>::epsilon)())
  ------------------
   70|       |
   71|  28.6M|        if (x == 0.0 || y == 0.0)
  ------------------
  |  Branch (71:13): [True: 0, False: 28.6M]
  |  Branch (71:25): [True: 0, False: 28.6M]
  ------------------
   72|      0|            return diff < (tolerance * tolerance);
   73|       |
   74|  28.6M|        return diff <= tolerance*std::fabs(x) &&
  ------------------
  |  Branch (74:16): [True: 0, False: 28.6M]
  ------------------
   75|  28.6M|               diff <= tolerance*std::fabs(y);
  ------------------
  |  Branch (75:16): [True: 0, False: 0]
  ------------------
   76|  28.6M|    }
_ZNK8QuantLib12earlier_thanIN5boost10shared_ptrINS_8CashFlowEEEEclERKS4_S7_:
  137|   273M|                        const ext::shared_ptr<T>& y) const {
  138|   273M|            return earlier_than<T>()(*x,*y);
  139|   273M|        }

_ZN8QuantLib28CumulativeNormalDistributionC2Edd:
  289|      8|    : average_(average), sigma_(sigma) {
  290|       |
  291|      8|        QL_REQUIRE(sigma_>0.0,
  ------------------
  |  |  117|      8|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|      8|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|      8|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|      8|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 8]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|      8|} \
  |  |  ------------------
  |  |  |  |   85|      8|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|      8|QL_MULTILINE_ASSERTION_END
  ------------------
  292|      8|                   "sigma must be greater than 0.0 ("
  293|      8|                   << sigma_ << " not allowed)");
  294|      8|    }
_ZN8QuantLib18NormalDistributionC2Edd:
  264|     10|    : average_(average), sigma_(sigma) {
  265|       |
  266|     10|        QL_REQUIRE(sigma_>0.0,
  ------------------
  |  |  117|     10|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|     10|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|     10|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|     10|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 10]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|     10|} \
  |  |  ------------------
  |  |  |  |   85|     10|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|     10|QL_MULTILINE_ASSERTION_END
  ------------------
  267|     10|                   "sigma must be greater than 0.0 ("
  268|     10|                   << sigma_ << " not allowed)");
  269|       |
  270|     10|        normalizationFactor_ = M_SQRT_2*M_1_SQRTPI/sigma_;
  ------------------
  |  |   98|     10|    #define M_SQRT_2    0.7071067811865475244008443621048490392848359376887
  ------------------
                      normalizationFactor_ = M_SQRT_2*M_1_SQRTPI/sigma_;
  ------------------
  |  |   86|     10|    #define M_1_SQRTPI  0.564189583547756286948
  ------------------
  271|     10|        derNormalizationFactor_ = sigma_*sigma_;
  272|     10|        denominator_ = 2.0*derNormalizationFactor_;
  273|     10|    }

_ZN8QuantLib10LazyObjectD2Ev:
   38|  57.5M|        ~LazyObject() override = default;
_ZNK8QuantLib10LazyObject9calculateEv:
  253|  28.7M|    inline void LazyObject::calculate() const {
  254|  28.7M|        if (!calculated_ && !frozen_) {
  ------------------
  |  Branch (254:13): [True: 28.7M, False: 0]
  |  Branch (254:29): [True: 28.7M, False: 0]
  ------------------
  255|  28.7M|            calculated_ = true;   // prevent infinite recursion in
  256|       |                                  // case of bootstrapping
  257|  28.7M|            try {
  258|  28.7M|                performCalculations();
  259|  28.7M|            } catch (...) {
  260|      0|                calculated_ = false;
  261|      0|                throw;
  262|      0|            }
  263|  28.7M|        }
  264|  28.7M|    }
_ZNK8QuantLib10LazyObject8Defaults24forwardsAllNotificationsEv:
  171|  57.5M|        bool forwardsAllNotifications() const {
  172|  57.5M|            return forwardsAllNotifications_;
  173|  57.5M|        }
_ZN8QuantLib10LazyObjectC2Ev:
  186|  57.5M|    : alwaysForward_(LazyObject::Defaults::instance().forwardsAllNotifications()) {}

_ZN8QuantLib8ObserverD2Ev:
  220|  57.5M|    inline Observer::~Observer() {
  221|  57.5M|        for (const auto& observable : observables_)
  ------------------
  |  Branch (221:37): [True: 79.8k, False: 57.5M]
  ------------------
  222|  79.8k|            observable->unregisterObserver(this);
  223|  57.5M|    }
_ZN8QuantLib10Observable18unregisterObserverEPNS_8ObserverE:
  197|  79.8k|    inline Size Observable::unregisterObserver(Observer* o) {
  198|  79.8k|        if (ObservableSettings::instance().updatesDeferred())
  ------------------
  |  Branch (198:13): [True: 0, False: 79.8k]
  ------------------
  199|      0|            ObservableSettings::instance().unregisterDeferredObserver(o);
  200|       |
  201|  79.8k|        return observers_.erase(o);
  202|  79.8k|    }
_ZN8QuantLib18ObservableSettingsC2Ev:
  101|      1|        ObservableSettings() = default;
_ZNK8QuantLib18ObservableSettings15updatesDeferredEv:
   98|  79.8k|        bool updatesDeferred() const { return updatesDeferred_; }
_ZN8QuantLib10ObservableD2Ev:
   73|  57.5M|        virtual ~Observable() = default;
_ZN8QuantLib10Observable16registerObserverEPNS_8ObserverE:
  193|   159k|    Observable::registerObserver(Observer* o) {
  194|   159k|        return observers_.insert(o);
  195|   159k|    }
_ZN8QuantLib8Observer12registerWithERKN5boost10shared_ptrINS_10ObservableEEE:
  226|   159k|    Observer::registerWith(const ext::shared_ptr<Observable>& h) {
  227|   159k|        if (h != nullptr) {
  ------------------
  |  Branch (227:13): [True: 159k, False: 0]
  ------------------
  228|   159k|            h->registerObserver(this);
  229|   159k|            return observables_.insert(h);
  230|   159k|        }
  231|      0|        return std::make_pair(observables_.end(), false);
  232|   159k|    }
_ZN8QuantLib10ObservableC2Ev:
   67|  57.5M|        Observable() = default;
_ZN8QuantLib8ObserverC2Ev:
  123|  57.5M|        Observer() = default;

_ZN8QuantLib9SingletonINS_18ObservableSettingsENSt3__117integral_constantIbLb0EEEE8instanceEv:
  104|  79.8k|    T& Singleton<T, Global>::instance() {
  105|  79.8k|        static T instance;
  106|  79.8k|        return instance;
  107|  79.8k|    }
_ZN8QuantLib9SingletonINS_8SettingsENSt3__117integral_constantIbLb0EEEE8instanceEv:
  104|   162k|    T& Singleton<T, Global>::instance() {
  105|   162k|        static T instance;
  106|   162k|        return instance;
  107|   162k|    }
_ZN8QuantLib9SingletonINS_10LazyObject8DefaultsENSt3__117integral_constantIbLb0EEEE8instanceEv:
  104|  57.5M|    T& Singleton<T, Global>::instance() {
  105|  57.5M|        static T instance;
  106|  57.5M|        return instance;
  107|  57.5M|    }

_ZN8QuantLib8Settings9DateProxyC2Ev:
   27|      1|    : ObservableValue<Date>(Date()) {}
_ZN8QuantLib8SettingsC2Ev:
   34|      1|    Settings::Settings()
_ZN8QuantLib13SavedSettingsC2Ev:
   50|    344|    : evaluationDate_(Settings::instance().evaluationDate()),
   51|    344|      includeReferenceDateEvents_(Settings::instance().includeReferenceDateEvents()),
   52|    344|      includeTodaysCashFlows_(Settings::instance().includeTodaysCashFlows()),
   53|    344|      enforcesTodaysHistoricFixings_(Settings::instance().enforcesTodaysHistoricFixings()) {}
_ZN8QuantLib13SavedSettingsD2Ev:
   55|    344|    SavedSettings::~SavedSettings() {
   56|    344|        try {
   57|    344|            if (Settings::instance().evaluationDate() != evaluationDate_)
  ------------------
  |  Branch (57:17): [True: 0, False: 344]
  ------------------
   58|      0|                Settings::instance().evaluationDate() = evaluationDate_;
   59|    344|            Settings::instance().includeReferenceDateEvents() =
   60|    344|                includeReferenceDateEvents_;
   61|    344|            Settings::instance().includeTodaysCashFlows() =
   62|    344|                includeTodaysCashFlows_;
   63|    344|            Settings::instance().enforcesTodaysHistoricFixings() =
   64|    344|                enforcesTodaysHistoricFixings_;
   65|    344|        } catch (...) {
   66|       |            // nothing we can do except bailing out.
   67|      0|        }
   68|    344|    }

_ZN8QuantLib8Settings14evaluationDateEv:
  147|   160k|    inline Settings::DateProxy& Settings::evaluationDate() {
  148|   160k|        return evaluationDate_;
  149|   160k|    }
_ZNK8QuantLib8Settings9DateProxycvNS_4DateEEv:
  134|  1.03k|    inline Settings::DateProxy::operator Date() const {
  135|  1.03k|        if (value() == Date())
  ------------------
  |  Branch (135:13): [True: 1.03k, False: 0]
  ------------------
  136|  1.03k|            return Date::todaysDate();
  137|      0|        else
  138|      0|            return value();
  139|  1.03k|    }
_ZN8QuantLib8Settings22includeTodaysCashFlowsEv:
  163|    688|    inline ext::optional<bool>& Settings::includeTodaysCashFlows() {
  164|    688|        return includeTodaysCashFlows_;
  165|    688|    }
_ZN8QuantLib8Settings26includeReferenceDateEventsEv:
  155|    688|    inline bool& Settings::includeReferenceDateEvents() {
  156|    688|        return includeReferenceDateEvents_;
  157|    688|    }
_ZN8QuantLib8Settings29enforcesTodaysHistoricFixingsEv:
  171|    688|    inline bool& Settings::enforcesTodaysHistoricFixings() {
  172|    688|        return enforcesTodaysHistoricFixings_;
  173|    688|    }

_ZNK8QuantLib8Calendar6adjustERKNS_4DateENS_21BusinessDayConventionE:
   85|   143M|                          BusinessDayConvention c) const {
   86|   143M|        QL_REQUIRE(d != Date(), "null date");
  ------------------
  |  |  117|   143M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|   143M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|   143M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|   143M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 143M]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|   143M|} \
  |  |  ------------------
  |  |  |  |   85|   143M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|   143M|QL_MULTILINE_ASSERTION_END
  ------------------
   87|       |
   88|   143M|        if (c == Unadjusted)
  ------------------
  |  Branch (88:13): [True: 115M, False: 28.7M]
  ------------------
   89|   115M|            return d;
   90|       |
   91|  28.7M|        Date d1 = d;
   92|  28.7M|        if (c == Following || c == ModifiedFollowing 
  ------------------
  |  Branch (92:13): [True: 28.7M, False: 0]
  |  Branch (92:31): [True: 0, False: 0]
  ------------------
   93|  28.7M|            || c == HalfMonthModifiedFollowing) {
  ------------------
  |  Branch (93:16): [True: 0, False: 0]
  ------------------
   94|  28.7M|            while (isHoliday(d1))
  ------------------
  |  Branch (94:20): [True: 0, False: 28.7M]
  ------------------
   95|      0|                ++d1;
   96|  28.7M|            if (c == ModifiedFollowing 
  ------------------
  |  Branch (96:17): [True: 0, False: 28.7M]
  ------------------
   97|  28.7M|                || c == HalfMonthModifiedFollowing) {
  ------------------
  |  Branch (97:20): [True: 0, False: 28.7M]
  ------------------
   98|      0|                if (d1.month() != d.month()) {
  ------------------
  |  Branch (98:21): [True: 0, False: 0]
  ------------------
   99|      0|                    return adjust(d, Preceding);
  100|      0|                }
  101|      0|                if (c == HalfMonthModifiedFollowing) {
  ------------------
  |  Branch (101:21): [True: 0, False: 0]
  ------------------
  102|      0|                    if (d.dayOfMonth() <= 15 && d1.dayOfMonth() > 15) {
  ------------------
  |  Branch (102:25): [True: 0, False: 0]
  |  Branch (102:49): [True: 0, False: 0]
  ------------------
  103|      0|                        return adjust(d, Preceding);
  104|      0|                    }
  105|      0|                }
  106|      0|            }
  107|  28.7M|        } else if (c == Preceding || c == ModifiedPreceding) {
  ------------------
  |  Branch (107:20): [True: 0, False: 0]
  |  Branch (107:38): [True: 0, False: 0]
  ------------------
  108|      0|            while (isHoliday(d1))
  ------------------
  |  Branch (108:20): [True: 0, False: 0]
  ------------------
  109|      0|                --d1;
  110|      0|            if (c == ModifiedPreceding && d1.month() != d.month()) {
  ------------------
  |  Branch (110:17): [True: 0, False: 0]
  |  Branch (110:43): [True: 0, False: 0]
  ------------------
  111|      0|                return adjust(d,Following);
  112|      0|            }
  113|      0|        } else if (c == Nearest) {
  ------------------
  |  Branch (113:20): [True: 0, False: 0]
  ------------------
  114|      0|            Date d2 = d;
  115|      0|            while (isHoliday(d1) && isHoliday(d2))
  ------------------
  |  Branch (115:20): [True: 0, False: 0]
  |  Branch (115:37): [True: 0, False: 0]
  ------------------
  116|      0|            {
  117|      0|                ++d1;
  118|      0|                --d2;
  119|      0|            }
  120|      0|            if (isHoliday(d1))
  ------------------
  |  Branch (120:17): [True: 0, False: 0]
  ------------------
  121|      0|                return d2;
  122|      0|            else
  123|      0|                return d1;
  124|      0|        } else {
  125|      0|            QL_FAIL("unknown business-day convention");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
  126|      0|        }
  127|  28.7M|        return d1;
  128|  28.7M|    }
_ZNK8QuantLib8Calendar7advanceERKNS_4DateEiNS_8TimeUnitENS_21BusinessDayConventionEb:
  133|  57.5M|                           bool endOfMonth) const {
  134|  57.5M|        QL_REQUIRE(d!=Date(), "null date");
  ------------------
  |  |  117|  57.5M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  57.5M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  57.5M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  57.5M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 57.5M]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  57.5M|} \
  |  |  ------------------
  |  |  |  |   85|  57.5M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  57.5M|QL_MULTILINE_ASSERTION_END
  ------------------
  135|  57.5M|        if (n == 0) {
  ------------------
  |  Branch (135:13): [True: 28.7M, False: 28.8M]
  ------------------
  136|  28.7M|            return adjust(d,c);
  137|  28.8M|        } else if (unit == Days) {
  ------------------
  |  Branch (137:20): [True: 0, False: 28.8M]
  ------------------
  138|      0|            Date d1 = d;
  139|      0|            if (n > 0) {
  ------------------
  |  Branch (139:17): [True: 0, False: 0]
  ------------------
  140|      0|                while (n > 0) {
  ------------------
  |  Branch (140:24): [True: 0, False: 0]
  ------------------
  141|      0|                    ++d1;
  142|      0|                    while (isHoliday(d1))
  ------------------
  |  Branch (142:28): [True: 0, False: 0]
  ------------------
  143|      0|                        ++d1;
  144|      0|                    --n;
  145|      0|                }
  146|      0|            } else {
  147|      0|                while (n < 0) {
  ------------------
  |  Branch (147:24): [True: 0, False: 0]
  ------------------
  148|      0|                    --d1;
  149|      0|                    while(isHoliday(d1))
  ------------------
  |  Branch (149:27): [True: 0, False: 0]
  ------------------
  150|      0|                        --d1;
  151|      0|                    ++n;
  152|      0|                }
  153|      0|            }
  154|      0|            return d1;
  155|  28.8M|        } else if (unit == Weeks) {
  ------------------
  |  Branch (155:20): [True: 0, False: 28.8M]
  ------------------
  156|      0|            Date d1 = d + n*unit;
  157|      0|            return adjust(d1,c);
  158|  28.8M|        } else {
  159|  28.8M|            Date d1 = d + n*unit;
  160|       |
  161|       |            // we are sure the unit is Months or Years
  162|  28.8M|            if (endOfMonth) {
  ------------------
  |  Branch (162:17): [True: 0, False: 28.8M]
  ------------------
  163|      0|                if (c == Unadjusted) {
  ------------------
  |  Branch (163:21): [True: 0, False: 0]
  ------------------
  164|       |                    // move to the last calendar day if d is the last calendar day
  165|      0|                    if (Date::isEndOfMonth(d)) return Date::endOfMonth(d1);
  ------------------
  |  Branch (165:25): [True: 0, False: 0]
  ------------------
  166|      0|                } else {
  167|       |                    // move to the last business day if d is the last business day
  168|      0|                    if (isEndOfMonth(d)) return Calendar::endOfMonth(d1);
  ------------------
  |  Branch (168:25): [True: 0, False: 0]
  ------------------
  169|      0|                }
  170|      0|            }
  171|  28.8M|            return adjust(d1, c);
  172|  28.8M|        }
  173|  57.5M|    }
_ZNK8QuantLib8Calendar7advanceERKNS_4DateERKNS_6PeriodENS_21BusinessDayConventionEb:
  178|  28.8M|                           bool endOfMonth) const {
  179|  28.8M|        return advance(d, p.length(), p.units(), c, endOfMonth);
  180|  28.8M|    }

_ZN8QuantLib8CalendarC2Ev:
   78|   399k|        Calendar() = default;
_ZN8QuantLib8Calendar4ImplD2Ev:
   66|   159k|            virtual ~Impl() = default;
_ZNK8QuantLib8Calendar13isBusinessDayERKNS_4DateE:
  229|  28.7M|    inline bool Calendar::isBusinessDay(const Date& d) const {
  230|  28.7M|        QL_REQUIRE(impl_, "no calendar implementation provided");
  ------------------
  |  |  117|  28.7M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.7M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  28.7M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  28.7M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 28.7M]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.7M|} \
  |  |  ------------------
  |  |  |  |   85|  28.7M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.7M|QL_MULTILINE_ASSERTION_END
  ------------------
  231|       |
  232|       |#ifdef QL_HIGH_RESOLUTION_DATE
  233|       |        const Date _d(d.dayOfMonth(), d.month(), d.year());
  234|       |#else
  235|  28.7M|        const Date& _d = d;
  236|  28.7M|#endif
  237|       |
  238|  28.7M|        if (!impl_->addedHolidays.empty() &&
  ------------------
  |  Branch (238:13): [True: 0, False: 28.7M]
  |  Branch (238:13): [True: 0, False: 28.7M]
  ------------------
  239|  28.7M|            impl_->addedHolidays.find(_d) != impl_->addedHolidays.end())
  ------------------
  |  Branch (239:13): [True: 0, False: 0]
  ------------------
  240|      0|            return false;
  241|       |
  242|  28.7M|        if (!impl_->removedHolidays.empty() &&
  ------------------
  |  Branch (242:13): [True: 0, False: 28.7M]
  |  Branch (242:13): [True: 0, False: 28.7M]
  ------------------
  243|  28.7M|            impl_->removedHolidays.find(_d) != impl_->removedHolidays.end())
  ------------------
  |  Branch (243:13): [True: 0, False: 0]
  ------------------
  244|      0|            return true;
  245|       |
  246|  28.7M|        return impl_->isBusinessDay(_d);
  247|  28.7M|    }
_ZNK8QuantLib8Calendar9isHolidayERKNS_4DateE:
  265|  28.7M|    inline bool Calendar::isHoliday(const Date& d) const {
  266|  28.7M|        return !isBusinessDay(d);
  267|  28.7M|    }

_ZN8QuantLib12NullCalendarC2Ev:
   47|   159k|        NullCalendar() {
   48|   159k|            impl_ = ext::shared_ptr<Calendar::Impl>(new NullCalendar::Impl);
   49|   159k|        }
_ZNK8QuantLib12NullCalendar4Impl13isBusinessDayERKNS_4DateE:
   44|  28.7M|            bool isBusinessDay(const Date&) const override { return true; }

_ZN8QuantLib4DateC2Ev:
   59|   346M|    : serialNumber_(Date::serial_type(0)) {}
_ZN8QuantLib4DateC2El:
   62|    400|    : serialNumber_(serialNumber) {
   63|    400|        checkSerialNumber(serialNumber);
   64|    400|    }
_ZN8QuantLib4DateC2EiNS_5MonthEi:
   66|  28.8M|    Date::Date(Day d, Month m, Year y) {
   67|  28.8M|        QL_REQUIRE(y > 1900 && y < 2200,
  ------------------
  |  |  117|  28.8M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.8M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  28.8M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  57.7M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:7): [True: 28.8M, False: 0]
  |  |  |  Branch (119:7): [True: 28.8M, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.8M|} \
  |  |  ------------------
  |  |  |  |   85|  28.8M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.8M|QL_MULTILINE_ASSERTION_END
  ------------------
   68|  28.8M|                   "year " << y << " out of bound. It must be in [1901,2199]");
   69|  28.8M|        QL_REQUIRE(Integer(m) > 0 && Integer(m) < 13,
  ------------------
  |  |  117|  28.8M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.8M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  57.7M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  57.7M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:7): [True: 28.8M, False: 0]
  |  |  |  Branch (119:7): [True: 28.8M, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.8M|} \
  |  |  ------------------
  |  |  |  |   85|  28.8M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.8M|QL_MULTILINE_ASSERTION_END
  ------------------
   70|  28.8M|                   "month " << Integer(m)
   71|  28.8M|                   << " outside January-December range [1,12]");
   72|       |
   73|  28.8M|        bool leap = isLeap(y);
   74|  28.8M|        Day len = monthLength(m,leap), offset = monthOffset(m,leap);
   75|  28.8M|        QL_REQUIRE(d <= len && d > 0,
  ------------------
  |  |  117|  28.8M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.8M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  28.8M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  57.7M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:7): [True: 28.8M, False: 0]
  |  |  |  Branch (119:7): [True: 28.8M, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.8M|} \
  |  |  ------------------
  |  |  |  |   85|  28.8M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.8M|QL_MULTILINE_ASSERTION_END
  ------------------
   76|  28.8M|                   "day outside month (" << Integer(m) << ") day-range "
   77|  28.8M|                   << "[1," << len << "]");
   78|       |
   79|  28.8M|        serialNumber_ = d + offset + yearOffset(y);
   80|  28.8M|    }
_ZNK8QuantLib4Date5monthEv:
   82|  57.7M|    Month Date::month() const {
   83|  57.7M|        Day d = dayOfYear(); // dayOfYear is 1 based
   84|  57.7M|        Integer m = d/30 + 1;
   85|  57.7M|        bool leap = isLeap(year());
   86|  57.7M|        while (d <= monthOffset(Month(m),leap))
  ------------------
  |  Branch (86:16): [True: 0, False: 57.7M]
  ------------------
   87|      0|            --m;
   88|  57.7M|        while (d > monthOffset(Month(m+1),leap)) // NOLINT(misc-misplaced-widening-cast)
  ------------------
  |  Branch (88:16): [True: 0, False: 57.7M]
  ------------------
   89|      0|            ++m;
   90|  57.7M|        return Month(m);
   91|  57.7M|    }
_ZNK8QuantLib4Date4yearEv:
   93|   202M|    Year Date::year() const {
   94|   202M|        Year y = (serialNumber_ / 365)+1900;
   95|       |        // yearOffset(y) is December 31st of the preceding year
   96|   202M|        if (serialNumber_ <= yearOffset(y))
  ------------------
  |  Branch (96:13): [True: 0, False: 202M]
  ------------------
   97|      0|            --y;
   98|   202M|        return y;
   99|   202M|    }
_ZN8QuantLib4Date7advanceERKS0_iNS_8TimeUnitE:
  139|  28.8M|    Date Date::advance(const Date& date, Integer n, TimeUnit units) {
  140|  28.8M|        switch (units) {
  141|      0|          case Days:
  ------------------
  |  Branch (141:11): [True: 0, False: 28.8M]
  ------------------
  142|      0|            return date + n;
  143|      0|          case Weeks:
  ------------------
  |  Branch (143:11): [True: 0, False: 28.8M]
  ------------------
  144|      0|            return date + 7*n;
  145|  28.8M|          case Months: {
  ------------------
  |  Branch (145:11): [True: 28.8M, False: 79.8k]
  ------------------
  146|  28.8M|            Day d = date.dayOfMonth();
  147|  28.8M|            Integer m = Integer(date.month())+n;
  148|  28.8M|            Year y = date.year();
  149|  28.8M|            while (m > 12) {
  ------------------
  |  Branch (149:20): [True: 0, False: 28.8M]
  ------------------
  150|      0|                m -= 12;
  151|      0|                y += 1;
  152|      0|            }
  153|   459M|            while (m < 1) {
  ------------------
  |  Branch (153:20): [True: 430M, False: 28.8M]
  ------------------
  154|   430M|                m += 12;
  155|   430M|                y -= 1;
  156|   430M|            }
  157|       |
  158|  28.8M|            QL_ENSURE(y >= 1900 && y <= 2199,
  ------------------
  |  |  130|  28.8M|#define QL_ENSURE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.8M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  131|  28.8M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  132|  57.6M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (132:7): [True: 28.8M, False: 0]
  |  |  |  Branch (132:7): [True: 28.8M, False: 0]
  |  |  ------------------
  |  |  133|      0|    std::ostringstream _ql_msg_stream; \
  |  |  134|      0|    _ql_msg_stream << message; \
  |  |  135|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  136|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  137|  28.8M|} \
  |  |  ------------------
  |  |  |  |   85|  28.8M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|  28.8M|QL_MULTILINE_ASSERTION_END
  ------------------
  159|  28.8M|                      "year " << y << " out of bounds. "
  160|  28.8M|                      << "It must be in [1901,2199]");
  161|       |
  162|  28.8M|            Integer length = monthLength(Month(m), isLeap(y));
  163|  28.8M|            if (d > length)
  ------------------
  |  Branch (163:17): [True: 0, False: 28.8M]
  ------------------
  164|      0|                d = length;
  165|       |
  166|  28.8M|            return {d, Month(m), y};
  167|  28.8M|          }
  168|  79.8k|          case Years: {
  ------------------
  |  Branch (168:11): [True: 79.8k, False: 28.8M]
  ------------------
  169|  79.8k|              Day d = date.dayOfMonth();
  170|  79.8k|              Month m = date.month();
  171|  79.8k|              Year y = date.year()+n;
  172|       |
  173|  79.8k|              QL_ENSURE(y >= 1900 && y <= 2199,
  ------------------
  |  |  130|  79.8k|#define QL_ENSURE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  131|  79.8k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  132|   159k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (132:7): [True: 79.8k, False: 0]
  |  |  |  Branch (132:7): [True: 79.8k, False: 0]
  |  |  ------------------
  |  |  133|      0|    std::ostringstream _ql_msg_stream; \
  |  |  134|      0|    _ql_msg_stream << message; \
  |  |  135|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  136|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  137|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
  174|  79.8k|                        "year " << y << " out of bounds. "
  175|  79.8k|                        << "It must be in [1901,2199]");
  176|       |
  177|  79.8k|              if (d == 29 && m == February && !isLeap(y))
  ------------------
  |  Branch (177:19): [True: 0, False: 79.8k]
  |  Branch (177:30): [True: 0, False: 0]
  |  Branch (177:47): [True: 0, False: 0]
  ------------------
  178|      0|                  d = 28;
  179|       |
  180|  79.8k|              return {d, m, y};
  181|  79.8k|          }
  182|      0|          default:
  ------------------
  |  Branch (182:11): [True: 0, False: 28.8M]
  ------------------
  183|      0|            QL_FAIL("undefined time units");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
  184|  28.8M|        }
  185|  28.8M|    }
_ZN8QuantLib4Date6isLeapEi:
  187|   144M|    bool Date::isLeap(Year y) {
  188|   144M|        static const bool YearIsLeap[] = {
  189|       |            // 1900 is leap in agreement with Excel's bug
  190|       |            // 1900 is out of valid date range anyway
  191|       |            // 1900-1909
  192|   144M|             true,false,false,false, true,false,false,false, true,false,
  193|       |            // 1910-1919
  194|   144M|            false,false, true,false,false,false, true,false,false,false,
  195|       |            // 1920-1929
  196|   144M|             true,false,false,false, true,false,false,false, true,false,
  197|       |            // 1930-1939
  198|   144M|            false,false, true,false,false,false, true,false,false,false,
  199|       |            // 1940-1949
  200|   144M|             true,false,false,false, true,false,false,false, true,false,
  201|       |            // 1950-1959
  202|   144M|            false,false, true,false,false,false, true,false,false,false,
  203|       |            // 1960-1969
  204|   144M|             true,false,false,false, true,false,false,false, true,false,
  205|       |            // 1970-1979
  206|   144M|            false,false, true,false,false,false, true,false,false,false,
  207|       |            // 1980-1989
  208|   144M|             true,false,false,false, true,false,false,false, true,false,
  209|       |            // 1990-1999
  210|   144M|            false,false, true,false,false,false, true,false,false,false,
  211|       |            // 2000-2009
  212|   144M|             true,false,false,false, true,false,false,false, true,false,
  213|       |            // 2010-2019
  214|   144M|            false,false, true,false,false,false, true,false,false,false,
  215|       |            // 2020-2029
  216|   144M|             true,false,false,false, true,false,false,false, true,false,
  217|       |            // 2030-2039
  218|   144M|            false,false, true,false,false,false, true,false,false,false,
  219|       |            // 2040-2049
  220|   144M|             true,false,false,false, true,false,false,false, true,false,
  221|       |            // 2050-2059
  222|   144M|            false,false, true,false,false,false, true,false,false,false,
  223|       |            // 2060-2069
  224|   144M|             true,false,false,false, true,false,false,false, true,false,
  225|       |            // 2070-2079
  226|   144M|            false,false, true,false,false,false, true,false,false,false,
  227|       |            // 2080-2089
  228|   144M|             true,false,false,false, true,false,false,false, true,false,
  229|       |            // 2090-2099
  230|   144M|            false,false, true,false,false,false, true,false,false,false,
  231|       |            // 2100-2109
  232|   144M|            false,false,false,false, true,false,false,false, true,false,
  233|       |            // 2110-2119
  234|   144M|            false,false, true,false,false,false, true,false,false,false,
  235|       |            // 2120-2129
  236|   144M|             true,false,false,false, true,false,false,false, true,false,
  237|       |            // 2130-2139
  238|   144M|            false,false, true,false,false,false, true,false,false,false,
  239|       |            // 2140-2149
  240|   144M|             true,false,false,false, true,false,false,false, true,false,
  241|       |            // 2150-2159
  242|   144M|            false,false, true,false,false,false, true,false,false,false,
  243|       |            // 2160-2169
  244|   144M|             true,false,false,false, true,false,false,false, true,false,
  245|       |            // 2170-2179
  246|   144M|            false,false, true,false,false,false, true,false,false,false,
  247|       |            // 2180-2189
  248|   144M|             true,false,false,false, true,false,false,false, true,false,
  249|       |            // 2190-2199
  250|   144M|            false,false, true,false,false,false, true,false,false,false,
  251|       |            // 2200
  252|   144M|            false
  253|   144M|        };
  254|   144M|        QL_REQUIRE(y>=1900 && y<=2200, "year outside valid range");
  ------------------
  |  |  117|   144M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|   144M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|   144M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|   288M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:7): [True: 144M, False: 0]
  |  |  |  Branch (119:7): [True: 144M, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|   144M|} \
  |  |  ------------------
  |  |  |  |   85|   144M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|   144M|QL_MULTILINE_ASSERTION_END
  ------------------
  255|   144M|        return YearIsLeap[y-1900];
  256|   144M|    }
_ZN8QuantLib4Date11monthLengthENS_5MonthEb:
  259|  57.6M|    Integer Date::monthLength(Month m, bool leapYear) {
  260|  57.6M|        static const Integer MonthLength[] = {
  261|  57.6M|            31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
  262|  57.6M|        };
  263|  57.6M|        static const Integer MonthLeapLength[] = {
  264|  57.6M|            31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
  265|  57.6M|        };
  266|  57.6M|        return (leapYear? MonthLeapLength[m-1] : MonthLength[m-1]);
  ------------------
  |  Branch (266:17): [True: 13.4M, False: 44.2M]
  ------------------
  267|  57.6M|    }
_ZN8QuantLib4Date11monthOffsetENS_5MonthEb:
  269|   173M|    Integer Date::monthOffset(Month m, bool leapYear) {
  270|   173M|        static const Integer MonthOffset[] = {
  271|   173M|              0,  31,  59,  90, 120, 151,   // Jan - Jun
  272|   173M|            181, 212, 243, 273, 304, 334,   // Jun - Dec
  273|   173M|            365     // used in dayOfMonth to bracket day
  274|   173M|        };
  275|   173M|        static const Integer MonthLeapOffset[] = {
  276|   173M|              0,  31,  60,  91, 121, 152,   // Jan - Jun
  277|   173M|            182, 213, 244, 274, 305, 335,   // Jun - Dec
  278|   173M|            366     // used in dayOfMonth to bracket day
  279|   173M|        };
  280|   173M|        return (leapYear? MonthLeapOffset[m-1] : MonthOffset[m-1]);
  ------------------
  |  Branch (280:17): [True: 6.70M, False: 166M]
  ------------------
  281|   173M|    }
_ZN8QuantLib4Date10yearOffsetEi:
  283|   317M|    Date::serial_type Date::yearOffset(Year y) {
  284|       |        // the list of all December 31st in the preceding year
  285|       |        // e.g. for 1901 yearOffset[1] is 366, that is, December 31 1900
  286|   317M|        static const Date::serial_type YearOffset[] = {
  287|       |            // 1900-1909
  288|   317M|                0,  366,  731, 1096, 1461, 1827, 2192, 2557, 2922, 3288,
  289|       |            // 1910-1919
  290|   317M|             3653, 4018, 4383, 4749, 5114, 5479, 5844, 6210, 6575, 6940,
  291|       |            // 1920-1929
  292|   317M|             7305, 7671, 8036, 8401, 8766, 9132, 9497, 9862,10227,10593,
  293|       |            // 1930-1939
  294|   317M|            10958,11323,11688,12054,12419,12784,13149,13515,13880,14245,
  295|       |            // 1940-1949
  296|   317M|            14610,14976,15341,15706,16071,16437,16802,17167,17532,17898,
  297|       |            // 1950-1959
  298|   317M|            18263,18628,18993,19359,19724,20089,20454,20820,21185,21550,
  299|       |            // 1960-1969
  300|   317M|            21915,22281,22646,23011,23376,23742,24107,24472,24837,25203,
  301|       |            // 1970-1979
  302|   317M|            25568,25933,26298,26664,27029,27394,27759,28125,28490,28855,
  303|       |            // 1980-1989
  304|   317M|            29220,29586,29951,30316,30681,31047,31412,31777,32142,32508,
  305|       |            // 1990-1999
  306|   317M|            32873,33238,33603,33969,34334,34699,35064,35430,35795,36160,
  307|       |            // 2000-2009
  308|   317M|            36525,36891,37256,37621,37986,38352,38717,39082,39447,39813,
  309|       |            // 2010-2019
  310|   317M|            40178,40543,40908,41274,41639,42004,42369,42735,43100,43465,
  311|       |            // 2020-2029
  312|   317M|            43830,44196,44561,44926,45291,45657,46022,46387,46752,47118,
  313|       |            // 2030-2039
  314|   317M|            47483,47848,48213,48579,48944,49309,49674,50040,50405,50770,
  315|       |            // 2040-2049
  316|   317M|            51135,51501,51866,52231,52596,52962,53327,53692,54057,54423,
  317|       |            // 2050-2059
  318|   317M|            54788,55153,55518,55884,56249,56614,56979,57345,57710,58075,
  319|       |            // 2060-2069
  320|   317M|            58440,58806,59171,59536,59901,60267,60632,60997,61362,61728,
  321|       |            // 2070-2079
  322|   317M|            62093,62458,62823,63189,63554,63919,64284,64650,65015,65380,
  323|       |            // 2080-2089
  324|   317M|            65745,66111,66476,66841,67206,67572,67937,68302,68667,69033,
  325|       |            // 2090-2099
  326|   317M|            69398,69763,70128,70494,70859,71224,71589,71955,72320,72685,
  327|       |            // 2100-2109
  328|   317M|            73050,73415,73780,74145,74510,74876,75241,75606,75971,76337,
  329|       |            // 2110-2119
  330|   317M|            76702,77067,77432,77798,78163,78528,78893,79259,79624,79989,
  331|       |            // 2120-2129
  332|   317M|            80354,80720,81085,81450,81815,82181,82546,82911,83276,83642,
  333|       |            // 2130-2139
  334|   317M|            84007,84372,84737,85103,85468,85833,86198,86564,86929,87294,
  335|       |            // 2140-2149
  336|   317M|            87659,88025,88390,88755,89120,89486,89851,90216,90581,90947,
  337|       |            // 2150-2159
  338|   317M|            91312,91677,92042,92408,92773,93138,93503,93869,94234,94599,
  339|       |            // 2160-2169
  340|   317M|            94964,95330,95695,96060,96425,96791,97156,97521,97886,98252,
  341|       |            // 2170-2179
  342|   317M|            98617,98982,99347,99713,100078,100443,100808,101174,101539,101904,
  343|       |            // 2180-2189
  344|   317M|            102269,102635,103000,103365,103730,104096,104461,104826,105191,105557,
  345|       |            // 2190-2199
  346|   317M|            105922,106287,106652,107018,107383,107748,108113,108479,108844,109209,
  347|       |            // 2200
  348|   317M|            109574
  349|   317M|        };
  350|   317M|        return YearOffset[y-1900];
  351|   317M|    }
_ZN8QuantLib4Date19minimumSerialNumberEv:
  749|    400|    Date::serial_type Date::minimumSerialNumber() {
  750|    400|        return 367;       // Jan 1st, 1901
  751|    400|    }
_ZN8QuantLib4Date19maximumSerialNumberEv:
  753|    400|    Date::serial_type Date::maximumSerialNumber() {
  754|    400|        return 109574;    // Dec 31st, 2199
  755|    400|    }
_ZN8QuantLib4Date17checkSerialNumberEl:
  757|    400|    void Date::checkSerialNumber(Date::serial_type serialNumber) {
  758|    400|        QL_REQUIRE(serialNumber >= minimumSerialNumber() &&
  ------------------
  |  |  117|    400|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|    400|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|    400|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|    800|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:7): [True: 400, False: 0]
  |  |  |  Branch (119:7): [True: 400, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|    400|} \
  |  |  ------------------
  |  |  |  |   85|    400|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|    400|QL_MULTILINE_ASSERTION_END
  ------------------
  759|    400|                   serialNumber <= maximumSerialNumber(),
  760|    400|                   "Date's serial number (" << serialNumber << ") outside "
  761|    400|                   "allowed range [" << minimumSerialNumber() <<
  762|    400|                   "-" << maximumSerialNumber() << "], i.e. [" <<
  763|    400|                   minDate() << "-" << maxDate() << "]");
  764|    400|    }
_ZN8QuantLib4Date10todaysDateEv:
  788|  1.03k|    Date Date::todaysDate() {
  789|  1.03k|        std::time_t t;
  790|       |
  791|  1.03k|        if (std::time(&t) == std::time_t(-1)) // -1 means time() didn't work
  ------------------
  |  Branch (791:13): [True: 0, False: 1.03k]
  ------------------
  792|      0|            return {};
  793|  1.03k|        std::tm *lt = std::localtime(&t);
  794|  1.03k|        return {Day(lt->tm_mday), Month(lt->tm_mon + 1), Year(lt->tm_year + 1900)};
  795|  1.03k|    }

_ZN8QuantLibeqERKNS_4DateES2_:
  442|  86.4M|    inline bool operator==(const Date& d1, const Date& d2) {
  443|  86.4M|        return (d1.serialNumber() == d2.serialNumber());
  444|  86.4M|    }
_ZNK8QuantLib4Date12serialNumberEv:
  404|  1.92G|    inline Date::serial_type Date::serialNumber() const {
  405|  1.92G|        return serialNumber_;
  406|  1.92G|    }
_ZN8QuantLibneERKNS_4DateES2_:
  446|   316M|    inline bool operator!=(const Date& d1, const Date& d2) {
  447|   316M|        return (d1.serialNumber() != d2.serialNumber());
  448|   316M|    }
_ZN8QuantLibltERKNS_4DateES2_:
  450|   302M|    inline bool operator<(const Date& d1, const Date& d2) {
  451|   302M|        return (d1.serialNumber() < d2.serialNumber());
  452|   302M|    }
_ZN8QuantLibleERKNS_4DateES2_:
  454|  28.8M|    inline bool operator<=(const Date& d1, const Date& d2) {
  455|  28.8M|        return (d1.serialNumber() <= d2.serialNumber());
  456|  28.8M|    }
_ZNK8QuantLib4Date10dayOfMonthEv:
  396|  28.8M|    inline Day Date::dayOfMonth() const {
  397|  28.8M|        return dayOfYear() - monthOffset(month(),isLeap(year()));
  398|  28.8M|    }
_ZNK8QuantLib4Date9dayOfYearEv:
  400|  86.6M|    inline Day Date::dayOfYear() const {
  401|  86.6M|        return serialNumber_ - yearOffset(year());
  402|  86.6M|    }
_ZNK8QuantLib4DateplERKNS_6PeriodE:
  416|  28.8M|    inline Date Date::operator+(const Period& p) const {
  417|  28.8M|        return advance(*this,p.length(),p.units());
  418|  28.8M|    }
_ZN8QuantLibmiERKNS_4DateES2_:
  434|  86.1M|    inline Date::serial_type operator-(const Date& d1, const Date& d2) {
  435|  86.1M|        return d1.serialNumber()-d2.serialNumber();
  436|  86.1M|    }
_ZN8QuantLib11daysBetweenERKNS_4DateES2_:
  438|  57.4M|    inline Time daysBetween(const Date& d1, const Date& d2) {
  439|  57.4M|        return Time(d2-d1);
  440|  57.4M|    }
_ZN8QuantLibgtERKNS_4DateES2_:
  458|  86.1M|    inline bool operator>(const Date& d1, const Date& d2) {
  459|  86.1M|        return (d1.serialNumber() > d2.serialNumber());
  460|  86.1M|    }
_ZN8QuantLibgeERKNS_4DateES2_:
  462|  57.5M|    inline bool operator>=(const Date& d1, const Date& d2) {
  463|  57.5M|        return (d1.serialNumber() >= d2.serialNumber());
  464|  57.5M|    }

_ZN8QuantLib10DayCounterC2EN5boost10shared_ptrINS0_4ImplEEE:
   65|  79.8k|        explicit DayCounter(ext::shared_ptr<Impl> impl) : impl_(std::move(impl)) {}
_ZNK8QuantLib10DayCounter12yearFractionERKNS_4DateES3_S3_S3_:
  129|  28.7M|        const Date& refPeriodStart, const Date& refPeriodEnd) const {
  130|  28.7M|            QL_REQUIRE(impl_, "no day counter implementation provided");
  ------------------
  |  |  117|  28.7M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.7M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  28.7M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  28.7M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 28.7M]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.7M|} \
  |  |  ------------------
  |  |  |  |   85|  28.7M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.7M|QL_MULTILINE_ASSERTION_END
  ------------------
  131|  28.7M|            return impl_->yearFraction(d1,d2,refPeriodStart,refPeriodEnd);
  132|  28.7M|    }
_ZN8QuantLib10DayCounterC2Ev:
   72|   239k|        DayCounter() = default;
_ZNK8QuantLib10DayCounter5emptyEv:
  113|   159k|    inline bool DayCounter::empty() const {
  114|   159k|        return !impl_;
  115|   159k|    }
_ZN8QuantLib10DayCounter4ImplD2Ev:
   49|  79.8k|            virtual ~Impl() = default;

_ZN8QuantLib12ActualActual14implementationENS0_10ConventionENS_8ScheduleE:
  127|  79.8k|    ActualActual::implementation(ActualActual::Convention c, Schedule schedule) {
  128|  79.8k|        switch (c) {
  129|  79.8k|          case ISMA:
  ------------------
  |  Branch (129:11): [True: 79.8k, False: 0]
  ------------------
  130|  79.8k|          case Bond:
  ------------------
  |  Branch (130:11): [True: 0, False: 79.8k]
  ------------------
  131|  79.8k|            if (!schedule.empty())
  ------------------
  |  Branch (131:17): [True: 0, False: 79.8k]
  ------------------
  132|      0|                return ext::shared_ptr<DayCounter::Impl>(new ISMA_Impl(std::move(schedule)));
  133|  79.8k|            else
  134|  79.8k|                return ext::shared_ptr<DayCounter::Impl>(new Old_ISMA_Impl);
  135|      0|          case ISDA:
  ------------------
  |  Branch (135:11): [True: 0, False: 79.8k]
  ------------------
  136|      0|          case Historical:
  ------------------
  |  Branch (136:11): [True: 0, False: 79.8k]
  ------------------
  137|      0|          case Actual365:
  ------------------
  |  Branch (137:11): [True: 0, False: 79.8k]
  ------------------
  138|      0|            return ext::shared_ptr<DayCounter::Impl>(new ISDA_Impl);
  139|      0|          case AFB:
  ------------------
  |  Branch (139:11): [True: 0, False: 79.8k]
  ------------------
  140|      0|          case Euro:
  ------------------
  |  Branch (140:11): [True: 0, False: 79.8k]
  ------------------
  141|      0|            return ext::shared_ptr<DayCounter::Impl>(new AFB_Impl);
  142|      0|          default:
  ------------------
  |  Branch (142:11): [True: 0, False: 79.8k]
  ------------------
  143|      0|            QL_FAIL("unknown act/act convention");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
  144|  79.8k|        }
  145|  79.8k|    }
_ZNK8QuantLib12ActualActual13Old_ISMA_Impl12yearFractionERKNS_4DateES4_S4_S4_:
  188|  28.7M|                                                   const Date& d4) const {
  189|  28.7M|        if (d1 == d2)
  ------------------
  |  Branch (189:13): [True: 0, False: 28.7M]
  ------------------
  190|      0|            return 0.0;
  191|       |
  192|  28.7M|        if (d1 > d2)
  ------------------
  |  Branch (192:13): [True: 0, False: 28.7M]
  ------------------
  193|      0|            return -yearFraction(d2,d1,d3,d4);
  194|       |
  195|       |        // when the reference period is not specified, try taking
  196|       |        // it equal to (d1,d2)
  197|  28.7M|        Date refPeriodStart = (d3 != Date() ? d3 : d1);
  ------------------
  |  Branch (197:32): [True: 28.7M, False: 0]
  ------------------
  198|  28.7M|        Date refPeriodEnd = (d4 != Date() ? d4 : d2);
  ------------------
  |  Branch (198:30): [True: 28.7M, False: 0]
  ------------------
  199|       |
  200|  28.7M|        QL_REQUIRE(refPeriodEnd > refPeriodStart && refPeriodEnd > d1,
  ------------------
  |  |  117|  28.7M|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  28.7M|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  28.7M|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  57.4M|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:7): [True: 28.7M, False: 0]
  |  |  |  Branch (119:7): [True: 28.7M, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  28.7M|} \
  |  |  ------------------
  |  |  |  |   85|  28.7M|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  28.7M|QL_MULTILINE_ASSERTION_END
  ------------------
  201|  28.7M|                   "invalid reference period: "
  202|  28.7M|                   << "date 1: " << d1
  203|  28.7M|                   << ", date 2: " << d2
  204|  28.7M|                   << ", reference period start: " << refPeriodStart
  205|  28.7M|                   << ", reference period end: " << refPeriodEnd);
  206|       |
  207|       |        // estimate roughly the length in months of a period
  208|  28.7M|        auto months = (Integer)std::lround(12 * Real(refPeriodEnd - refPeriodStart) / 365);
  209|       |
  210|       |        // for short periods...
  211|  28.7M|        if (months == 0) {
  ------------------
  |  Branch (211:13): [True: 0, False: 28.7M]
  ------------------
  212|       |            // ...take the reference period as 1 year from d1
  213|      0|            refPeriodStart = d1;
  214|      0|            refPeriodEnd = d1 + 1*Years;
  215|      0|            months = 12;
  216|      0|        }
  217|       |
  218|  28.7M|        Time period = Real(months)/12.0;
  219|       |
  220|  28.7M|        if (d2 <= refPeriodEnd) {
  ------------------
  |  Branch (220:13): [True: 28.7M, False: 0]
  ------------------
  221|       |            // here refPeriodEnd is a future (notional?) payment date
  222|  28.7M|            if (d1 >= refPeriodStart) {
  ------------------
  |  Branch (222:17): [True: 28.7M, False: 0]
  ------------------
  223|       |                // here refPeriodStart is the last (maybe notional)
  224|       |                // payment date.
  225|       |                // refPeriodStart <= d1 <= d2 <= refPeriodEnd
  226|       |                // [maybe the equality should be enforced, since
  227|       |                // refPeriodStart < d1 <= d2 < refPeriodEnd
  228|       |                // could give wrong results] ???
  229|  28.7M|                return period*Real(daysBetween(d1,d2)) /
  230|  28.7M|                    daysBetween(refPeriodStart,refPeriodEnd);
  231|  28.7M|            } else {
  232|       |                // here refPeriodStart is the next (maybe notional)
  233|       |                // payment date and refPeriodEnd is the second next
  234|       |                // (maybe notional) payment date.
  235|       |                // d1 < refPeriodStart < refPeriodEnd
  236|       |                // AND d2 <= refPeriodEnd
  237|       |                // this case is long first coupon
  238|       |
  239|       |                // the last notional payment date
  240|      0|                Date previousRef = refPeriodStart - months*Months;
  241|       |
  242|      0|                if (d2 > refPeriodStart)
  ------------------
  |  Branch (242:21): [True: 0, False: 0]
  ------------------
  243|      0|                    return yearFraction(d1, refPeriodStart, previousRef,
  244|      0|                                        refPeriodStart) +
  245|      0|                        yearFraction(refPeriodStart, d2, refPeriodStart,
  246|      0|                                     refPeriodEnd);
  247|      0|                else
  248|      0|                    return yearFraction(d1,d2,previousRef,refPeriodStart);
  249|      0|            }
  250|  28.7M|        } else {
  251|       |            // here refPeriodEnd is the last (notional?) payment date
  252|       |            // d1 < refPeriodEnd < d2 AND refPeriodStart < refPeriodEnd
  253|      0|            QL_REQUIRE(refPeriodStart<=d1,
  ------------------
  |  |  117|      0|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|      0|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|      0|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|      0|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|      0|} \
  |  |  ------------------
  |  |  |  |   85|      0|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|      0|QL_MULTILINE_ASSERTION_END
  ------------------
  254|      0|                       "invalid dates: "
  255|      0|                       "d1 < refPeriodStart < refPeriodEnd < d2");
  256|       |            // now it is: refPeriodStart <= d1 < refPeriodEnd < d2
  257|       |
  258|       |            // the part from d1 to refPeriodEnd
  259|      0|            Time sum = yearFraction(d1, refPeriodEnd,
  260|      0|                                    refPeriodStart, refPeriodEnd);
  261|       |
  262|       |            // the part from refPeriodEnd to d2
  263|       |            // count how many regular periods are in [refPeriodEnd, d2],
  264|       |            // then add the remaining time
  265|      0|            Integer i=0;
  266|      0|            Date newRefStart, newRefEnd;
  267|      0|            for (;;) {
  268|      0|                newRefStart = refPeriodEnd + (months*i)*Months;
  269|      0|                newRefEnd = refPeriodEnd + (months*(i+1))*Months;
  270|      0|                if (d2 < newRefEnd) {
  ------------------
  |  Branch (270:21): [True: 0, False: 0]
  ------------------
  271|      0|                    break;
  272|      0|                } else {
  273|      0|                    sum += period;
  274|      0|                    i++;
  275|      0|                }
  276|      0|            }
  277|      0|            sum += yearFraction(newRefStart,d2,newRefStart,newRefEnd);
  278|      0|            return sum;
  279|      0|        }
  280|  28.7M|    }

_ZN8QuantLib12ActualActualC2ENS0_10ConventionENS_8ScheduleE:
   93|  79.8k|        : DayCounter(implementation(c, std::move(schedule))) {}

_ZN8QuantLib9Thirty36014implementationENS0_10ConventionERKNS_4DateE:
   35|      2|    Thirty360::implementation(Thirty360::Convention c, const Date& terminationDate) {
   36|      2|        switch (c) {
   37|      0|          case USA:
  ------------------
  |  Branch (37:11): [True: 0, False: 2]
  ------------------
   38|      0|            return ext::shared_ptr<DayCounter::Impl>(new US_Impl);
   39|      0|          case European:
  ------------------
  |  Branch (39:11): [True: 0, False: 2]
  ------------------
   40|      0|          case EurobondBasis:
  ------------------
  |  Branch (40:11): [True: 0, False: 2]
  ------------------
   41|      0|            return ext::shared_ptr<DayCounter::Impl>(new EU_Impl);
   42|      0|          case Italian:
  ------------------
  |  Branch (42:11): [True: 0, False: 2]
  ------------------
   43|      0|            return ext::shared_ptr<DayCounter::Impl>(new IT_Impl);
   44|      0|          case ISMA:
  ------------------
  |  Branch (44:11): [True: 0, False: 2]
  ------------------
   45|      2|          case BondBasis:
  ------------------
  |  Branch (45:11): [True: 2, False: 0]
  ------------------
   46|      2|            return ext::shared_ptr<DayCounter::Impl>(new ISMA_Impl);
   47|      0|          case ISDA:
  ------------------
  |  Branch (47:11): [True: 0, False: 2]
  ------------------
   48|      0|          case German:
  ------------------
  |  Branch (48:11): [True: 0, False: 2]
  ------------------
   49|      0|            return ext::shared_ptr<DayCounter::Impl>(new ISDA_Impl(terminationDate));
   50|      0|          case NASD:
  ------------------
  |  Branch (50:11): [True: 0, False: 2]
  ------------------
   51|      0|            return ext::shared_ptr<DayCounter::Impl>(new NASD_Impl);
   52|      0|          default:
  ------------------
  |  Branch (52:11): [True: 0, False: 2]
  ------------------
   53|      0|            QL_FAIL("unknown 30/360 convention");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
   54|      2|        }
   55|      2|    }

_ZN8QuantLib9Thirty360C2ENS0_10ConventionERKNS_4DateE:
  135|      2|        : DayCounter(implementation(c, terminationDate)) {}

ecb.cpp:_ZNK8QuantLib12_GLOBAL__N_13$_0clEv:
   56|      2|        const MonthBimap_t MONTHS = []() {
   57|      2|          MonthBimap_t months;
   58|      2|          months.insert({"JAN", January});
   59|      2|          months.insert({"FEB", February});
   60|      2|          months.insert({"MAR", March});
   61|      2|          months.insert({"APR", April});
   62|      2|          months.insert({"MAY", May});
   63|      2|          months.insert({"JUN", June});
   64|      2|          months.insert({"JUL", July});
   65|      2|          months.insert({"AUG", August});
   66|      2|          months.insert({"SEP", September});
   67|      2|          months.insert({"OCT", October});
   68|      2|          months.insert({"NOV", November});
   69|      2|          months.insert({"DEC", December});
   70|      2|          return months;
   71|      2|        }();
ecb.cpp:_ZNK8QuantLib12_GLOBAL__N_18is_ilessclEN5boost17basic_string_viewIcNSt3__111char_traitsIcEEEES7_:
   40|     76|                          const boost::string_view rhs) const {
   41|     76|            char lhsUpper[3];
   42|     76|            char rhsUpper[3];
   43|    304|            for (int i = 0; i < 3; ++i) {
  ------------------
  |  Branch (43:29): [True: 228, False: 76]
  ------------------
   44|    228|              lhsUpper[i] = std::toupper(lhs[i]);
   45|    228|              rhsUpper[i] = std::toupper(rhs[i]);
   46|    228|            }
   47|     76|            return boost::string_view(lhsUpper, 3) <
   48|     76|                   boost::string_view(rhsUpper, 3);
   49|     76|          }

_ZN8QuantLib6PeriodC2ENS_9FrequencyE:
   29|   159k|    Period::Period(Frequency f) {
   30|   159k|        switch (f) {
   31|      0|          case NoFrequency:
  ------------------
  |  Branch (31:11): [True: 0, False: 159k]
  ------------------
   32|       |            // same as Period()
   33|      0|            units_ = Days;
   34|      0|            length_ = 0;
   35|      0|            break;
   36|      0|          case Once:
  ------------------
  |  Branch (36:11): [True: 0, False: 159k]
  ------------------
   37|      0|            units_ = Years;
   38|      0|            length_ = 0;
   39|      0|            break;
   40|      0|          case Annual:
  ------------------
  |  Branch (40:11): [True: 0, False: 159k]
  ------------------
   41|      0|            units_ = Years;
   42|      0|            length_ = 1;
   43|      0|            break;
   44|      0|          case Semiannual:
  ------------------
  |  Branch (44:11): [True: 0, False: 159k]
  ------------------
   45|      0|          case EveryFourthMonth:
  ------------------
  |  Branch (45:11): [True: 0, False: 159k]
  ------------------
   46|      0|          case Quarterly:
  ------------------
  |  Branch (46:11): [True: 0, False: 159k]
  ------------------
   47|      0|          case Bimonthly:
  ------------------
  |  Branch (47:11): [True: 0, False: 159k]
  ------------------
   48|   159k|          case Monthly:
  ------------------
  |  Branch (48:11): [True: 159k, False: 0]
  ------------------
   49|   159k|            units_ = Months;
   50|   159k|            length_ = 12/f;
   51|   159k|            break;
   52|      0|          case EveryFourthWeek:
  ------------------
  |  Branch (52:11): [True: 0, False: 159k]
  ------------------
   53|      0|          case Biweekly:
  ------------------
  |  Branch (53:11): [True: 0, False: 159k]
  ------------------
   54|      0|          case Weekly:
  ------------------
  |  Branch (54:11): [True: 0, False: 159k]
  ------------------
   55|      0|            units_ = Weeks;
   56|      0|            length_ = 52/f;
   57|      0|            break;
   58|      0|          case Daily:
  ------------------
  |  Branch (58:11): [True: 0, False: 159k]
  ------------------
   59|      0|            units_ = Days;
   60|      0|            length_ = 1;
   61|      0|            break;
   62|      0|          case OtherFrequency:
  ------------------
  |  Branch (62:11): [True: 0, False: 159k]
  ------------------
   63|      0|            QL_FAIL("unknown frequency");  // no point in showing 999...
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
   64|      0|          default:
  ------------------
  |  Branch (64:11): [True: 0, False: 159k]
  ------------------
   65|      0|            QL_FAIL("unknown frequency (" << Integer(f) << ")");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
   66|   159k|        }
   67|   159k|    }
_ZNK8QuantLib6Period9frequencyEv:
   69|  79.8k|    Frequency Period::frequency() const {
   70|       |        // unsigned version
   71|  79.8k|        Size length = std::abs(length_);
   72|       |
   73|  79.8k|        if (length==0) {
  ------------------
  |  Branch (73:13): [True: 0, False: 79.8k]
  ------------------
   74|      0|            if (units_==Years) return Once;
  ------------------
  |  Branch (74:17): [True: 0, False: 0]
  ------------------
   75|      0|            return NoFrequency;
   76|      0|        }
   77|       |
   78|  79.8k|        switch (units_) {
   79|      0|          case Years:
  ------------------
  |  Branch (79:11): [True: 0, False: 79.8k]
  ------------------
   80|      0|            if (length == 1)
  ------------------
  |  Branch (80:17): [True: 0, False: 0]
  ------------------
   81|      0|                return Annual;
   82|      0|            else
   83|      0|                return OtherFrequency;
   84|  79.8k|          case Months:
  ------------------
  |  Branch (84:11): [True: 79.8k, False: 0]
  ------------------
   85|  79.8k|            if (12%length == 0 && length <= 12)
  ------------------
  |  Branch (85:17): [True: 79.8k, False: 0]
  |  Branch (85:35): [True: 79.8k, False: 0]
  ------------------
   86|  79.8k|                return Frequency(12/length);
   87|      0|            else
   88|      0|                return OtherFrequency;
   89|      0|          case Weeks:
  ------------------
  |  Branch (89:11): [True: 0, False: 79.8k]
  ------------------
   90|      0|            if (length==1)
  ------------------
  |  Branch (90:17): [True: 0, False: 0]
  ------------------
   91|      0|                return Weekly;
   92|      0|            else if (length==2)
  ------------------
  |  Branch (92:22): [True: 0, False: 0]
  ------------------
   93|      0|                return Biweekly;
   94|      0|            else if (length==4)
  ------------------
  |  Branch (94:22): [True: 0, False: 0]
  ------------------
   95|      0|                return EveryFourthWeek;
   96|      0|            else
   97|      0|                return OtherFrequency;
   98|      0|          case Days:
  ------------------
  |  Branch (98:11): [True: 0, False: 79.8k]
  ------------------
   99|      0|            if (length==1)
  ------------------
  |  Branch (99:17): [True: 0, False: 0]
  ------------------
  100|      0|                return Daily;
  101|      0|            else
  102|      0|                return OtherFrequency;
  103|      0|          default:
  ------------------
  |  Branch (103:11): [True: 0, False: 79.8k]
  ------------------
  104|      0|            QL_FAIL("unknown time unit (" << Integer(units_) << ")");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
  105|  79.8k|        }
  106|  79.8k|    }
_ZN8QuantLibltERKNS_6PeriodES2_:
  347|  58.2M|    bool operator<(const Period& p1, const Period& p2) {
  348|       |
  349|       |        // special cases
  350|  58.2M|        if (p1.length() == 0)
  ------------------
  |  Branch (350:13): [True: 57.4M, False: 798k]
  ------------------
  351|  57.4M|            return p2.length() > 0;
  352|   798k|        if (p2.length() == 0)
  ------------------
  |  Branch (352:13): [True: 0, False: 798k]
  ------------------
  353|      0|            return p1.length() < 0;
  354|       |
  355|       |        // exact comparisons
  356|   798k|        if (p1.units() == p2.units())
  ------------------
  |  Branch (356:13): [True: 79.8k, False: 718k]
  ------------------
  357|  79.8k|            return p1.length() < p2.length();
  358|   718k|        if (p1.units() == Months && p2.units() == Years)
  ------------------
  |  Branch (358:13): [True: 638k, False: 79.8k]
  |  Branch (358:37): [True: 638k, False: 0]
  ------------------
  359|   638k|            return p1.length() < 12*p2.length();
  360|  79.8k|        if (p1.units() == Years && p2.units() == Months)
  ------------------
  |  Branch (360:13): [True: 79.8k, False: 0]
  |  Branch (360:36): [True: 79.8k, False: 0]
  ------------------
  361|  79.8k|            return 12*p1.length() < p2.length();
  362|      0|        if (p1.units() == Days && p2.units() == Weeks)
  ------------------
  |  Branch (362:13): [True: 0, False: 0]
  |  Branch (362:35): [True: 0, False: 0]
  ------------------
  363|      0|            return p1.length() < 7*p2.length();
  364|      0|        if (p1.units() == Weeks && p2.units() == Days)
  ------------------
  |  Branch (364:13): [True: 0, False: 0]
  |  Branch (364:36): [True: 0, False: 0]
  ------------------
  365|      0|            return 7*p1.length() < p2.length();
  366|       |
  367|       |        // inexact comparisons (handled by converting to days and using limits)
  368|      0|        std::pair<Integer, Integer> p1lim = daysMinMax(p1);
  369|      0|        std::pair<Integer, Integer> p2lim = daysMinMax(p2);
  370|       |
  371|      0|        if (p1lim.second < p2lim.first)
  ------------------
  |  Branch (371:13): [True: 0, False: 0]
  ------------------
  372|      0|            return true;
  373|      0|        else if (p1lim.first > p2lim.second)
  ------------------
  |  Branch (373:18): [True: 0, False: 0]
  ------------------
  374|      0|            return false;
  375|      0|        else
  376|      0|            QL_FAIL("undecidable comparison between " << p1 << " and " << p2);
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
  377|      0|    }

_ZN8QuantLib6PeriodC2EiNS_8TimeUnitE:
   48|  58.4M|        : length_(n), units_(units) {}
_ZN8QuantLib6PeriodC2Ev:
   46|  28.8M|        Period() = default;
_ZNK8QuantLib6Period6lengthEv:
   50|   205M|        Integer length() const { return length_; }
_ZNK8QuantLib6Period5unitsEv:
   51|  90.4M|        TimeUnit units() const { return units_; }
_ZN8QuantLibmlEiRKNS_6PeriodE:
  158|  28.8M|    inline Period operator*(Integer n, const Period& p) { return {n * p.length(), p.units()}; }
_ZN8QuantLibmlERKNS_6PeriodEi:
  160|   638k|    inline Period operator*(const Period& p, Integer n) { return {n * p.length(), p.units()}; }
_ZN8QuantLibeqERKNS_6PeriodES2_:
  162|  29.3M|    inline bool operator==(const Period& p1, const Period& p2) {
  163|  29.3M|        return !(p1 < p2 || p2 < p1);
  ------------------
  |  Branch (163:18): [True: 558k, False: 28.8M]
  |  Branch (163:29): [True: 0, False: 28.8M]
  ------------------
  164|  29.3M|    }
_ZN8QuantLibneERKNS_6PeriodES2_:
  166|  28.7M|    inline bool operator!=(const Period& p1, const Period& p2) {
  167|  28.7M|        return !(p1 == p2);
  168|  28.7M|    }
_ZN8QuantLibgeERKNS_6PeriodES2_:
  178|  79.8k|    inline bool operator>=(const Period& p1, const Period& p2) {
  179|  79.8k|        return !(p1 < p2);
  180|  79.8k|    }
_ZN8QuantLibmlIiEENS_6PeriodET_NS_8TimeUnitE:
  147|  28.8M|    inline Period operator*(T n, TimeUnit units) {
  148|  28.8M|        return {Integer(n), units};
  149|  28.8M|    }

_ZN8QuantLib8ScheduleC2ENS_4DateERKS1_RKNS_6PeriodENS_8CalendarENS_21BusinessDayConventionES8_NS_14DateGeneration4RuleEbS3_S3_:
   91|  79.8k|    : tenor_(tenor), calendar_(std::move(cal)), convention_(convention),
   92|  79.8k|      terminationDateConvention_(terminationDateConvention), rule_(rule),
   93|  79.8k|      endOfMonth_(allowsEndOfMonth(tenor) ? endOfMonth : false),
  ------------------
  |  Branch (93:19): [True: 79.8k, False: 0]
  ------------------
   94|  79.8k|      firstDate_(first == effectiveDate ? Date() : first),
  ------------------
  |  Branch (94:18): [True: 0, False: 79.8k]
  ------------------
   95|  79.8k|      nextToLastDate_(nextToLast == terminationDate ? Date() : nextToLast) {
  ------------------
  |  Branch (95:23): [True: 0, False: 79.8k]
  ------------------
   96|       |        // sanity checks
   97|  79.8k|        QL_REQUIRE(terminationDate != Date(), "null termination date");
  ------------------
  |  |  117|  79.8k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  79.8k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  79.8k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
   98|       |
   99|       |        // in many cases (e.g. non-expired bonds) the effective date is not
  100|       |        // really necessary. In these cases a decent placeholder is enough
  101|  79.8k|        if (effectiveDate==Date() && first==Date()
  ------------------
  |  Branch (101:13): [True: 0, False: 79.8k]
  |  Branch (101:13): [True: 0, False: 79.8k]
  |  Branch (101:38): [True: 0, False: 0]
  ------------------
  102|  79.8k|                                  && rule==DateGeneration::Backward) {
  ------------------
  |  Branch (102:38): [True: 0, False: 0]
  ------------------
  103|      0|            Date evalDate = Settings::instance().evaluationDate();
  104|      0|            QL_REQUIRE(evalDate < terminationDate, "null effective date");
  ------------------
  |  |  117|      0|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|      0|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|      0|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|      0|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|      0|} \
  |  |  ------------------
  |  |  |  |   85|      0|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|      0|QL_MULTILINE_ASSERTION_END
  ------------------
  105|      0|            Natural y;
  106|      0|            if (nextToLast != Date()) {
  ------------------
  |  Branch (106:17): [True: 0, False: 0]
  ------------------
  107|      0|                y = (nextToLast - evalDate)/366 + 1;
  108|      0|                effectiveDate = nextToLast - y*Years;
  109|      0|            } else {
  110|      0|                y = (terminationDate - evalDate)/366 + 1;
  111|      0|                effectiveDate = terminationDate - y*Years;
  112|      0|            }
  113|      0|        } else
  114|  79.8k|            QL_REQUIRE(effectiveDate != Date(), "null effective date");
  ------------------
  |  |  117|  79.8k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|   159k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|   159k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
  115|       |
  116|  79.8k|        QL_REQUIRE(effectiveDate < terminationDate,
  ------------------
  |  |  117|  79.8k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|   159k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|   159k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
  117|  79.8k|                   "effective date (" << effectiveDate
  118|  79.8k|                   << ") later than or equal to termination date ("
  119|  79.8k|                   << terminationDate << ")");
  120|       |
  121|  79.8k|        if (tenor.length()==0)
  ------------------
  |  Branch (121:13): [True: 0, False: 79.8k]
  ------------------
  122|      0|            rule_ = DateGeneration::Zero;
  123|  79.8k|        else
  124|  79.8k|            QL_REQUIRE(tenor.length()>0,
  ------------------
  |  |  117|  79.8k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|   159k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|   159k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
  125|  79.8k|                       "non positive tenor (" << tenor << ") not allowed");
  126|       |
  127|  79.8k|        if (firstDate_ != Date()) {
  ------------------
  |  Branch (127:13): [True: 0, False: 79.8k]
  ------------------
  128|      0|            switch (*rule_) {
  129|      0|              case DateGeneration::Backward:
  ------------------
  |  Branch (129:15): [True: 0, False: 0]
  ------------------
  130|      0|              case DateGeneration::Forward:
  ------------------
  |  Branch (130:15): [True: 0, False: 0]
  ------------------
  131|      0|                QL_REQUIRE(firstDate_ > effectiveDate &&
  ------------------
  |  |  117|      0|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|      0|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|      0|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|      0|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:7): [True: 0, False: 0]
  |  |  |  Branch (119:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|      0|} \
  |  |  ------------------
  |  |  |  |   85|      0|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|      0|QL_MULTILINE_ASSERTION_END
  ------------------
  132|      0|                           firstDate_ <= terminationDate,
  133|      0|                           "first date (" << firstDate_ <<
  134|      0|                           ") out of effective-termination date range (" <<
  135|      0|                           effectiveDate << ", " << terminationDate << "]");
  136|       |                // we should ensure that the above condition is still
  137|       |                // verified after adjustment
  138|      0|                break;
  139|      0|              case DateGeneration::ThirdWednesday:
  ------------------
  |  Branch (139:15): [True: 0, False: 0]
  ------------------
  140|      0|                  QL_REQUIRE(IMM::isIMMdate(firstDate_, false),
  ------------------
  |  |  117|      0|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|      0|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|      0|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|      0|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|      0|} \
  |  |  ------------------
  |  |  |  |   85|      0|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|      0|QL_MULTILINE_ASSERTION_END
  ------------------
  141|      0|                             "first date (" << firstDate_ <<
  142|      0|                             ") is not an IMM date");
  143|      0|                break;
  144|      0|              case DateGeneration::Zero:
  ------------------
  |  Branch (144:15): [True: 0, False: 0]
  ------------------
  145|      0|              case DateGeneration::Twentieth:
  ------------------
  |  Branch (145:15): [True: 0, False: 0]
  ------------------
  146|      0|              case DateGeneration::TwentiethIMM:
  ------------------
  |  Branch (146:15): [True: 0, False: 0]
  ------------------
  147|      0|              case DateGeneration::OldCDS:
  ------------------
  |  Branch (147:15): [True: 0, False: 0]
  ------------------
  148|      0|              case DateGeneration::CDS:
  ------------------
  |  Branch (148:15): [True: 0, False: 0]
  ------------------
  149|      0|              case DateGeneration::CDS2015:
  ------------------
  |  Branch (149:15): [True: 0, False: 0]
  ------------------
  150|      0|                QL_FAIL("first date incompatible with " << *rule_ <<
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
  151|      0|                        " date generation rule");
  152|      0|              default:
  ------------------
  |  Branch (152:15): [True: 0, False: 0]
  ------------------
  153|      0|                QL_FAIL("unknown rule (" << Integer(*rule_) << ")");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
  154|      0|            }
  155|      0|        }
  156|  79.8k|        if (nextToLastDate_ != Date()) {
  ------------------
  |  Branch (156:13): [True: 0, False: 79.8k]
  ------------------
  157|      0|            switch (*rule_) {
  158|      0|              case DateGeneration::Backward:
  ------------------
  |  Branch (158:15): [True: 0, False: 0]
  ------------------
  159|      0|              case DateGeneration::Forward:
  ------------------
  |  Branch (159:15): [True: 0, False: 0]
  ------------------
  160|      0|                QL_REQUIRE(nextToLastDate_ >= effectiveDate &&
  ------------------
  |  |  117|      0|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|      0|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|      0|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|      0|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:7): [True: 0, False: 0]
  |  |  |  Branch (119:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|      0|} \
  |  |  ------------------
  |  |  |  |   85|      0|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|      0|QL_MULTILINE_ASSERTION_END
  ------------------
  161|      0|                           nextToLastDate_ < terminationDate,
  162|      0|                           "next to last date (" << nextToLastDate_ <<
  163|      0|                           ") out of effective-termination date range [" <<
  164|      0|                           effectiveDate << ", " << terminationDate << ")");
  165|       |                // we should ensure that the above condition is still
  166|       |                // verified after adjustment
  167|      0|                break;
  168|      0|              case DateGeneration::ThirdWednesday:
  ------------------
  |  Branch (168:15): [True: 0, False: 0]
  ------------------
  169|      0|                QL_REQUIRE(IMM::isIMMdate(nextToLastDate_, false),
  ------------------
  |  |  117|      0|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|      0|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|      0|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|      0|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|      0|} \
  |  |  ------------------
  |  |  |  |   85|      0|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|      0|QL_MULTILINE_ASSERTION_END
  ------------------
  170|      0|                           "next-to-last date (" << nextToLastDate_ <<
  171|      0|                           ") is not an IMM date");
  172|      0|                break;
  173|      0|              case DateGeneration::Zero:
  ------------------
  |  Branch (173:15): [True: 0, False: 0]
  ------------------
  174|      0|              case DateGeneration::Twentieth:
  ------------------
  |  Branch (174:15): [True: 0, False: 0]
  ------------------
  175|      0|              case DateGeneration::TwentiethIMM:
  ------------------
  |  Branch (175:15): [True: 0, False: 0]
  ------------------
  176|      0|              case DateGeneration::OldCDS:
  ------------------
  |  Branch (176:15): [True: 0, False: 0]
  ------------------
  177|      0|              case DateGeneration::CDS:
  ------------------
  |  Branch (177:15): [True: 0, False: 0]
  ------------------
  178|      0|              case DateGeneration::CDS2015:
  ------------------
  |  Branch (178:15): [True: 0, False: 0]
  ------------------
  179|      0|                QL_FAIL("next to last date incompatible with " << *rule_ <<
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
  180|      0|                        " date generation rule");
  181|      0|              default:
  ------------------
  |  Branch (181:15): [True: 0, False: 0]
  ------------------
  182|      0|                QL_FAIL("unknown rule (" << Integer(*rule_) << ")");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
  183|      0|            }
  184|      0|        }
  185|       |
  186|       |
  187|       |        // calendar needed for endOfMonth adjustment
  188|  79.8k|        Calendar nullCalendar = NullCalendar();
  189|  79.8k|        Integer periods = 1;
  190|  79.8k|        Date seed, exitDate;
  191|  79.8k|        switch (*rule_) {
  192|       |
  193|      0|          case DateGeneration::Zero:
  ------------------
  |  Branch (193:11): [True: 0, False: 79.8k]
  ------------------
  194|      0|            tenor_ = 0*Years;
  195|      0|            dates_.push_back(effectiveDate);
  196|      0|            dates_.push_back(terminationDate);
  197|      0|            isRegular_.push_back(true);
  198|      0|            break;
  199|       |
  200|  79.8k|          case DateGeneration::Backward:
  ------------------
  |  Branch (200:11): [True: 79.8k, False: 0]
  ------------------
  201|       |
  202|  79.8k|            dates_.push_back(terminationDate);
  203|       |
  204|  79.8k|            seed = terminationDate;
  205|  79.8k|            if (nextToLastDate_ != Date()) {
  ------------------
  |  Branch (205:17): [True: 0, False: 79.8k]
  ------------------
  206|      0|                dates_.push_back(nextToLastDate_);
  207|      0|                Date temp = nullCalendar.advance(seed,
  208|      0|                    -periods*(*tenor_), convention, *endOfMonth_);
  209|      0|                isRegular_.push_back(temp == nextToLastDate_);
  210|      0|                seed = nextToLastDate_;
  211|      0|            }
  212|       |
  213|  79.8k|            exitDate = effectiveDate;
  214|  79.8k|            if (firstDate_ != Date())
  ------------------
  |  Branch (214:17): [True: 0, False: 79.8k]
  ------------------
  215|      0|                exitDate = firstDate_;
  216|       |
  217|  28.8M|            for (;;) {
  218|  28.8M|                Date temp = nullCalendar.advance(seed,
  219|  28.8M|                    -periods*(*tenor_), convention, *endOfMonth_);
  220|  28.8M|                if (temp < exitDate) {
  ------------------
  |  Branch (220:21): [True: 79.8k, False: 28.7M]
  ------------------
  221|  79.8k|                    if (firstDate_ != Date() &&
  ------------------
  |  Branch (221:25): [True: 0, False: 79.8k]
  |  Branch (221:25): [True: 0, False: 79.8k]
  ------------------
  222|  79.8k|                        (calendar_.adjust(dates_.back(),convention)!=
  ------------------
  |  Branch (222:25): [True: 0, False: 0]
  ------------------
  223|      0|                         calendar_.adjust(firstDate_,convention))) {
  224|      0|                        dates_.push_back(firstDate_);
  225|      0|                        isRegular_.push_back(false);
  226|      0|                    }
  227|  79.8k|                    break;
  228|  28.7M|                } else {
  229|       |                    // skip dates that would result in duplicates
  230|       |                    // after adjustment
  231|  28.7M|                    if (calendar_.adjust(dates_.back(),convention)!=
  ------------------
  |  Branch (231:25): [True: 28.7M, False: 0]
  ------------------
  232|  28.7M|                        calendar_.adjust(temp,convention)) {
  233|  28.7M|                        dates_.push_back(temp);
  234|  28.7M|                        isRegular_.push_back(true);
  235|  28.7M|                    }
  236|  28.7M|                    ++periods;
  237|  28.7M|                }
  238|  28.8M|            }
  239|       |
  240|  79.8k|            if (calendar_.adjust(dates_.back(),convention)!=
  ------------------
  |  Branch (240:17): [True: 0, False: 79.8k]
  ------------------
  241|  79.8k|                calendar_.adjust(effectiveDate,convention)) {
  242|      0|                dates_.push_back(effectiveDate);
  243|      0|                isRegular_.push_back(false);
  244|      0|            }
  245|  79.8k|	    std::reverse(dates_.begin(), dates_.end());
  246|  79.8k|	    std::reverse(isRegular_.begin(), isRegular_.end());
  247|  79.8k|            break;
  248|       |
  249|      0|          case DateGeneration::Twentieth:
  ------------------
  |  Branch (249:11): [True: 0, False: 79.8k]
  ------------------
  250|      0|          case DateGeneration::TwentiethIMM:
  ------------------
  |  Branch (250:11): [True: 0, False: 79.8k]
  ------------------
  251|      0|          case DateGeneration::ThirdWednesday:
  ------------------
  |  Branch (251:11): [True: 0, False: 79.8k]
  ------------------
  252|      0|          case DateGeneration::ThirdWednesdayInclusive:
  ------------------
  |  Branch (252:11): [True: 0, False: 79.8k]
  ------------------
  253|      0|          case DateGeneration::OldCDS:
  ------------------
  |  Branch (253:11): [True: 0, False: 79.8k]
  ------------------
  254|      0|          case DateGeneration::CDS:
  ------------------
  |  Branch (254:11): [True: 0, False: 79.8k]
  ------------------
  255|      0|          case DateGeneration::CDS2015:
  ------------------
  |  Branch (255:11): [True: 0, False: 79.8k]
  ------------------
  256|      0|            QL_REQUIRE(!*endOfMonth_,
  ------------------
  |  |  117|      0|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|      0|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|      0|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|      0|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|      0|} \
  |  |  ------------------
  |  |  |  |   85|      0|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|      0|QL_MULTILINE_ASSERTION_END
  ------------------
  257|      0|                       "endOfMonth convention incompatible with " << *rule_ <<
  258|      0|                       " date generation rule");
  259|      0|            [[fallthrough]];
  260|      0|          case DateGeneration::Forward:
  ------------------
  |  Branch (260:11): [True: 0, False: 79.8k]
  ------------------
  261|       |
  262|      0|            if (*rule_ == DateGeneration::CDS || *rule_ == DateGeneration::CDS2015) {
  ------------------
  |  Branch (262:17): [True: 0, False: 0]
  |  Branch (262:50): [True: 0, False: 0]
  ------------------
  263|      0|                Date prev20th = previousTwentieth(effectiveDate, *rule_);
  264|      0|                if (calendar_.adjust(prev20th, convention) > effectiveDate) {
  ------------------
  |  Branch (264:21): [True: 0, False: 0]
  ------------------
  265|      0|                    dates_.push_back(prev20th - 3 * Months);
  266|      0|                    isRegular_.push_back(true);
  267|      0|                }
  268|      0|                dates_.push_back(prev20th);
  269|      0|            } else {
  270|      0|                dates_.push_back(effectiveDate);
  271|      0|            }
  272|       |
  273|      0|            seed = dates_.back();
  274|       |
  275|      0|            if (firstDate_!=Date()) {
  ------------------
  |  Branch (275:17): [True: 0, False: 0]
  ------------------
  276|      0|                dates_.push_back(firstDate_);
  277|      0|                Date temp = nullCalendar.advance(seed, periods*(*tenor_),
  278|      0|                                                 convention, *endOfMonth_);
  279|      0|                if (temp!=firstDate_)
  ------------------
  |  Branch (279:21): [True: 0, False: 0]
  ------------------
  280|      0|                    isRegular_.push_back(false);
  281|      0|                else
  282|      0|                    isRegular_.push_back(true);
  283|      0|                seed = firstDate_;
  284|      0|            } else if (*rule_ == DateGeneration::Twentieth ||
  ------------------
  |  Branch (284:24): [True: 0, False: 0]
  ------------------
  285|      0|                       *rule_ == DateGeneration::TwentiethIMM ||
  ------------------
  |  Branch (285:24): [True: 0, False: 0]
  ------------------
  286|      0|                       *rule_ == DateGeneration::OldCDS ||
  ------------------
  |  Branch (286:24): [True: 0, False: 0]
  ------------------
  287|      0|                       *rule_ == DateGeneration::CDS ||
  ------------------
  |  Branch (287:24): [True: 0, False: 0]
  ------------------
  288|      0|                       *rule_ == DateGeneration::CDS2015) {
  ------------------
  |  Branch (288:24): [True: 0, False: 0]
  ------------------
  289|      0|                Date next20th = nextTwentieth(effectiveDate, *rule_);
  290|      0|                if (*rule_ == DateGeneration::OldCDS) {
  ------------------
  |  Branch (290:21): [True: 0, False: 0]
  ------------------
  291|       |                    // distance rule inforced in natural days
  292|      0|                    static const Date::serial_type stubDays = 30;
  293|      0|                    if (next20th - effectiveDate < stubDays) {
  ------------------
  |  Branch (293:25): [True: 0, False: 0]
  ------------------
  294|       |                        // +1 will skip this one and get the next
  295|      0|                        next20th = nextTwentieth(next20th + 1, *rule_);
  296|      0|                    }
  297|      0|                }
  298|      0|                if (next20th != effectiveDate) {
  ------------------
  |  Branch (298:21): [True: 0, False: 0]
  ------------------
  299|      0|                    dates_.push_back(next20th);
  300|      0|                    isRegular_.push_back(*rule_ == DateGeneration::CDS || *rule_ == DateGeneration::CDS2015);
  ------------------
  |  Branch (300:42): [True: 0, False: 0]
  |  Branch (300:75): [True: 0, False: 0]
  ------------------
  301|      0|                    seed = next20th;
  302|      0|                }
  303|      0|            }
  304|       |
  305|      0|            exitDate = terminationDate;
  306|      0|            if (nextToLastDate_ != Date())
  ------------------
  |  Branch (306:17): [True: 0, False: 0]
  ------------------
  307|      0|                exitDate = nextToLastDate_;
  308|      0|            for (;;) {
  309|      0|                Date temp = nullCalendar.advance(seed, periods*(*tenor_),
  310|      0|                                                 convention, *endOfMonth_);
  311|      0|                if (temp > exitDate) {
  ------------------
  |  Branch (311:21): [True: 0, False: 0]
  ------------------
  312|      0|                    if (nextToLastDate_ != Date() &&
  ------------------
  |  Branch (312:25): [True: 0, False: 0]
  |  Branch (312:25): [True: 0, False: 0]
  ------------------
  313|      0|                        (calendar_.adjust(dates_.back(),convention)!=
  ------------------
  |  Branch (313:25): [True: 0, False: 0]
  ------------------
  314|      0|                         calendar_.adjust(nextToLastDate_,convention))) {
  315|      0|                        dates_.push_back(nextToLastDate_);
  316|      0|                        isRegular_.push_back(false);
  317|      0|                    }
  318|      0|                    break;
  319|      0|                } else {
  320|       |                    // skip dates that would result in duplicates
  321|       |                    // after adjustment
  322|      0|                    if (calendar_.adjust(dates_.back(),convention)!=
  ------------------
  |  Branch (322:25): [True: 0, False: 0]
  ------------------
  323|      0|                        calendar_.adjust(temp,convention)) {
  324|      0|                        dates_.push_back(temp);
  325|      0|                        isRegular_.push_back(true);
  326|      0|                    }
  327|      0|                    ++periods;
  328|      0|                }
  329|      0|            }
  330|       |
  331|      0|            if (calendar_.adjust(dates_.back(),terminationDateConvention)!=
  ------------------
  |  Branch (331:17): [True: 0, False: 0]
  ------------------
  332|      0|                calendar_.adjust(terminationDate,terminationDateConvention)) {
  333|      0|                if (*rule_ == DateGeneration::Twentieth ||
  ------------------
  |  Branch (333:21): [True: 0, False: 0]
  ------------------
  334|      0|                    *rule_ == DateGeneration::TwentiethIMM ||
  ------------------
  |  Branch (334:21): [True: 0, False: 0]
  ------------------
  335|      0|                    *rule_ == DateGeneration::OldCDS ||
  ------------------
  |  Branch (335:21): [True: 0, False: 0]
  ------------------
  336|      0|                    *rule_ == DateGeneration::CDS ||
  ------------------
  |  Branch (336:21): [True: 0, False: 0]
  ------------------
  337|      0|                    *rule_ == DateGeneration::CDS2015) {
  ------------------
  |  Branch (337:21): [True: 0, False: 0]
  ------------------
  338|      0|                    dates_.push_back(nextTwentieth(terminationDate, *rule_));
  339|      0|                    isRegular_.push_back(true);
  340|      0|                } else {
  341|      0|                    dates_.push_back(terminationDate);
  342|      0|                    isRegular_.push_back(false);
  343|      0|                }
  344|      0|            }
  345|       |
  346|      0|            break;
  347|       |
  348|      0|          default:
  ------------------
  |  Branch (348:11): [True: 0, False: 79.8k]
  ------------------
  349|      0|            QL_FAIL("unknown rule (" << Integer(*rule_) << ")");
  ------------------
  |  |   92|      0|#define QL_FAIL(message) \
  |  |  ------------------
  |  |  |  |   57|      0|#define QL_MULTILINE_FAILURE_BEGIN do {
  |  |  ------------------
  |  |   93|      0|QL_MULTILINE_FAILURE_BEGIN \
  |  |   94|      0|    std::ostringstream _ql_msg_stream; \
  |  |   95|      0|    _ql_msg_stream << message; \
  |  |   96|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |   97|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  ------------------
  |  |  |  |   69|      0|    #define QL_MULTILINE_FAILURE_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (69:46): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|      0|QL_MULTILINE_FAILURE_END
  ------------------
  350|  79.8k|        }
  351|       |
  352|       |        // adjustments
  353|  79.8k|        if (*rule_==DateGeneration::ThirdWednesday)
  ------------------
  |  Branch (353:13): [True: 0, False: 79.8k]
  ------------------
  354|      0|            for (Size i=1; i<dates_.size()-1; ++i)
  ------------------
  |  Branch (354:28): [True: 0, False: 0]
  ------------------
  355|      0|                dates_[i] = Date::nthWeekday(3, Wednesday,
  356|      0|                                             dates_[i].month(),
  357|      0|                                             dates_[i].year());
  358|  79.8k|        else if (*rule_ == DateGeneration::ThirdWednesdayInclusive)
  ------------------
  |  Branch (358:18): [True: 0, False: 79.8k]
  ------------------
  359|      0|            for (auto& date : dates_)
  ------------------
  |  Branch (359:29): [True: 0, False: 0]
  ------------------
  360|      0|                date = Date::nthWeekday(3, Wednesday, date.month(), date.year());
  361|       |
  362|       |        // first date not adjusted for old CDS schedules
  363|  79.8k|        if (convention != Unadjusted && *rule_ != DateGeneration::OldCDS)
  ------------------
  |  Branch (363:13): [True: 0, False: 79.8k]
  |  Branch (363:41): [True: 0, False: 0]
  ------------------
  364|      0|            dates_.front() = calendar_.adjust(dates_.front(), convention);
  365|       |
  366|       |        // termination date is NOT adjusted as per ISDA
  367|       |        // specifications, unless otherwise specified in the
  368|       |        // confirmation of the deal or unless we're creating a CDS
  369|       |        // schedule
  370|  79.8k|        if (terminationDateConvention != Unadjusted 
  ------------------
  |  Branch (370:13): [True: 0, False: 79.8k]
  ------------------
  371|  79.8k|            && *rule_ != DateGeneration::CDS 
  ------------------
  |  Branch (371:16): [True: 0, False: 0]
  ------------------
  372|  79.8k|            && *rule_ != DateGeneration::CDS2015) {
  ------------------
  |  Branch (372:16): [True: 0, False: 0]
  ------------------
  373|      0|            dates_.back() = calendar_.adjust(dates_.back(), 
  374|      0|                                             terminationDateConvention);
  375|      0|        }
  376|       |
  377|  79.8k|        if (*endOfMonth_ && calendar_.isEndOfMonth(seed)) {
  ------------------
  |  Branch (377:13): [True: 0, False: 79.8k]
  |  Branch (377:29): [True: 0, False: 0]
  ------------------
  378|       |            // adjust to end of month
  379|      0|            for (Size i=1; i<dates_.size()-1; ++i)
  ------------------
  |  Branch (379:28): [True: 0, False: 0]
  ------------------
  380|      0|                dates_[i] = calendar_.adjust(Date::endOfMonth(dates_[i]), convention);
  381|  79.8k|        } else {
  382|  28.7M|            for (Size i=1; i<dates_.size()-1; ++i)
  ------------------
  |  Branch (382:28): [True: 28.6M, False: 79.8k]
  ------------------
  383|  28.6M|                dates_[i] = calendar_.adjust(dates_[i], convention);
  384|  79.8k|        }
  385|       |
  386|       |        // Final safety checks to remove extra next-to-last date, if
  387|       |        // necessary.  It can happen to be equal or later than the end
  388|       |        // date due to EOM adjustments (see the Schedule test suite
  389|       |        // for an example).
  390|  79.8k|        if (dates_.size() >= 2 && dates_[dates_.size()-2] >= dates_.back()) {
  ------------------
  |  Branch (390:13): [True: 79.8k, False: 0]
  |  Branch (390:35): [True: 0, False: 79.8k]
  ------------------
  391|       |            // there might be two dates only, then isRegular_ has size one
  392|      0|            if (isRegular_.size() >= 2) {
  ------------------
  |  Branch (392:17): [True: 0, False: 0]
  ------------------
  393|      0|                isRegular_[isRegular_.size() - 2] =
  394|      0|                    (dates_[dates_.size() - 2] == dates_.back());
  395|      0|            }
  396|      0|            dates_[dates_.size() - 2] = dates_.back();
  397|      0|            dates_.pop_back();
  398|      0|            isRegular_.pop_back();
  399|      0|        }
  400|  79.8k|        if (dates_.size() >= 2 && dates_[1] <= dates_.front()) {
  ------------------
  |  Branch (400:13): [True: 79.8k, False: 0]
  |  Branch (400:35): [True: 0, False: 79.8k]
  ------------------
  401|      0|            isRegular_[1] =
  402|      0|                (dates_[1] == dates_.front());
  403|      0|            dates_[1] = dates_.front();
  404|      0|            dates_.erase(dates_.begin());
  405|      0|            isRegular_.erase(isRegular_.begin());
  406|      0|        }
  407|       |
  408|  79.8k|        QL_ENSURE(dates_.size()>1,
  ------------------
  |  |  130|  79.8k|#define QL_ENSURE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  131|  79.8k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  132|  79.8k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (132:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  133|      0|    std::ostringstream _ql_msg_stream; \
  |  |  134|      0|    _ql_msg_stream << message; \
  |  |  135|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  136|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  137|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
  409|  79.8k|            "degenerate single date (" << dates_[0] << ") schedule" <<
  410|  79.8k|            "\n seed date: " << seed <<
  411|  79.8k|            "\n exit date: " << exitDate <<
  412|  79.8k|            "\n effective date: " << effectiveDate <<
  413|  79.8k|            "\n first date: " << first <<
  414|  79.8k|            "\n next to last date: " << nextToLast <<
  415|  79.8k|            "\n termination date: " << terminationDate <<
  416|  79.8k|            "\n generation rule: " << *rule_ <<
  417|  79.8k|            "\n end of month: " << *endOfMonth_);
  418|  79.8k|    }
_ZNK8QuantLib8Schedule12hasIsRegularEv:
  511|   319k|    bool Schedule::hasIsRegular() const { return !isRegular_.empty(); }
_ZNK8QuantLib8Schedule9isRegularEm:
  513|   159k|    bool Schedule::isRegular(Size i) const {
  514|   159k|        QL_REQUIRE(hasIsRegular(),
  ------------------
  |  |  117|   159k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|   159k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|   159k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|   159k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 159k]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|   159k|} \
  |  |  ------------------
  |  |  |  |   85|   159k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|   159k|QL_MULTILINE_ASSERTION_END
  ------------------
  515|   159k|                   "full interface (isRegular) not available");
  516|   159k|        QL_REQUIRE(i<=isRegular_.size() && i>0,
  ------------------
  |  |  117|   159k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|   159k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|   319k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|   319k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:7): [True: 159k, False: 0]
  |  |  |  Branch (119:7): [True: 159k, False: 0]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|   159k|} \
  |  |  ------------------
  |  |  |  |   85|   159k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|   159k|QL_MULTILINE_ASSERTION_END
  ------------------
  517|   159k|                   "index (" << i << ") must be in [1, " <<
  518|   159k|                   isRegular_.size() <<"]");
  519|   159k|        return isRegular_[i-1];
  520|   159k|    }
schedule.cpp:_ZN8QuantLib12_GLOBAL__N_116allowsEndOfMonthERKNS_6PeriodE:
   50|  79.8k|        bool allowsEndOfMonth(const Period& tenor) {
   51|  79.8k|            return (tenor.units() == Months || tenor.units() == Years)
  ------------------
  |  Branch (51:21): [True: 79.8k, False: 0]
  |  Branch (51:48): [True: 0, False: 0]
  ------------------
   52|  79.8k|                && tenor >= 1*Months;
  ------------------
  |  Branch (52:20): [True: 79.8k, False: 0]
  ------------------
   53|  79.8k|        }

_ZN8QuantLib8ScheduleC2Ev:
   66|  79.8k|        Schedule() = default;
_ZNK8QuantLib8Schedule4sizeEv:
   69|  28.8M|        Size size() const { return dates_.size(); }
_ZNK8QuantLib8Schedule4dateEm:
  162|  28.8M|    inline const Date& Schedule::date(Size i) const {
  163|  28.8M|        return dates_.at(i);
  164|  28.8M|    }
_ZNK8QuantLib8Schedule8calendarEv:
  188|   159k|    inline const Calendar& Schedule::calendar() const {
  189|   159k|        return calendar_;
  190|   159k|    }
_ZNK8QuantLib8Schedule8hasTenorEv:
  198|   159k|    inline bool Schedule::hasTenor() const {
  199|   159k|        return static_cast<bool>(tenor_);
  200|   159k|    }
_ZNK8QuantLib8Schedule5tenorEv:
  202|  79.8k|    inline const Period& Schedule::tenor() const {
  203|  79.8k|        QL_REQUIRE(hasTenor(),
  ------------------
  |  |  117|  79.8k|#define QL_REQUIRE(condition,message) \
  |  |  ------------------
  |  |  |  |   73|  79.8k|#define QL_MULTILINE_ASSERTION_BEGIN do {
  |  |  ------------------
  |  |  118|  79.8k|QL_MULTILINE_ASSERTION_BEGIN \
  |  |  119|  79.8k|if (!(condition)) { \
  |  |  ------------------
  |  |  |  Branch (119:5): [True: 0, False: 79.8k]
  |  |  ------------------
  |  |  120|      0|    std::ostringstream _ql_msg_stream; \
  |  |  121|      0|    _ql_msg_stream << message; \
  |  |  122|      0|    throw QuantLib::Error(__FILE__,__LINE__, \
  |  |  123|      0|                          BOOST_CURRENT_FUNCTION,_ql_msg_stream.str()); \
  |  |  124|  79.8k|} \
  |  |  ------------------
  |  |  |  |   85|  79.8k|    #define QL_MULTILINE_ASSERTION_END } while(false)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:48): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  125|  79.8k|QL_MULTILINE_ASSERTION_END
  ------------------
  204|  79.8k|                   "full interface (tenor) not available");
  205|  79.8k|        return *tenor_;  // NOLINT(bugprone-unchecked-optional-access)
  206|  79.8k|    }
_ZNK8QuantLib8Schedule5emptyEv:
   74|  79.8k|        bool empty() const { return dates_.empty(); }
_ZNK8QuantLib8Schedule7endDateEv:
  196|  79.8k|    inline const Date &Schedule::endDate() const { return dates_.back(); }

_ZNK8QuantLib4NullIdEcvdEv:
   62|  86.4M|        constexpr operator T() const {
   63|  86.4M|            if constexpr (std::is_floating_point_v<T>) {
   64|       |                // a specific, unlikely value that should fit into any Real
   65|  86.4M|                return (std::numeric_limits<float>::max)();
   66|       |            } else if constexpr (std::is_integral_v<T>) {
   67|       |                // this should fit into any Integer
   68|       |                return (std::numeric_limits<int>::max)();
   69|       |            } else {
   70|       |                return T();
   71|       |            }
   72|  86.4M|        }

_ZNK8QuantLib15ObservableValueINS_4DateEE5valueEv:
  117|  1.03k|    const T& ObservableValue<T>::value() const {
  118|  1.03k|        return value_;
  119|  1.03k|    }
_ZN8QuantLib15ObservableValueINS_4DateEED2Ev:
   48|      1|        ~ObservableValue() = default;
_ZNK8QuantLib15ObservableValueINS_4DateEEcvN5boost10shared_ptrINS_10ObservableEEEEv:
  112|   159k|    ObservableValue<T>::operator ext::shared_ptr<Observable>() const {
  113|   159k|        return observable_;
  114|   159k|    }
_ZN8QuantLib15ObservableValueINS_4DateEEC2EOS1_:
   74|      1|    : value_(std::move(t)), observable_(new Observable) {}

