QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
flatforward.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl
5 Copyright (C) 2003, 2004, 2005, 2007 StatPro Italia srl
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
25#ifndef quantlib_flat_forward_curve_hpp
26#define quantlib_flat_forward_curve_hpp
27
28#include <ql/patterns/lazyobject.hpp>
29#include <ql/termstructures/yieldtermstructure.hpp>
30#include <ql/quote.hpp>
31
32namespace QuantLib {
33
35
37 public LazyObject {
38 public:
40
42 Handle<Quote> forward,
45 Frequency frequency = Annual);
47 Rate forward,
50 Frequency frequency = Annual);
52 const Calendar& calendar,
53 Handle<Quote> forward,
56 Frequency frequency = Annual);
58 const Calendar& calendar,
59 Rate forward,
62 Frequency frequency = Annual);
64
65 // inspectors
68
70
71 Date maxDate() const override { return Date::maxDate(); }
73
75
76 void update() override;
78 private:
80
81 void performCalculations() const override;
83
85
86 DiscountFactor discountImpl(Time) const override;
88
93 };
94
95 // inline definitions
96
97 inline void FlatForward::update() {
100 }
101
103 calculate();
104 return rate_.discountFactor(t);
105 }
106
110 }
111
112}
113
114#endif
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
static Date maxDate()
latest allowed date
Definition: date.cpp:771
day counter class
Definition: daycounter.hpp:44
Flat interest-rate curve.
Definition: flatforward.hpp:37
void performCalculations() const override
Compounding compounding_
Definition: flatforward.hpp:90
void update() override
Definition: flatforward.hpp:97
Compounding compounding() const
Definition: flatforward.hpp:66
Frequency compoundingFrequency() const
Definition: flatforward.hpp:67
Handle< Quote > forward_
Definition: flatforward.hpp:89
DiscountFactor discountImpl(Time) const override
discount factor calculation
Date maxDate() const override
the latest date for which the curve can return values
Definition: flatforward.hpp:71
Shared handle to an observable.
Definition: handle.hpp:41
Concrete interest rate class.
DiscountFactor discountFactor(Time t) const
discount factor implied by the rate compounded at time t.
Framework for calculation on demand and result caching.
Definition: lazyobject.hpp:35
virtual void calculate() const
Definition: lazyobject.hpp:253
void update() override
Definition: lazyobject.hpp:188
virtual Natural settlementDays() const
the settlementDays used for reference date calculation
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
virtual Calendar calendar() const
the calendar used for reference and/or option date calculation
virtual DayCounter dayCounter() const
the day counter used for date/time conversion
Interest-rate term structure.
Frequency
Frequency of events.
Definition: frequency.hpp:37
@ Annual
once a year
Definition: frequency.hpp:39
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
Real DiscountFactor
discount factor between dates
Definition: types.hpp:66
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35
Compounding
Interest rate coumpounding rule.
Definition: compounding.hpp:32