+1 on a) sounds good.
Phil Steitz wrote:
Currently, UnivariateRealSolver.solve advertises a generic MathException, which is
thrown by implementations in one of two cases:
1) the solver fails to converge
2) the UnivariateRealFunction throws a MathException when evaluating one of the
iterates
It would be better to distinguish these failures. Logically, condition 1) should
result in a ConvergenceException. Also, UnivariateRealFunction.value should either
advertise a more specific exception (e.g. FunctionEvaluationException) or throw
runtime exceptions (many could be ArithmeticExceptions) instead of checked exceptions.
So...I would like to do one of the following:
a) Add a (checked) FunctionEvalutationException (including an argument property, holding the
value of the "bad" argument), change UnivariateRealFunction.value to advertise this
and change UnivariateRealSolver.solve to throw FunctionEvaluationException, ConvergenceException
b) Remove the throws from UnivariateRealFunction (assume runtime exceptions will be
thrown / passed up) and change UnivariateRealSolver.solve to just advertise
ConvergenceException.
I am OK with either of these, though I think a) may be a little better since it could
provide more information. I guess we could also consider c)--same as a) but
FunctionEvaluationException extends RuntimeException.
If there are no objections, I will proceed with option a).
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Mark R. Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]