Re: Re : Hull White Tree

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Hull-White-Tree-tp5052p5056.html

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