Re: Some questions about forcing recalculation

Posted by Eric Ehlers-2 on
URL: http://quantlib.414.s1.nabble.com/Some-questions-about-forcing-recalculation-tp12208p12215.html

Hi Andrew,

On Thu, September 4, 2008 10:13, a.p. wrote:

>
> Eric wrote:
>
> "Not exactly.  Suppose Range B depends on Range A.  If A's inputs change,
> Excel
> is smart enough to recalculate B, even if A's return value is unchanged.  In
> the scenario I describe above, A's return value would in fact change on each
> recalculation, as the update counter is incremented - my_obj#0000,
> my_obj#0001, etc.  But even without that, B is still recalculated.  If you
> set
> calculation to automatic then you don't even need to hit F9"
>
> Sure, moreover this example doesn't conflict with my previous statement
> about
> argument change. But, you see, if we discuss trader workbook it's absolutely
> inconvinient to use range reference: there are a lot of instuments(objects),
> which are created at start up and upgraded during whole day, and many
> functions
> (different calculations, in fact, created in different workbooks) dependent
> on
> these objects. So string reference (e.g. "my_obj") is more applicable in
> practice.

I would most certainly use an Excel range reference in this case, not raw
strings nor triggers.  You say the range reference is inconvenient, I would
argue that it's a question of carefully designing the structure of your
workbooks and controlling their interdependencies.

But I appreciate that you have a different opinion so let's agree to disagree.
:-)

> "ObjectHandler 0.9.6 includes an enhancement that also solves this problem.
> The enhancement ensures that all object references are up to date.  Suppose
> Object B depends on Object A.  Any time Object B is retrieved, OH checks
> whether B is newer then A, if not, OH recreates B before returning it to the
> user."
>
> So, does it include support for dependecy functions, i.e. will funcion with
> string reference f("my_obj", some static arguments...) be recalculated if
> my_obj is updated?

No, updating my_obj does not immediately force recalculation of dependent
functions.  Rather, any time you retrieve an object B which depends on my_obj,
OH ensures that B is newer than my_obj.  The new feature is not relevant to
the case you describe above.  When f() is recalculated, it receives by
definition an up to date reference to my_obj.

> "What is the class of your "my_obj"?  I have never witnessed a use case like
> the one you describe.  Typically when an object is required globally, it is
> something such as a term structure which can be created just once when the
> application is initialized, and thereafter updated non-destructively."
>
> It could be term structure, but dependency functions use string reference
> instead
> of cell, so it doesn't matter.

I'm curious to know.  Why is your user recreating the term structure
repeatedly throughout the session?  Why not create it just once?  Changes in
the rates will update the state of the original TS without recreating it.  If
the user needs to change the structure of the TS, you could create multiple
TSs at startup, and use a Handle to point to whichever TS is desired at a
given moment.  Dependent objects could reference the Handle without needing to
know to which TS it points.

Regards,
Eric

-------------------------
Eric Ehlers
nazcatech sprl | Brussels | http://www.nazcatech.be
Distributed computing for pricing analytics - Use Microsoft Excel as a client
to the Grid


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev