Hi Group,
In the Hull White class, as of the document, the member function tree() returns a trinomial tree. However the prototype is boost::shared_ptr<NumericMethod>, it does not have member functions such as discount(), probability(). Can someone tell me how to access the trinomial tree structure?
Thanks.
Guowen
|
Hi, You have to perform a dynamic cast to the required type : boost::shared_ptr<ShortRateTree> shortRateTree = ----- Message d'origine ---- De : Guowen Han <[hidden email]> À : [hidden email] Envoyé le : Mercredi, 20 Septembre 2006, 5h47mn 43s Objet : [Quantlib-users] Hull White Tree Hi Group,
In the Hull White class, as of the document, the member function tree() returns a trinomial tree. However the prototype is boost::shared_ptr<NumericMethod>, it does not have member functions such as discount(), probability(). Can someone tell me how to access the trinomial tree structure?
Thanks.
Guowen ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
This does not work. Anyone has different suggestions?
Thanks.
On 9/20/06, keztenpens <[hidden email]> wrote:
|
Hi Luigi,
I am using QuantLib 3.10.
I have an error message saying that ShortRateTree is not defined even the ql/ShortRateModel/onefactormodel.hpp is includeed. I guess this is because that the ShortRateTree is an inner class of OneFactorModel. Then I changed it to use OneFactorModel::ShortRateTree, the problem then changed to be that ShortRateTree is protected. Looks like I am missing something here.
Thanks,
Guowen
On 9/24/06, Luigi Ballabio <[hidden email]> wrote:
|
On Sun, 2006-09-24 at 10:07 -0400, Guowen Han wrote:
> I have an error message saying that ShortRateTree is not defined even > the ql/ShortRateModel/onefactormodel.hpp is includeed. I guess this is > because that the ShortRateTree is an inner class of OneFactorModel. > Then I changed it to use OneFactorModel::ShortRateTree, the problem > then changed to be that ShortRateTree is protected. Oh, I see. The inner class is no longer protected in the latest releases. You can just declare it as public and recompile. Luigi > On 9/24/06, Luigi Ballabio <[hidden email]> wrote: > > On Sep 24, 2006, at 3:02 AM, Guowen Han wrote: > > > This does not work. Anyone has different suggestions? > > In which way it doesn't work? (except for the double << which > should be > a single one) > > Luigi > > > > On 9/20/06, keztenpens <[hidden email]> wrote: Hi, > >> > >> You have to perform a dynamic cast to the required type : > >> boost::shared_ptr<ShortRateTree> shortRateTree = > >> > >> > boost::dynamic_pointer_cast<<ShortRateTree>(hw->tree()); > > > ---------------------------------------- Age is an issue of mind over matter. If you don't mind, it doesn't matter. -- Mark Twain |
Free forum by Nabble | Edit this page |