QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
treecallablebondengine.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) 2008 Allen Kuo
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file treecallablebondengine.hpp
21 \brief Numerical lattice engines for callable/puttable bonds
22*/
23
24#ifndef quantlib_tree_callable_bond_engine_hpp
25#define quantlib_tree_callable_bond_engine_hpp
26
29
30namespace QuantLib {
31
32 //! Numerical lattice engine for callable fixed rate bonds
33 /*! \ingroup bondengines */
35 : public LatticeShortRateModelEngine<CallableBond::arguments,
36 CallableBond::results> {
37 public:
38 /*! \name Constructors
39 \note the term structure is only needed when the short-rate
40 model cannot provide one itself.
41 */
42 //@{
44 const ext::shared_ptr<ShortRateModel>&,
45 Size timeSteps,
48 const ext::shared_ptr<ShortRateModel>&,
49 const TimeGrid& timeGrid,
51 //@}
52 void calculate() const override;
53
54 private:
55 void calculateWithSpread(Spread s) const;
57 };
58
59 //! Numerical lattice engine for callable zero coupon bonds
60 /*! \ingroup bondengines */
63
64 public:
66 const ext::shared_ptr<ShortRateModel>& model,
67 const Size timeSteps,
68 const Handle<YieldTermStructure>& termStructure =
70 : TreeCallableFixedRateBondEngine(model, timeSteps, termStructure) {}
71
73 const ext::shared_ptr<ShortRateModel>& model,
74 const TimeGrid& timeGrid,
75 const Handle<YieldTermStructure>& termStructure =
77 : TreeCallableFixedRateBondEngine(model, timeGrid, termStructure) {}
78 };
79
80}
81
82#endif
callable bond classes
Shared handle to an observable.
Definition: handle.hpp:41
Engine for a short-rate model specialized on a lattice.
time grid class
Definition: timegrid.hpp:43
Numerical lattice engine for callable fixed rate bonds.
Numerical lattice engine for callable zero coupon bonds.
TreeCallableZeroCouponBondEngine(const ext::shared_ptr< ShortRateModel > &model, const TimeGrid &timeGrid, const Handle< YieldTermStructure > &termStructure=Handle< YieldTermStructure >())
TreeCallableZeroCouponBondEngine(const ext::shared_ptr< ShortRateModel > &model, const Size timeSteps, const Handle< YieldTermStructure > &termStructure=Handle< YieldTermStructure >())
Real Spread
spreads on interest rates
Definition: types.hpp:74
std::size_t Size
size of a container
Definition: types.hpp:58
Engine for a short-rate model specialized on a lattice.
Definition: any.hpp:35