QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
discretizedconvertible.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2005, 2006 Theo Boafo
5 Copyright (C) 2006, 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_discretized_convertible_hpp
26#define quantlib_discretized_convertible_hpp
27
28#include <ql/discretizedasset.hpp>
29#include <ql/instruments/bonds/convertiblebonds.hpp>
30#include <ql/processes/blackscholesprocess.hpp>
31
32namespace QuantLib {
33
35 public:
37 ext::shared_ptr<GeneralizedBlackScholesProcess> process,
38 DividendSchedule dividends,
39 Handle<Quote> creditSpread,
40 const TimeGrid& grid = TimeGrid());
41
42 void reset(Size size) override;
43
46 }
48
49 const Array& spreadAdjustedRate() const { return spreadAdjustedRate_; }
51
52 const Array& dividendValues() const { return dividendValues_; }
54
55 std::vector<Time> mandatoryTimes() const override {
56 std::vector<Time> result;
57 std::copy(stoppingTimes_.begin(), stoppingTimes_.end(),
58 std::back_inserter(result));
59 std::copy(callabilityTimes_.begin(), callabilityTimes_.end(),
60 std::back_inserter(result));
61 std::copy(couponTimes_.begin(), couponTimes_.end(),
62 std::back_inserter(result));
63 return result;
64 }
65
66 protected:
67 void postAdjustValuesImpl() override;
69
70 private:
71 Array adjustedGrid() const;
73 void applyCallability(Size, bool convertible);
74 void addCoupon(Size);
76 ext::shared_ptr<GeneralizedBlackScholesProcess> process_;
77 std::vector<Time> stoppingTimes_;
78 std::vector<Time> callabilityTimes_;
79 std::vector<Time> couponTimes_;
80 std::vector<Real> couponAmounts_;
81 std::vector<Time> dividendTimes_;
84 std::vector<Date> dividendDates_;
85 };
86
87}
88
89
90#endif
91
1-D array used in linear algebra.
Definition: array.hpp:52
Discretized asset class used by numerical methods.
ConvertibleBond::arguments arguments_
std::vector< Time > mandatoryTimes() const override
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
void applyCallability(Size, bool convertible)
Shared handle to an observable.
Definition: handle.hpp:41
time grid class
Definition: timegrid.hpp:43
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
std::vector< ext::shared_ptr< Dividend > > DividendSchedule