QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
multiproductmultistep.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/multiproductmultistep.hpp>
22#include <utility>
23
24namespace QuantLib {
25
27 : rateTimes_(std::move(rateTimes)) {
28 QL_REQUIRE(rateTimes_.size()>1,
29 "Rate times must contain at least two values");
30 Size n = rateTimes_.size()-1;
31 std::vector<Time> evolutionTimes(n);
32 std::vector<std::pair<Size,Size> > relevanceRates(n);
33 for (Size i=0; i<n; ++i) {
34 evolutionTimes[i] = rateTimes_[i];
35 relevanceRates[i] = std::make_pair(i, i+1);
36 }
37
39 relevanceRates);
40 }
41
43 return evolution_;
44 }
45
47 {
48 Size n = rateTimes_.size()-1;
49 std::vector<Size> numeraires(n);
50 // MoneyMarketPlus(1)
51 for (Size i=0; i<n; ++i)
52 numeraires[i]=i+1;
53 return numeraires;
54 }
55
56}
Market-model evolution description.
std::vector< Size > suggestedNumeraires() const override
MultiProductMultiStep(std::vector< Time > rateTimes)
const EvolutionDescription & evolution() const override
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
STL namespace.