Fixed too stringent interval check in Brent solver:

initial guess is now allowed to be at either interval end
JIRA: MATH-347

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@917668 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2010-03-01 19:38:34 +00:00
parent 46abbb40e1
commit 57c45aca3d
2 changed files with 9 additions and 1 deletions

View File

@ -100,7 +100,11 @@ public class BrentSolver extends UnivariateRealSolverImpl {
throws MaxIterationsExceededException, FunctionEvaluationException { throws MaxIterationsExceededException, FunctionEvaluationException {
clearResult(); 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 // return the initial guess if it is good enough
double yInitial = f.value(initial); double yInitial = f.value(initial);

View File

@ -39,6 +39,10 @@ The <action> type attribute can be add,update,fix,remove.
</properties> </properties>
<body> <body>
<release version="2.1" date="TBD" description="TBD"> <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" > <action dev="luc" type="add" >
Added a way to compute both the final state in an Initial Value Problem (IVP) 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 for Ordinary Differential Equations (ODE) and its derivatives with respect to