QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
multiproductonestep.cpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Ferdinando Ametrano
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#include <ql/errors.hpp>
21#include <ql/models/marketmodels/products/multiproductonestep.hpp>
22#include <utility>
23
24
25namespace QuantLib {
26
27 MultiProductOneStep::MultiProductOneStep(std::vector<Time> rateTimes)
28 : rateTimes_(std::move(rateTimes)) {
29 QL_REQUIRE(rateTimes_.size()>1,
30 "Rate times must contain at least two values");
31 std::vector<Time> evolutionTimes(1, rateTimes_[rateTimes_.size()-2]);
32 std::vector<std::pair<Size,Size> > relevanceRates(1);
33 relevanceRates[0] =
34 std::make_pair<Size,Size>(0, rateTimes_.size()-1);
35
37 relevanceRates);
38 }
39
41 return evolution_;
42 }
43
44 std::vector<Size> MultiProductOneStep::suggestedNumeraires() const {
45 // Terminal measure
46 return std::vector<Size>(1, rateTimes_.size()-1);
47 }
48
49}
Market-model evolution description.
std::vector< Size > suggestedNumeraires() const override
MultiProductOneStep(std::vector< Time > rateTimes)
const EvolutionDescription & evolution() const override
Definition: any.hpp:35
STL namespace.