commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [math] UnivariateRealSolver in math3
Date Tue, 17 Apr 2012 13:32:45 GMT
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: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message