QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
flatforward.cpp
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) 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
23#include <utility>
24
25namespace QuantLib {
26
27 FlatForward::FlatForward(const Date& referenceDate,
28 Handle<Quote> forward,
29 const DayCounter& dayCounter,
30 Compounding compounding,
31 Frequency frequency)
32 : YieldTermStructure(referenceDate, Calendar(), dayCounter), forward_(std::move(forward)),
33 compounding_(compounding), frequency_(frequency) {
35 }
36
37 FlatForward::FlatForward(const Date& referenceDate,
38 Rate forward,
39 const DayCounter& dayCounter,
40 Compounding compounding,
41 Frequency frequency)
42 : YieldTermStructure(referenceDate, Calendar(), dayCounter),
43 forward_(ext::shared_ptr<Quote>(new SimpleQuote(forward))),
44 compounding_(compounding), frequency_(frequency) {}
45
47 const Calendar& calendar,
48 Handle<Quote> forward,
49 const DayCounter& dayCounter,
50 Compounding compounding,
51 Frequency frequency)
52 : YieldTermStructure(settlementDays, calendar, dayCounter), forward_(std::move(forward)),
53 compounding_(compounding), frequency_(frequency) {
55 }
56
58 const Calendar& calendar,
59 Rate forward,
60 const DayCounter& dayCounter,
61 Compounding compounding,
62 Frequency frequency)
63 : YieldTermStructure(settlementDays, calendar, dayCounter),
64 forward_(ext::shared_ptr<Quote>(new SimpleQuote(forward))),
65 compounding_(compounding), frequency_(frequency) {}
66
67}
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Handle< Quote > forward_
Definition: flatforward.hpp:89
FlatForward(const Date &referenceDate, Handle< Quote > forward, const DayCounter &dayCounter, Compounding compounding=Continuous, Frequency frequency=Annual)
Definition: flatforward.cpp:27
Shared handle to an observable.
Definition: handle.hpp:41
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Definition: observable.hpp:228
purely virtual base class for market observables
Definition: quote.hpp:37
market element returning a stored value
Definition: simplequote.hpp:33
Interest-rate term structure.
flat forward rate term structure
Frequency
Frequency of events.
Definition: frequency.hpp:37
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
STL namespace.
simple quote class