You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Luc Maisonobe (JIRA)" <ji...@apache.org> on 2011/07/20 15:05:57 UTC

[jira] [Commented] (MATH-464) LegendreGaussIntegrator ignores defaultMaximalIterationCount and does 38 million iterations

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

Luc Maisonobe commented on MATH-464:
------------------------------------

Coming back to this issue.

I would propose to follow the same pattern we used for root solvers: adding a maxEval parameter in the top level integrate interface declaration. So we would have the same kind of configuration, with tolerances set at integrator/solver level and maxEval and function pointer passed at integrate/solve method call.

Since we are just in the phase we change interfaces, this would be a good time to add this parameter.

Does this seems reasonable ?

> LegendreGaussIntegrator ignores defaultMaximalIterationCount and does 38 million iterations
> -------------------------------------------------------------------------------------------
>
>                 Key: MATH-464
>                 URL: https://issues.apache.org/jira/browse/MATH-464
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Michael Borcherds
>            Priority: Critical
>             Fix For: 3.0
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> The following code results in count = 37801710 which is effectively an infinite loop for typical functions we are using
> (in GeoGebra)
> The argument defaultMaximalIterationCount = 100 is being ignored
> This is the version we are using:
> http://www.geogebra.org/trac/browser/trunk/geogebra/org/apache/commons/math/analysis/integration/LegendreGaussIntegrator.java
>     	LegendreGaussIntegrator gauss = new LegendreGaussIntegrator(5, 100);
>     
> 	try {
> 		double result = gauss.integrate(new testFun(), -10, 0.32462367623786328);
> 	} catch (Exception ee) {
> 		ee.printStackTrace();
> 	}
> class testFun implements UnivariateRealFunction {
>     public double value(double x) throws FunctionEvaluationException {
>     	count ++;
>         if (x>=0 && x<=5) return 0.2; else return 0;
>     }
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira