|
From: Luigi B. <lui...@gm...> - 2016-10-20 15:22:13
|
Hi,
you can add a template overload of CashFlows::yield. Since it would
take an instance of the solver, it wouldn't cause an ambiguity with the
existing method.
Luigi
On Tue, Oct 18, 2016 at 4:24 PM Daniel Hrabovcak <d.h...@tm...>
wrote:
> Hello All,
>
>
>
> Would it be possible to genericize CashFlows::yield (and by extension
> BondFunctions::yield) to take an arbitrary solver, instead of the default
> NewtonSafe solver?
>
>
>
> Using a template parameter with a default value would have been backwards
> compatible but alas, using default template values is not possible
> pre-C++11 and QuantLib does not currently support dynamic dispatch for
> solvers so it cannot be passed into the function either.
>
>
>
> Are there any possibilities of creating a patch to use an arbitrary solver
> at runtime? I would be happy to code it up.
>
>
>
> Thanks,
>
> DH
>
> ------------------------------------------------------------------------------
> 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
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>
|