QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
treecallablebondengine.hpp
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
24#ifndef quantlib_tree_callable_bond_engine_hpp
25#define quantlib_tree_callable_bond_engine_hpp
26
27#include <ql/experimental/callablebonds/callablebond.hpp>
28#include <ql/pricingengines/latticeshortratemodelengine.hpp>
29
30namespace QuantLib {
31
33
35 : public LatticeShortRateModelEngine<CallableBond::arguments,
36 CallableBond::results> {
37 public:
44 const ext::shared_ptr<ShortRateModel>&,
45 Size timeSteps,
48 const ext::shared_ptr<ShortRateModel>&,
49 const TimeGrid& timeGrid,
52 void calculate() const override;
53
54 private:
55 void calculateWithSpread(Spread s) const;
57 };
58
60
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
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
Definition: any.hpp:35