QuantLib
: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
ql
pricingengines
bond
riskybondengine.hpp
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
Copyright (C) 2008 Roland Lichters
5
Copyright (C) 2021 Lew Wei Hao
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_risky_bond_engine_hpp
26
#define quantlib_risky_bond_engine_hpp
27
28
#include <ql/instruments/bond.hpp>
29
#include <ql/termstructures/yieldtermstructure.hpp>
30
#include <ql/termstructures/defaulttermstructure.hpp>
31
#include <ql/handle.hpp>
32
33
namespace
QuantLib
{
34
36
64
class
RiskyBondEngine
:
public
Bond::engine
{
65
public
:
66
RiskyBondEngine
(
Handle<DefaultProbabilityTermStructure>
defaultTS
,
67
Real
recoveryRate
,
68
Handle<YieldTermStructure>
yieldTS
);
69
void
calculate
()
const override
;
70
Handle<DefaultProbabilityTermStructure>
defaultTS
()
const
;
71
Real
recoveryRate
()
const
;
72
Handle<YieldTermStructure>
yieldTS
()
const
;
73
private
:
74
Handle<DefaultProbabilityTermStructure>
defaultTS_
;
75
Real
recoveryRate_
;
76
Handle<YieldTermStructure>
yieldTS_
;
77
};
78
79
80
inline
Handle<DefaultProbabilityTermStructure>
RiskyBondEngine::defaultTS
()
const
{
81
return
defaultTS_
;
82
}
83
84
inline
Real
RiskyBondEngine::recoveryRate
()
const
{
return
recoveryRate_
; }
85
86
inline
Handle<YieldTermStructure>
RiskyBondEngine::yieldTS
()
const
{
return
yieldTS_
; }
87
88
}
89
90
#endif
QuantLib::Bond::engine
Definition:
bond.hpp:313
QuantLib::Handle
Shared handle to an observable.
Definition:
handle.hpp:41
QuantLib::RiskyBondEngine
Risky pricing engine for bonds.
Definition:
riskybondengine.hpp:64
QuantLib::RiskyBondEngine::defaultTS
Handle< DefaultProbabilityTermStructure > defaultTS() const
Definition:
riskybondengine.hpp:80
QuantLib::RiskyBondEngine::calculate
void calculate() const override
Definition:
riskybondengine.cpp:39
QuantLib::RiskyBondEngine::recoveryRate_
Real recoveryRate_
Definition:
riskybondengine.hpp:75
QuantLib::RiskyBondEngine::defaultTS_
Handle< DefaultProbabilityTermStructure > defaultTS_
Definition:
riskybondengine.hpp:74
QuantLib::RiskyBondEngine::yieldTS
Handle< YieldTermStructure > yieldTS() const
Definition:
riskybondengine.hpp:86
QuantLib::RiskyBondEngine::recoveryRate
Real recoveryRate() const
Definition:
riskybondengine.hpp:84
QuantLib::RiskyBondEngine::yieldTS_
Handle< YieldTermStructure > yieldTS_
Definition:
riskybondengine.hpp:76
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
QuantLib
Definition:
any.hpp:35
Generated by
Doxygen
1.9.5