commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Commented] (MATH-1103) Convergence Checker Fixes
Date Tue, 25 Feb 2014 23:31:21 GMT


Gilles commented on MATH-1103:

Please create different tickets for different problems.
The second patch seems to introduce a dependency.

The first patch shows how brittle code can become without defensive copying.

-        Evaluation current = problem.evaluate(new ArrayRealVector(currentPoint, false));
+        Evaluation current = problem.evaluate(new ArrayRealVector(currentPoint));

Although the second may be correct, it is no less dangerous because nothing at this level
warns the developer that a new instance is required for correctness. The "evaluate" method
should be creating a copy of an object that will be used outside the class (i.e. without control).
It is fine to be concerned about performance but IMO robustness must come before premature

> Convergence Checker Fixes
> -------------------------
>                 Key: MATH-1103
>                 URL:
>             Project: Commons Math
>          Issue Type: Bug
>            Reporter: Evan Ward
>         Attachments: 0001-Fix-checker-seeing-not-old-point.patch, 0002-Fix-switched-iterations-and-evaluations.patch

This message was sent by Atlassian JIRA

View raw message