piecewiseyieldcurve.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 /*
4  Copyright (C) 2007 Eric Ehlers
5  Copyright (C) 2007, 2008, 2009 Ferdinando Ametrano
6  Copyright (C) 2016 Stefano Fondi
7 
8  This file is part of QuantLib, a free-software/open-source library
9  for financial quantitative analysts and developers - http://quantlib.org/
10 
11  QuantLib is free software: you can redistribute it and/or modify it
12  under the terms of the QuantLib license. You should have received a
13  copy of the license along with this program; if not, please email
14  <quantlib-dev@lists.sf.net>. The license is also available online at
15  <http://quantlib.org/license.shtml>.
16 
17  This program is distributed in the hope that it will be useful, but WITHOUT
18  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19  FOR A PARTICULAR PURPOSE. See the license for more details.
20 */
21 
22 #ifndef qla_piecewiseyieldcurve_hpp
23 #define qla_piecewiseyieldcurve_hpp
24 
26 
27 namespace QuantLibAddin {
28 
29  // A wrapper for QuantLib template class PiecewiseYieldCurve<Traits, Interpolator>.
30  // Calls to constructor/member functions must specify values for Traits and Interpolator
31  // because it is not possible to expose a template class directly to client platforms
32  // such as Excel.
33  class PiecewiseYieldCurve : public YieldTermStructure {
34  public:
36  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
37  QuantLib::Natural nDays,
38  const QuantLib::Calendar& calendar,
39  const std::vector<boost::shared_ptr<QuantLib::RateHelper> >& qlrhs,
40  const QuantLib::DayCounter& dayCounter,
41  const std::vector<QuantLib::Handle<QuantLib::Quote> >& jumps,
42  const std::vector<QuantLib::Date>& jumpDates,
43  QuantLib::Real accuracy,
44  const std::string& traitsID,
45  const std::string& interpolatorID,
46  const QuantLib::MixedInterpolation::Behavior behavior,
47  const QuantLib::Size n,
48  bool permanent);
50  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
51  QuantLib::Natural nDays,
52  const QuantLib::Calendar& calendar,
53  const std::vector<boost::shared_ptr<QuantLib::RateHelper> >& qlrhs,
54  const QuantLib::DayCounter& dayCounter,
55  const std::vector<QuantLib::Handle<QuantLib::Quote> >& jumps,
56  const std::vector<QuantLib::Date>& jumpDates,
57  QuantLib::Real accuracy,
58  const std::string& traitsID,
59  const std::string& interpolatorID,
60  bool permanent);
61  const std::vector<QuantLib::Time>& times() const;
62 
63  const std::vector<QuantLib::Date>& dates() const;
64 
65  const std::vector<QuantLib::Real>& data() const;
66 
67  //const std::vector<QuantLib::Real>& improvements() const;
68 
69  //QuantLib::Size iterations() const;
70 
72  return pair_;
73  }
74 
75  const std::vector<QuantLib::Time>& jumpTimes() const;
76 
77  const std::vector<QuantLib::Date>& jumpDates() const;
78 
79  private:
81 
82  };
83 
84 }
85 
86 #endif
std::pair< InterpolatedYieldCurve::Traits, InterpolatedYieldCurve::Interpolator > InterpolatedYieldCurvePair
Definition: yieldtermstructures.hpp:168
PiecewiseYieldCurve(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, QuantLib::Natural nDays, const QuantLib::Calendar &calendar, const std::vector< boost::shared_ptr< QuantLib::RateHelper > > &qlrhs, const QuantLib::DayCounter &dayCounter, const std::vector< QuantLib::Handle< QuantLib::Quote > > &jumps, const std::vector< QuantLib::Date > &jumpDates, QuantLib::Real accuracy, const std::string &traitsID, const std::string &interpolatorID, const QuantLib::MixedInterpolation::Behavior behavior, const QuantLib::Size n, bool permanent)
const std::vector< QuantLib::Date > & jumpDates() const
Definition: piecewiseyieldcurve.hpp:33
const std::vector< QuantLib::Time > & jumpTimes() const
Definition: abcd.hpp:38
const std::vector< QuantLib::Date > & dates() const
InterpolatedYieldCurvePair interpolatedYieldCurvePair() const
Definition: piecewiseyieldcurve.hpp:71
const std::vector< QuantLib::Time > & times() const
const std::vector< QuantLib::Real > & data() const