Coverage Report

Created: 2026-10-31 06:47

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/instruments/bonds/amortizingfloatingratebond.cpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2008 Simon Ibbotson
5
6
 This file is part of QuantLib, a free-software/open-source library
7
 for financial quantitative analysts and developers - http://quantlib.org/
8
9
 QuantLib is free software: you can redistribute it and/or modify it
10
 under the terms of the QuantLib license.  You should have received a
11
 copy of the license along with this program; if not, please email
12
 <quantlib-dev@lists.sf.net>. The license is also available online at
13
 <https://www.quantlib.org/license.shtml>.
14
15
 This program is distributed in the hope that it will be useful, but WITHOUT
16
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
 FOR A PARTICULAR PURPOSE.  See the license for more details.
18
*/
19
20
#include <ql/instruments/bonds/amortizingfloatingratebond.hpp>
21
#include <ql/cashflows/iborcoupon.hpp>
22
#include <ql/cashflows/simplecashflow.hpp>
23
#include <ql/time/schedule.hpp>
24
#include <ql/indexes/iborindex.hpp>
25
26
namespace QuantLib {
27
28
    AmortizingFloatingRateBond::AmortizingFloatingRateBond(
29
                                    Natural settlementDays,
30
                                    const std::vector<Real>& notionals,
31
                                    Schedule schedule,
32
                                    const ext::shared_ptr<IborIndex>& index,
33
                                    const DayCounter& paymentDayCounter,
34
                                    BusinessDayConvention paymentConvention,
35
                                    Natural fixingDays,
36
                                    const std::vector<Real>& gearings,
37
                                    const std::vector<Spread>& spreads,
38
                                    const std::vector<Rate>& caps,
39
                                    const std::vector<Rate>& floors,
40
                                    bool inArrears,
41
                                    const Date& issueDate,
42
                                    const Period& exCouponPeriod,
43
                                    const Calendar& exCouponCalendar,
44
                                    const BusinessDayConvention exCouponConvention,
45
                                    bool exCouponEndOfMonth,
46
                                    const std::vector<Real>& redemptions,
47
                                    Integer paymentLag)
48
0
    : Bond(settlementDays, schedule.calendar(), issueDate) {
49
50
0
        maturityDate_ = schedule.endDate();
51
52
0
        cashflows_ = IborLeg(std::move(schedule), index)
53
0
            .withNotionals(notionals)
54
0
            .withPaymentDayCounter(paymentDayCounter)
55
0
            .withPaymentAdjustment(paymentConvention)
56
0
            .withFixingDays(fixingDays)
57
0
            .withPaymentLag(paymentLag)
58
0
            .withGearings(gearings)
59
0
            .withSpreads(spreads)
60
0
            .withCaps(caps)
61
0
            .withFloors(floors)
62
0
            .withExCouponPeriod(exCouponPeriod,
63
0
                                exCouponCalendar,
64
0
                                exCouponConvention,
65
0
                                exCouponEndOfMonth)
66
0
            .inArrears(inArrears);
67
68
0
        addRedemptionsToCashflows(redemptions);
69
70
0
        QL_ENSURE(!cashflows().empty(), "bond with no cashflows!");
71
72
0
        registerWith(index);
73
0
    }
Unexecuted instantiation: QuantLib::AmortizingFloatingRateBond::AmortizingFloatingRateBond(unsigned int, std::__1::vector<double, std::__1::allocator<double> > const&, QuantLib::Schedule, boost::shared_ptr<QuantLib::IborIndex> const&, QuantLib::DayCounter const&, QuantLib::BusinessDayConvention, unsigned int, std::__1::vector<double, std::__1::allocator<double> > const&, std::__1::vector<double, std::__1::allocator<double> > const&, std::__1::vector<double, std::__1::allocator<double> > const&, std::__1::vector<double, std::__1::allocator<double> > const&, bool, QuantLib::Date const&, QuantLib::Period const&, QuantLib::Calendar const&, QuantLib::BusinessDayConvention, bool, std::__1::vector<double, std::__1::allocator<double> > const&, int)
Unexecuted instantiation: QuantLib::AmortizingFloatingRateBond::AmortizingFloatingRateBond(unsigned int, std::__1::vector<double, std::__1::allocator<double> > const&, QuantLib::Schedule, boost::shared_ptr<QuantLib::IborIndex> const&, QuantLib::DayCounter const&, QuantLib::BusinessDayConvention, unsigned int, std::__1::vector<double, std::__1::allocator<double> > const&, std::__1::vector<double, std::__1::allocator<double> > const&, std::__1::vector<double, std::__1::allocator<double> > const&, std::__1::vector<double, std::__1::allocator<double> > const&, bool, QuantLib::Date const&, QuantLib::Period const&, QuantLib::Calendar const&, QuantLib::BusinessDayConvention, bool, std::__1::vector<double, std::__1::allocator<double> > const&, int)
74
75
}