Merge branch 'fix-MATH-1376_simplex' into develop

Completes the following issues (see JIRA):
  MATH-1376
  MATH-1377
This commit is contained in:
Gilles 2016-06-11 20:35:48 +02:00
commit 821886a960
2 changed files with 13 additions and 1 deletions

View File

@ -54,6 +54,12 @@ If the output is not quite correct, check for invisible trailing spaces!
</release>
<release version="4.0" date="XXXX-XX-XX" description="">
<action dev="erans" type="update" issue="MATH-1377">
"SimplexOptimizer": Slight performance improvement.
</action>
<action dev="erans" type="fix" issue="MATH-1376" due-to="Thomas Weise">
"SimplexOptimizer": Wrong value of iteration number was passed to the convergence checker.
</action>
<action dev="erans" type="fix" issue="MATH-1319">
Major refactoring of package "o.a.c.m.random".
</action>

View File

@ -159,12 +159,18 @@ public class SimplexOptimizer extends MultivariateOptimizer {
int iteration = 0;
final ConvergenceChecker<PointValuePair> checker = getConvergenceChecker();
while (true) {
if (getIterations() > 0) {
iteration = getIterations();
if (iteration > 0) {
boolean converged = true;
for (int i = 0; i < simplex.getSize(); i++) {
PointValuePair prev = previous[i];
converged = converged &&
checker.converged(iteration, prev, simplex.getPoint(i));
if (!converged) {
// Short circuit, since "converged" will stay "false".
break;
}
}
if (converged) {
// We have found an optimum.