commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r940565 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java site/xdoc/changes.xml test/java/org/apache/commons/math/analysis/solvers/BisectionSolverTest.java
Date Mon, 03 May 2010 18:42:28 GMT
Author: luc
Date: Mon May  3 18:42:27 2010
New Revision: 940565

URL: http://svn.apache.org/viewvc?rev=940565&view=rev
Log:
Fix NullPointerException in BisectionSolver.solve(f, min, max, initial)
JIRA: MATH-369

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
    commons/proper/math/trunk/src/site/xdoc/changes.xml
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/BisectionSolverTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java?rev=940565&r1=940564&r2=940565&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java
Mon May  3 18:42:27 2010
@@ -69,7 +69,7 @@ public class BisectionSolver extends Uni
     /** {@inheritDoc} */
     public double solve(final UnivariateRealFunction f, double min, double max, double initial)
         throws MaxIterationsExceededException, FunctionEvaluationException {
-        return solve(min, max);
+        return solve(f, min, max);
     }
 
     /** {@inheritDoc} */

Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/changes.xml?rev=940565&r1=940564&r2=940565&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/changes.xml Mon May  3 18:42:27 2010
@@ -52,6 +52,9 @@ The <action> type attribute can be add,u
     If the output is not quite correct, check for invisible trailing spaces!
      -->
     <release version="2.2" date="TBD" description="TBD">
+      <action dev="luc" type="fix" issue="MATH-369" due-to="Sasun Pundev">
+        Fix NullPointerException in BisectionSolver.solve(f, min, max, initial)
+      </action>
     </release>
     <release version="2.1" date="2010-04-02" description="
 This is primarily a maintenance release, but it also includes new features and enhancements.

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/BisectionSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/BisectionSolverTest.java?rev=940565&r1=940564&r2=940565&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/BisectionSolverTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/BisectionSolverTest.java
Mon May  3 18:42:27 2010
@@ -95,6 +95,12 @@ public final class BisectionSolverTest e
         assertTrue(solver.getIterationCount() > 0);
     }
 
+    public void testMath369() throws Exception {
+        UnivariateRealFunction f = new SinFunction();
+        UnivariateRealSolver solver = new BisectionSolver();
+        assertEquals(Math.PI, solver.solve(f, 3.0, 3.2, 3.1), solver.getAbsoluteAccuracy());
+    }
+
     /**
      *
      */



Mime
View raw message