commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernard GODARD <>
Subject Re: [math] UnivariateRealSolver in math3
Date Wed, 18 Apr 2012 18:35:05 GMT
Thank you Gilles,

But isn't this a regression compared to version 2.2 of commons math.

There is a lot of commonalities between the Newton solver and the other solvers.
If I have a class representing a problem for which I have derivative,
lower and upper bounds and initial guess, I can try to solve it with a
Newton solver but also with the other solvers. So I should be able to
pass any of the univariate real solvers. However this is not possible
in math3.0 since there is no common interface anymore bewteen
NewtonSolver and the other solvers (except java.lang.Object but that's
not a good idea).

Thank you,

On Tue, Apr 17, 2012 at 1:32 PM, Gilles Sadowski
<> wrote:
> Hello.
>> I am trying to port my program from commons-math 2.2 to commons-math 3.0.
>> I have several routines that require solvers implementing the
>> interface UnivariateRealSolver.
>> Solvers instance used in the program are BrentSolver, BisectionSolver,
>> SecantSolver, NewtonSolver...
>> Most of solvers in 3.0 now implement UnivariateSolver. However
>> NewtonSolver does not.
>> The only relevant common interface between NewtonSolver and the other
>> solvers is BaseUnivariateSolver<UnivariateFunction>.
> "NewtonSolver" implements
>  BaseUnivariateSolver<DifferentiableUnivariateFunction>
> not
>  BaseUnivariateSolver<UnivariateFunction>
>> However according to the API documentation, this is an internal
>> interface that should not be used outside the library iself.
>> What is the correct way to do this?
> You cannot use "NewtonSolver" as a "UnivariateRealSolver" because that
> algorithm requires the function to be differentiable. Hence there exists a
> "DifferentiableUnivariateSolver" interface which is implemented by
> "NewtonSolver".
> HTH,
> Gilles
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message