|
From: Luigi B. <lui...@gm...> - 2014-03-18 10:20:33
|
Hi Dirk,
it's not FixedRateBondHelper that is deprecated; it's just that
particular constructor of FittedBondDiscountCurve, which takes a
vector<shared_ptr<FixedRateBondHelper>> and now is superseded by the
one that takes a more general vector<shared_ptr<BondHelper>>.
You should be able to fix your code simply by changing the type of the
vector you're passing.
Luigi
On Mon, Mar 17, 2014 at 12:24 AM, Dirk Eddelbuettel <ed...@de...> wrote:
>
> RQuantLib has a bonds.cpp example which is pretty much a transcription of
> Bonds.cpp example in QL itself. When I build this now, I get a lot of line
> noise about the deprecated FixedRateBondHelper:
>
> bonds.cpp: In function 'SEXPREC* FittedBondCurve(SEXP, SEXP, SEXP, SEXP, SEXP)':
> bonds.cpp:1242:88: warning: 'QuantLib::FittedBondDiscountCurve::FittedBondDiscountCurve(QuantLib::Natural, const QuantLib::Calendar&, const std::vector<boost::shared_ptr<QuantLib::FixedRateBondHelper> >&, const QuantLib::DayCounter&, const QuantLib::FittedBondDiscountCurve::FittingMethod&, QuantLib::Real, QuantLib::Size, const QuantLib::Array&, QuantLib::Real)' is deprecated (declared at /usr/include/ql/termstructures/yield/fittedbonddiscountcurve.hpp:115) [-Wdeprecated-declarations]
> dc, exponentialSplines, tolerance, max));
> ^
> bonds.cpp:1251:92: warning: 'QuantLib::FittedBondDiscountCurve::FittedBondDiscountCurve(QuantLib::Natural, const QuantLib::Calendar&, const std::vector<boost::shared_ptr<QuantLib::FixedRateBondHelper> >&, const QuantLib::DayCounter&, const QuantLib::FittedBondDiscountCurve::FittingMethod&, QuantLib::Real, QuantLib::Size, const QuantLib::Array&, QuantLib::Real)' is deprecated (declared at /usr/include/ql/termstructures/yield/fittedbonddiscountcurve.hpp:115) [-Wdeprecated-declarations]
> simplePolynomial, tolerance, max));
> ^
> bonds.cpp:1259:88: warning: 'QuantLib::FittedBondDiscountCurve::FittedBondDiscountCurve(QuantLib::Natural, const QuantLib::Calendar&, const std::vector<boost::shared_ptr<QuantLib::FixedRateBondHelper> >&, const QuantLib::DayCounter&, const QuantLib::FittedBondDiscountCurve::FittingMethod&, QuantLib::Real, QuantLib::Size, const QuantLib::Array&, QuantLib::Real)' is deprecated (declared at /usr/include/ql/termstructures/yield/fittedbonddiscountcurve.hpp:115) [-Wdeprecated-declarations]
> nelsonSiegel, tolerance, max));
> ^
>
> I poked around a little and must admit that I didn't immediately see how to
> fix that.
>
> Could someone wave the cluebat my way? I'd be happy to fix Bonds.cpp along
> with what I need to update in RQuantLib.
>
> Thanks!
>
> Dirk
>
> --
> Dirk Eddelbuettel | ed...@de... | http://dirk.eddelbuettel.com
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>
|