term structures

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

term structures

Ferdinando M. Ametrano-2
Hi all

1) I would like to remove the currency_ data member and the currency()
method from the term structure interface. This is mainly because it is not
really used in QuantLib, except forcing the user to provide a currency to
the constructor.
In my opinion the term structure currency definition is another issue we
should revise if/when we have a currency framework.
Anyone against this change?

2) I would provide a default 'Time minTime()' implementation in the base class:
     inline Time TermStructure::minTime() const {
             // minDate() could return todaysDate() instead of
             // the usual settlementDate(), so that the minTime
             // could be negative
             return dayCounter().yearFraction(settlementDate(), minDate());
     }
and I would revise any instance of 'QL_REQUIRE(t>=0.0' in term of
'QL_REQUIRE(t>=minTime()'
Is it OK?

ciao -- Nando



Reply | Threaded
Open this post in threaded view
|

Re: term structures

enrico.sirola
>>>>> "nando" == Ferdinando Ametrano <[hidden email]> writes:

    nando> Hi all 1) I would like to remove the currency_ data member
    nando> and the currency() method from the term structure
    nando> interface. This is mainly because it is not really used in
    nando> QuantLib, except forcing the user to provide a currency to
    nando> the constructor.  In my opinion the term structure currency
    nando> definition is another issue we should revise if/when we
    nando> have a currency framework.  Anyone against this change?

hi nando,
I think there could be application code using the currency() method
(maybe here in RiskMap we use it, I can't remember), so  maybe we
could:
 * overload the constructor, providing a "currencyless" constructor
   and throw an exception from the currency() method iff currency_ ==
   INVALID_CURRENCY (we could add an INVALID_CURRENCY item to the
   Currency enum, in case it doesn't break other stuff)
 * provide a default currency value (I would'n like it btw).
what do you think?
ciao,
enrico

--
Enrico Sirola <[hidden email]>
gpg public key available from wwwkeys.pgp.net
Key fingerprint = B446 7332 ED55 BC68 5FE8  DE0F 98DF EC86 377F E07F