commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <j...@apache.org>
Subject [jira] Commented: (MATH-218) UnivariateRealSolver: Allow function to be passed as argument to the "solve" method
Date Wed, 10 Sep 2008 20:19:44 GMT

    [ https://issues.apache.org/jira/browse/MATH-218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629941#action_12629941
] 

Luc Maisonobe commented on MATH-218:
------------------------------------

I agree this would be an interesting improvement.
Configuring and using the solver should be separate.
Since this changes API, it should be done for 2.0

> UnivariateRealSolver: Allow function to be passed as argument to the "solve" method
> -----------------------------------------------------------------------------------
>
>                 Key: MATH-218
>                 URL: https://issues.apache.org/jira/browse/MATH-218
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Priority: Trivial
>             Fix For: 2.0
>
>
> Hello.
> I was wondering why all the root finders (e.g. NewtonSolver, BrentSolver, etc.) require
the function to be passed as an argument to the contructor.
> It should be possible to pass it when calling the method "solve" i.e.      
>    double solve(UnivariateRealFunction f, double min, double max)
> This would be much more flexible, e.g. allowing one to use the same solver instance for
several functions.
>                                                                                 
> For example, my need would be something like the following (currently impossible) code:
>       public class Zero implements UnivariateRealFunction {
>           public value(double x) throws FunctionEvaluationException {    
>               return ...;
>          }
>          public double get(UnivariateRealSolver s, double min, double max) {
>              return s.solve(this, min, max);
>          }
>       }
> Best regards,
> Gilles

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message