31 termStructure_(
std::move(termStructure)) {
39 termStructure_(
std::move(termStructure)) {
50 ext::shared_ptr<TermStructureConsistentModel> tsmodel =
51 ext::dynamic_pointer_cast<TermStructureConsistentModel>(*
model_);
52 if (tsmodel !=
nullptr) {
53 referenceDate = tsmodel->termStructure()->referenceDate();
54 dayCounter = tsmodel->termStructure()->dayCounter();
61 std::vector<Time> times =
swap.mandatoryTimes();
63 ext::shared_ptr<Lattice> lattice;
68 lattice =
model_->tree(timeGrid);
71 Time maxTime = *std::max_element(times.begin(), times.end());
72 swap.initialize(lattice, maxTime);
Handle< ModelType > model_
Shared handle to an observable.
bool empty() const
checks if the contained shared pointer points to anything
Engine for a short-rate model specialized on a lattice.
ext::shared_ptr< Lattice > lattice_
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
TreeVanillaSwapEngine(const ext::shared_ptr< ShortRateModel > &, Size timeSteps, Handle< YieldTermStructure > termStructure=Handle< YieldTermStructure >())
void calculate() const override
Handle< YieldTermStructure > termStructure_
Plain-vanilla swap: fix vs ibor leg.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
void swap(Array &v, Array &w) noexcept
Numerical lattice engine for swaps.