Fwd: Question on TimeGrid

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

Fwd: Question on TimeGrid

Javier Burroni
(previously sent to quantlib-dev)

Hello quantlib's developers.
I'm reading the TimeGrid code and I've noticed that the constructor of
this object using two iterator is not a particular case of the
constructor using two iterator plus a step parameter (set to zero),
and the object behaves different. Is there any reason to this?
Also, in the constructor wich use the end and a Step, the value 0.0 is
not set as the first mandatory time.
Just Curiosity
Cheers
/jb

ps: the use of this template oriented c++ you are using is awesome :)

--
Remember: KING KONG Died for your Sins


Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Question on TimeGrid

Luigi Ballabio
On 05/23/2006 10:55:45 PM, Javier Burroni wrote:
> (previously sent to quantlib-dev)

I know---answer are not always quick :)


> I'm reading the TimeGrid code and I've noticed that the constructor  
> of this object using two iterator is not a particular case of the
> constructor using two iterator plus a step parameter (set to zero),
> and the object behaves different. Is there any reason to this?

Historical reasons, I think. There might have been a use for the  
behavior when steps = 0, but it escapes me now. In his youth, a  
developer I won't mention used to try and foresee all possible ways in  
which users might want to use a class; he also had a habit of encoding  
such behaviors in magic numbers. He is older and wiser now :)


> Also, in the constructor wich use the end and a Step, the value 0.0  
> is not set as the first mandatory time.

As above. Had I the time, I would go and look at where mandatory times  
are used to see whether any code expected 0 _not_ to be there. Anybody  
on the list is willing to make a code review?


> ps: the use of this template oriented c++ you are using is awesome :)

Thanks.

Later,
        Luigi


----------------------------------------

Everything can be filed under "miscellaneous".
-- unknown