From: Ferdinando A. <na...@am...> - 2008-01-23 17:41:23
|
On Jan 23, 2008 6:05 PM, Luigi Ballabio <lui...@gm...> wrote: > > --- trunk/QuantLib/ql/pricingengines/blackformula.hpp 2008-01-23 16:25:24 UTC (rev 14166) > > +++ trunk/QuantLib/ql/pricingengines/blackformula.hpp 2008-01-23 16:40:46 UTC (rev 14167) > > @@ -93,9 +93,10 @@ > > Real forward, > > Real blackPrice, > > Real discount = 1.0, > > + Real displacement = 0.0, > > Real guess = Null<Real>(), > > Real accuracy = 1.0e-6, > > - Real displacement = 0.0); > > + Natural maxIterations = 100); > > consistency might be less important than usability in this case. Is the > displacement parameter more likely to be specified than the guess or the > accuracy? If not, it should stay where it was before. Also, it bothers > me that, if you move a default parameter like you did, old code will > keep compiling without as much as a warning but will behave > differently---the guess will be used as a displacement. It's gonna be a > hard one to debug for the poor users that don't read the SVN messages I was aware of the issue, that's why I broke up my last commit in multiple self-consistent chunks and added a warning in this one. My personal opinion is that at least before 1.0 we should favor consistency otherwise we'll never catch up on this side, and documenting this change in next release might be enough. What about considering alternatives? E.g. removing default parameters from discount and displacement would partially force the user to look at the function again... Besides I can grant you that if you use the old guess as displacement you might have no problem at compile time but you're gonna notice at run time, so it would an evident change. Anyway I'm willing to move back displacement between accuracy and maxIterations... just confirm your preference and I'll do it ciao -- Nando |