DiscretizedOption question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DiscretizedOption question

JURAJ HUSKA
Hello all,

this is a question for QuantLib experts.
Why is there a warning "it is advised that derived classes take care of creating and initializing themselves an instance of the underlying" in DiscretizedOption class documentation?

I am asking because it may help me resolve an issue with my code.
I created an object of similar structure (to DiscretizedOption) , call it "bondoptioncalculator", and it seems to run OK in debug mode but when I compile it to a dll and run it from another application it seems to be blowing up "randomly". Let's say I run my bondoptioncalculator on a set of 100 bonds, it may happen that the application throws an error on 50th bond the first time around and everything else goes through smoothly and the next time around it blows up on 20 th bond, etc. It seems something stays static in the dll (or some objects don't get created/destroyed?) and influences next runs of the code.

Juraj


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: DiscretizedOption question

Luigi Ballabio
On Fri, 2008-02-15 at 16:56 -0600, JURAJ HUSKA wrote:
> Why is there a warning "it is advised that derived classes take care
> of creating and initializing themselves an instance of the underlying"
> in DiscretizedOption class documentation?

That should probably be a note rather than a warning. If the options
initialize their underlying themselves (such as, e.g., the existing
DiscretizedSwaption classes--you can have a look at it) consistency is
ensured between option and underlying. If not, client code would have to
take steps to ensure it.

Luigi


--

Academic: a term of opprobrium applied to those that do their job well
by those who cannot.
-- Sir Ernest Gowers



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users