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.
>
> "NewtonSolver" implements
> BaseUnivariateSolver
> not
> BaseUnivariateSolver
>
>> 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: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org