QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
discretizedswap.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2001, 2002, 2003 Sadruddin Rejeb
5 Copyright (C) 2004, 2007 StatPro Italia srl
6 Copyright (C) 2022 Ralf Konrad Eckel
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
22/*! \file discretizedswap.hpp
23 \brief Discretized swap class
24*/
25
26#ifndef quantlib_discretized_swap_hpp
27#define quantlib_discretized_swap_hpp
28
31
32namespace QuantLib {
33
35 public:
37 const Date& referenceDate,
38 const DayCounter& dayCounter);
39
41 const Date& referenceDate,
42 const DayCounter& dayCounter,
43 std::vector<CouponAdjustment> fixedCouponAdjustments,
44 std::vector<CouponAdjustment> floatingCouponAdjustments);
45 void reset(Size size) override;
46 std::vector<Time> mandatoryTimes() const override;
47
48 protected:
49 void preAdjustValuesImpl() override;
50 void postAdjustValuesImpl() override;
51
52 private:
54 std::vector<Time> fixedResetTimes_;
55 std::vector<Time> fixedPayTimes_;
56 std::vector<CouponAdjustment> fixedCouponAdjustments_;
57 std::vector<bool> fixedResetTimeIsInPast_;
58 std::vector<Time> floatingResetTimes_;
59 std::vector<Time> floatingPayTimes_;
60 std::vector<CouponAdjustment> floatingCouponAdjustments_;
61 std::vector<bool> floatingResetTimeIsInPast_;
62
63 void addFixedCoupon(Size i);
64 void addFloatingCoupon(Size i);
65 };
66
67}
68
69
70#endif
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Discretized asset class used by numerical methods.
std::vector< Time > floatingPayTimes_
std::vector< bool > floatingResetTimeIsInPast_
void preAdjustValuesImpl() override
std::vector< CouponAdjustment > floatingCouponAdjustments_
std::vector< Time > fixedResetTimes_
std::vector< CouponAdjustment > fixedCouponAdjustments_
std::vector< bool > fixedResetTimeIsInPast_
std::vector< Time > floatingResetTimes_
VanillaSwap::arguments arguments_
void postAdjustValuesImpl() override
std::vector< Time > mandatoryTimes() const override
std::vector< Time > fixedPayTimes_
void reset(Size size) override
Arguments for simple swap calculation
Discretized asset classes.
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
Simple fixed-rate vs Libor swap.