Coverage Report

Created: 2026-03-31 07:01

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/instruments/multipleresetsswap.hpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2026 Zain Mughal
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
/*! \file multipleresetsswap.hpp
21
    \brief Swap with a multiple-resets floating leg
22
*/
23
24
#ifndef quantlib_multiple_resets_swap_hpp
25
#define quantlib_multiple_resets_swap_hpp
26
27
#include <ql/cashflows/rateaveraging.hpp>
28
#include <ql/instruments/fixedvsfloatingswap.hpp>
29
#include <ql/time/schedule.hpp>
30
31
namespace QuantLib {
32
33
    class IborIndex;
34
35
    //! Swap with a fixed leg and a multiple-resets floating leg
36
    /*! The floating leg contains coupons whose rate is determined by
37
        compounding or averaging \c resetsPerCoupon consecutive Ibor
38
        fixings during each accrual period.
39
    */
40
    class MultipleResetsSwap : public FixedVsFloatingSwap {
41
      public:
42
        MultipleResetsSwap(Type type,
43
                           Real nominal,
44
                           const Schedule& fixedSchedule,
45
                           Rate fixedRate,
46
                           DayCounter fixedDayCount,
47
                           Schedule fullResetSchedule,
48
                           const ext::shared_ptr<IborIndex>& iborIndex,
49
                           Size resetsPerCoupon,
50
                           Spread spread = 0.0,
51
                           RateAveraging::Type averagingMethod = RateAveraging::Compound,
52
                           ext::optional<BusinessDayConvention> paymentConvention = ext::nullopt,
53
                           Integer paymentLag = 0,
54
                           const Calendar& paymentCalendar = Calendar());
55
56
0
        const Schedule& fullResetSchedule() const { return fullResetSchedule_; }
57
0
        Size resetsPerCoupon() const { return resetsPerCoupon_; }
58
0
        RateAveraging::Type averagingMethod() const { return averagingMethod_; }
59
60
      private:
61
        void setupFloatingArguments(arguments* args) const override;
62
63
        Schedule fullResetSchedule_;
64
        Size resetsPerCoupon_;
65
        RateAveraging::Type averagingMethod_;
66
    };
67
68
}
69
70
#endif