You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2023/11/21 19:15:44 UTC

(commons-math) 04/07: Access static field in a static way

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

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

commit 68a21f7fb186b164470f2ddac12d3edfd4895dfd
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Tue Nov 21 18:53:41 2023 +0000

    Access static field in a static way
---
 .../scalar/noderiv/SimplexOptimizerMultiDirectionalTest.java     | 9 +++++----
 .../nonlinear/scalar/noderiv/SimplexOptimizerNelderMeadTest.java | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerMultiDirectionalTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerMultiDirectionalTest.java
index 66928f0c7..71b15b35b 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerMultiDirectionalTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerMultiDirectionalTest.java
@@ -24,6 +24,7 @@ import org.apache.commons.math4.legacy.optim.MaxEval;
 import org.apache.commons.math4.legacy.optim.PointValuePair;
 import org.apache.commons.math4.legacy.optim.nonlinear.scalar.GoalType;
 import org.apache.commons.math4.legacy.optim.nonlinear.scalar.ObjectiveFunction;
+import org.apache.commons.math4.legacy.optim.nonlinear.scalar.noderiv.OptimTestUtils.FourExtrema;
 import org.apache.commons.math4.legacy.core.MathArrays;
 import org.apache.commons.math4.core.jdkmath.JdkMath;
 import org.junit.Assert;
@@ -65,7 +66,7 @@ public class SimplexOptimizerMultiDirectionalTest {
                GoalType.MINIMIZE,
                105,
                Simplex.alongAxes(OptimTestUtils.point(2, 0.2, 1e-2)),
-               new PointValuePair(new double[] {f.xM, f.yP}, f.valueXmYp),
+               new PointValuePair(new double[] {FourExtrema.xM, FourExtrema.yP}, FourExtrema.valueXmYp),
                1e-6);
     }
     @Test
@@ -76,7 +77,7 @@ public class SimplexOptimizerMultiDirectionalTest {
                GoalType.MAXIMIZE,
                100,
                Simplex.alongAxes(OptimTestUtils.point(2, 0.2, 1e-2)),
-               new PointValuePair(new double[] {f.xM, f.yM}, f.valueXmYm),
+               new PointValuePair(new double[] {FourExtrema.xM, FourExtrema.yM}, FourExtrema.valueXmYm),
                1e-6);
     }
     @Test
@@ -87,7 +88,7 @@ public class SimplexOptimizerMultiDirectionalTest {
                GoalType.MINIMIZE,
                100,
                Simplex.alongAxes(OptimTestUtils.point(2, 0.2, 1e-2)),
-               new PointValuePair(new double[] {f.xP, f.yM}, f.valueXpYm),
+               new PointValuePair(new double[] {FourExtrema.xP, FourExtrema.yM}, FourExtrema.valueXpYm),
                1e-6);
     }
     @Test
@@ -98,7 +99,7 @@ public class SimplexOptimizerMultiDirectionalTest {
                GoalType.MAXIMIZE,
                110,
                Simplex.alongAxes(OptimTestUtils.point(2, 0.2, 1e-2)),
-               new PointValuePair(new double[] {f.xP, f.yP}, f.valueXpYp),
+               new PointValuePair(new double[] {FourExtrema.xP, FourExtrema.yP}, FourExtrema.valueXpYp),
                1e-6);
     }
 
diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerNelderMeadTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerNelderMeadTest.java
index d7a2989b7..bd2ad2550 100644
--- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerNelderMeadTest.java
+++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/SimplexOptimizerNelderMeadTest.java
@@ -28,6 +28,7 @@ import org.apache.commons.math4.legacy.optim.PointValuePair;
 import org.apache.commons.math4.legacy.optim.nonlinear.scalar.GoalType;
 import org.apache.commons.math4.legacy.optim.nonlinear.scalar.LeastSquaresConverter;
 import org.apache.commons.math4.legacy.optim.nonlinear.scalar.ObjectiveFunction;
+import org.apache.commons.math4.legacy.optim.nonlinear.scalar.noderiv.OptimTestUtils.FourExtrema;
 import org.apache.commons.math4.legacy.core.MathArrays;
 import org.junit.Assert;
 import org.junit.Test;
@@ -136,7 +137,7 @@ public class SimplexOptimizerNelderMeadTest {
                GoalType.MINIMIZE,
                105,
                Simplex.alongAxes(OptimTestUtils.point(2, 0.2, 1e-2)),
-               new PointValuePair(new double[] {f.xM, f.yP}, f.valueXmYp),
+               new PointValuePair(new double[] {FourExtrema.xM, FourExtrema.yP}, FourExtrema.valueXmYp),
                1e-6);
     }
     @Test
@@ -147,7 +148,7 @@ public class SimplexOptimizerNelderMeadTest {
                GoalType.MAXIMIZE,
                100,
                Simplex.alongAxes(OptimTestUtils.point(2, 0.2, 1e-2)),
-               new PointValuePair(new double[] {f.xM, f.yM}, f.valueXmYm),
+               new PointValuePair(new double[] {FourExtrema.xM, FourExtrema.yM}, FourExtrema.valueXmYm),
                1e-6);
     }
     @Test
@@ -158,7 +159,7 @@ public class SimplexOptimizerNelderMeadTest {
                GoalType.MINIMIZE,
                100,
                Simplex.alongAxes(OptimTestUtils.point(2, 0.2, 1e-2)),
-               new PointValuePair(new double[] {f.xP, f.yM}, f.valueXpYm),
+               new PointValuePair(new double[] {FourExtrema.xP, FourExtrema.yM}, FourExtrema.valueXpYm),
                1e-6);
     }
     @Test
@@ -169,7 +170,7 @@ public class SimplexOptimizerNelderMeadTest {
                GoalType.MAXIMIZE,
                110,
                Simplex.alongAxes(OptimTestUtils.point(2, 0.2, 1e-2)),
-               new PointValuePair(new double[] {f.xP, f.yP}, f.valueXpYp),
+               new PointValuePair(new double[] {FourExtrema.xP, FourExtrema.yP}, FourExtrema.valueXpYp),
                1e-6);
     }