25#ifndef quantlib_short_rate_model_engine_hpp
26#define quantlib_short_rate_model_engine_hpp
28#include <ql/models/model.hpp>
29#include <ql/pricingengines/genericmodelengine.hpp>
37 template <
class Arguments,
class Results>
42 const ext::shared_ptr<ShortRateModel>& model,
48 const ext::shared_ptr<ShortRateModel>& model,
58 template <
class Arguments,
class Results>
60 const ext::shared_ptr<ShortRateModel>& model,
63 timeSteps_(timeSteps) {
64 QL_REQUIRE(timeSteps>0,
65 "timeSteps must be positive, " << timeSteps <<
69 template <
class Arguments,
class Results>
74 timeSteps_(timeSteps) {
75 QL_REQUIRE(timeSteps>0,
76 "timeSteps must be positive, " << timeSteps <<
80 template <
class Arguments,
class Results>
82 const ext::shared_ptr<ShortRateModel>& model,
85 timeGrid_(timeGrid), timeSteps_(0) {
89 template <
class Arguments,
class Results>
92 if (!timeGrid_.empty())
93 lattice_ = this->model_->tree(timeGrid_);
Base class for some pricing engine on a particular model.
Handle< ShortRateModel > model_
Shared handle to an observable.
Engine for a short-rate model specialized on a lattice.
LatticeShortRateModelEngine(const ext::shared_ptr< ShortRateModel > &model, Size timeSteps)
LatticeShortRateModelEngine(const ext::shared_ptr< ShortRateModel > &model, const TimeGrid &timeGrid)
ext::shared_ptr< Lattice > lattice_
LatticeShortRateModelEngine(const Handle< ShortRateModel > &model, Size timeSteps)
Abstract short-rate model class.
std::size_t Size
size of a container