Re: Re: accrualAmount() function within the bond class...

Posted by Toyin Akin on
URL: http://quantlib.414.s1.nabble.com/Problem-within-the-Bond-YieldSolver-class-tp4278p4286.html

Ah,

It just occured to me, I thought your original question was concerning how
the QL_TODAYS_PAYMENT is set in the first place. (ie - set at compilation
time.)

Thus I thought that you wanted to make this user configurable. Set at
run-time instead.

Forgive me.

Hence I guess your proposal concerns only Bond's then?

Toy out...



>From: Joseph Wang <[hidden email]>
>To: Toyin Akin <[hidden email]>
>CC: [hidden email]
>Subject: Re: [Quantlib-users] Re: accrualAmount() function within the bond
>class...
>Date: Sat, 10 Dec 2005 02:58:50 -0600
>
>Looking over the code it doesn't look that bad to refactor things so that
>QL_TODAYS_PAYMENT is modularized.  The key seems to create a routine in
>Event
>
>
>bool Event::hasOccurred(Date settlementDate,
>#if QL_TODAYS_PAYMENT
>bool include_todays_date = true
>#else
>bool include_todays_date = false
>#endif
>);
>
>This gets rid of all but one use of  the define
>
>Thoughts?