Author: luc
Date: Mon Mar 1 19:38:34 2010
New Revision: 917668
URL: http://svn.apache.org/viewvc?rev=917668&view=rev
Log:
Fixed too stringent interval check in Brent solver:
initial guess is now allowed to be at either interval end
JIRA: MATH-347
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BrentSolver.java
commons/proper/math/trunk/src/site/xdoc/changes.xml
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BrentSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BrentSolver.java?rev=917668&r1=917667&r2=917668&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BrentSolver.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/BrentSolver.java
Mon Mar 1 19:38:34 2010
@@ -100,7 +100,11 @@
throws MaxIterationsExceededException, FunctionEvaluationException {
clearResult();
- verifySequence(min, initial, max);
+ if ((initial < min) || (initial > max)) {
+ throw MathRuntimeException.createIllegalArgumentException(
+ "invalid interval, initial value parameters: lower={0}, initial={1}, upper={2}",
+ min, initial, max);
+ }
// return the initial guess if it is good enough
double yInitial = f.value(initial);
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=917668&r1=917667&r2=917668&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/changes.xml Mon Mar 1 19:38:34 2010
@@ -39,6 +39,10 @@
</properties>
<body>
<release version="2.1" date="TBD" description="TBD">
+ <action dev="luc" type="fix" issue="MATH-347" >
+ Fixed too stringent interval check in Brent solver: initial guess is now
+ allowed to be at either interval end
+ </action>
<action dev="luc" type="add" >
Added a way to compute both the final state in an Initial Value Problem (IVP)
for Ordinary Differential Equations (ODE) and its derivatives with respect to
|