Re: [QuantLib-svn] SF.net SVN: quantlib: [14167] trunk/QuantLib

Posted by Ferdinando M. Ametrano-3 on
URL: http://quantlib.414.s1.nabble.com/Re-QuantLib-svn-SF-net-SVN-quantlib-14167-trunk-QuantLib-tp11626p11627.html

On Jan 23, 2008 6:05 PM, Luigi Ballabio <[hidden email]> 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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev