Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
452 posts
|
Hi,
say I have a Leg with Libor coupons, floored Libor coupons, CMS coupons, etc. all mixed. I also have a IborCouponPricer and a CmsCouponPricer and want to attach these to the “matching" coupons. How can I do that in one (not too long) line of code? It seems setCouponPricer() and setCouponPricers() do not suit really, but I might be missing the obvious... Kind Regards Peter ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
3579 posts
|
Hi, I don't think there's a function that does that. If you want to get fancy, you can write a visitor similar to PricerSetter but storing both pricers and setting the appropriate one; otherwise, you can loop over the coupons and find out their type yourself. Luigi On Tue, Dec 13, 2016 at 12:56 PM Peter Caspers <[hidden email]> wrote: Hi, ... [show rest of quote] ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
452 posts
|
Hi Luigi,
yes, I do loop over the coupons right now. This is cumbersome, lots of dynamic casting and for cap-floored coupons you have to look at the underlying to find the type. Instead of your fancy solution I thought I could reuse the existing PricerSetter und write a simple overload of the setCouponPricers method that just tries to set the pricers one after another and catches exceptions thrown from the PricerSetter in case of mismatches. But this overload would have to sit within the couponpricer file since the setter is in an empty namespace in that file. Would that be too dirty for a PR? Is the use case maybe exotic after all? Kind Regards Peter
... [show rest of quote] ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
3579 posts
|
It's ok for me. Luigi On Tue, Dec 13, 2016 at 5:53 PM Peter Caspers <[hidden email]> wrote:
... [show rest of quote] ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Free forum by Nabble | Disable Popup Ads | Edit this page |