This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git

commit 80a7eb18323a185a272ea445bb146380fb5ae9ec
Author: Gilles Sadowski <gillese...@gmail.com>
AuthorDate: Tue Aug 24 15:39:52 2021 +0200

    Change how simulated annealing affects the transformed simplex (cf. 
MATH-1622).
    
    Compared with commit 97462b1a1b6f64ab10e06db331d5b6762d979aab, this commit 
is
    more consistent with assumptions of the original (non-hybridized) algorithm.
---
 .../nonlinear/scalar/noderiv/MultiDirectionalTransform.java  | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/MultiDirectionalTransform.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/MultiDirectionalTransform.java
index b6f2a73..bdd53e0 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/MultiDirectionalTransform.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/MultiDirectionalTransform.java
@@ -90,16 +90,10 @@ public class MultiDirectionalTransform
                                                           evaluationFunction);
                 final PointValuePair expandedBest = expandedSimplex.get(0);
 
-                if (comparator.compare(expandedBest, reflectedBest) < 0) {
+                if (comparator.compare(expandedBest, reflectedBest) < 0 ||
+                    (sa != null &&
+                     sa.test(expandedBest.getValue() - 
reflectedBest.getValue()))) {
                     return expandedSimplex;
-                } else if (sa != null &&
-                           sa.test(expandedBest.getValue() - 
reflectedBest.getValue())) {
-                    // SA hybridation branch (not part of Torczon's algorithm):
-                    // Create a simplex that contains
-                    //  * the reflected simplex's best point (since it is the
-                    //    best point overall), and
-                    //  * the expanded simplex's points (except its best 
point).
-                    return 
reflectedSimplex.replaceLast(expandedSimplex.asList(1, 
expandedSimplex.getSize()));
                 } else {
                     return reflectedSimplex;
                 }

Reply via email to