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 2021/10/03 15:27:42 UTC

[commons-numbers] branch master updated: Correct argument order for BrentSolver

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-numbers.git


The following commit(s) were added to refs/heads/master by this push:
     new 31a6970  Correct argument order for BrentSolver
31a6970 is described below

commit 31a6970423a6ded43c0839c182372dfefad3bffc
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Oct 3 16:27:39 2021 +0100

    Correct argument order for BrentSolver
---
 .../numbers/rootfinder/BrentSolverTest.java        | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/commons-numbers-rootfinder/src/test/java/org/apache/commons/numbers/rootfinder/BrentSolverTest.java b/commons-numbers-rootfinder/src/test/java/org/apache/commons/numbers/rootfinder/BrentSolverTest.java
index 7906c9a..0bc295b 100644
--- a/commons-numbers-rootfinder/src/test/java/org/apache/commons/numbers/rootfinder/BrentSolverTest.java
+++ b/commons-numbers-rootfinder/src/test/java/org/apache/commons/numbers/rootfinder/BrentSolverTest.java
@@ -35,8 +35,8 @@ class BrentSolverTest {
         // order derivative is zero, which means linar approximating methods will
         // still converge quadratically.
         final DoubleUnaryOperator func = new Sin();
-        final BrentSolver solver = new BrentSolver(DEFAULT_ABSOLUTE_ACCURACY,
-                                                   DEFAULT_RELATIVE_ACCURACY,
+        final BrentSolver solver = new BrentSolver(DEFAULT_RELATIVE_ACCURACY,
+                                                   DEFAULT_ABSOLUTE_ACCURACY,
                                                    DEFAULT_FUNCTION_ACCURACY);
 
         double result;
@@ -65,8 +65,8 @@ class BrentSolverTest {
         // The function has extrema (first derivative is zero) at 0.27195613 and 0.82221643,
         // intervals containing these values are harder for the solvers.
         final DoubleUnaryOperator func = new QuinticFunction();
-        final BrentSolver solver = new BrentSolver(DEFAULT_ABSOLUTE_ACCURACY,
-                                                   DEFAULT_RELATIVE_ACCURACY,
+        final BrentSolver solver = new BrentSolver(DEFAULT_RELATIVE_ACCURACY,
+                                                   DEFAULT_ABSOLUTE_ACCURACY,
                                                    DEFAULT_FUNCTION_ACCURACY);
 
         double result;
@@ -142,8 +142,8 @@ class BrentSolverTest {
     @Test
     void testTooManyCalls() {
         final DoubleUnaryOperator func = new QuinticFunction();
-        final BrentSolver solver = new BrentSolver(DEFAULT_ABSOLUTE_ACCURACY,
-                                                   DEFAULT_RELATIVE_ACCURACY,
+        final BrentSolver solver = new BrentSolver(DEFAULT_RELATIVE_ACCURACY,
+                                                   DEFAULT_ABSOLUTE_ACCURACY,
                                                    DEFAULT_FUNCTION_ACCURACY);
 
         // Very large bracket around 1 for testing fast growth behavior.
@@ -162,8 +162,8 @@ class BrentSolverTest {
     @Test
     void testRootEndpoints() {
         final DoubleUnaryOperator f = new Sin();
-        final BrentSolver solver = new BrentSolver(DEFAULT_ABSOLUTE_ACCURACY,
-                                                   DEFAULT_RELATIVE_ACCURACY,
+        final BrentSolver solver = new BrentSolver(DEFAULT_RELATIVE_ACCURACY,
+                                                   DEFAULT_ABSOLUTE_ACCURACY,
                                                    DEFAULT_FUNCTION_ACCURACY);
 
         // Endpoint is root.
@@ -183,8 +183,8 @@ class BrentSolverTest {
     @Test
     void testBadEndpoints() {
         final DoubleUnaryOperator f = new Sin();
-        final BrentSolver solver = new BrentSolver(DEFAULT_ABSOLUTE_ACCURACY,
-                                                   DEFAULT_RELATIVE_ACCURACY,
+        final BrentSolver solver = new BrentSolver(DEFAULT_RELATIVE_ACCURACY,
+                                                   DEFAULT_ABSOLUTE_ACCURACY,
                                                    DEFAULT_FUNCTION_ACCURACY);
         try {  // Bad interval.
             solver.findRoot(f, 1, -1);
@@ -212,8 +212,8 @@ class BrentSolverTest {
     @Test
     void testBadInitialGuess() {
         final DoubleUnaryOperator func = new QuinticFunction();
-        final BrentSolver solver = new BrentSolver(DEFAULT_ABSOLUTE_ACCURACY,
-                                                   DEFAULT_RELATIVE_ACCURACY,
+        final BrentSolver solver = new BrentSolver(DEFAULT_RELATIVE_ACCURACY,
+                                                   DEFAULT_ABSOLUTE_ACCURACY,
                                                    DEFAULT_FUNCTION_ACCURACY);
 
         try {
@@ -229,8 +229,8 @@ class BrentSolverTest {
     @Test
     void testInitialGuess() {
         final DoubleUnaryOperator func = new QuinticFunction();
-        final BrentSolver solver = new BrentSolver(DEFAULT_ABSOLUTE_ACCURACY,
-                                                   DEFAULT_RELATIVE_ACCURACY,
+        final BrentSolver solver = new BrentSolver(DEFAULT_RELATIVE_ACCURACY,
+                                                   DEFAULT_ABSOLUTE_ACCURACY,
                                                    DEFAULT_FUNCTION_ACCURACY);
         double result;
         MonitoredFunction f;