commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1157185 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/analysis/solvers/BaseSecantSolver.java test/java/org/apache/commons/math/analysis/solvers/RegulaFalsiSolverTest.java
Date Fri, 12 Aug 2011 16:48:27 GMT
Author: erans
Date: Fri Aug 12 16:48:26 2011
New Revision: 1157185

URL: http://svn.apache.org/viewvc?rev=1157185&view=rev
Log:
MATH-631
Reverted to original behaviour.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BaseSecantSolver.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/RegulaFalsiSolverTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BaseSecantSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BaseSecantSolver.java?rev=1157185&r1=1157184&r2=1157185&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BaseSecantSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BaseSecantSolver.java
Fri Aug 12 16:48:26 2011
@@ -183,14 +183,7 @@ public abstract class BaseSecantSolver
                     f0 *= f1 / (f1 + fx);
                     break;
                 case REGULA_FALSI:
-                    if (x == x1) {
-                        final double delta = FastMath.max(rtol * FastMath.abs(x1),
-                                                          atol);
-                        // Update formula cannot make any progress: Update the
-                        // search interval.
-                        x0 = 0.5 * (x0 + x1 - delta);
-                        f0 = computeObjectiveValue(x0);
-                    }
+                    // Nothing.
                     break;
                 default:
                     // Should never happen.

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/RegulaFalsiSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/RegulaFalsiSolverTest.java?rev=1157185&r1=1157184&r2=1157185&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/RegulaFalsiSolverTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/RegulaFalsiSolverTest.java
Fri Aug 12 16:48:26 2011
@@ -18,6 +18,7 @@
 package org.apache.commons.math.analysis.solvers;
 
 import org.apache.commons.math.analysis.UnivariateRealFunction;
+import org.apache.commons.math.exception.TooManyEvaluationsException;
 import org.junit.Test;
 import org.junit.Assert;
 
@@ -40,7 +41,7 @@ public final class RegulaFalsiSolverTest
         return new int[] {3, 7, 8, 19, 18, 11, 67, 55, 288, 151, -1};
     }
 
-    @Test
+    @Test(expected=TooManyEvaluationsException.class)
     public void testIssue631() {
         final UnivariateRealFunction f = new UnivariateRealFunction() {
                 /** {@inheritDoc} */



Mime
View raw message