FUNC - Type of function to solve.public interface BracketedUnivariateSolver<FUNC extends UnivariateFunction> extends BaseUnivariateSolver<FUNC>
(univariate real) root-finding
algorithms that maintain a bracketed solution. There are several advantages
to having such root-finding algorithms:
allowed solutions. Other root-finding
algorithms can usually only guarantee that the solution (the root that
was found) is around the actual root.For backwards compatibility, all root-finding algorithms must have
ANY_SIDE as default for the allowed
solutions.
AllowedSolution| Modifier and Type | Interface and Description |
|---|---|
static class |
BracketedUnivariateSolver.Interval
An interval of a function that brackets a root.
|
| Modifier and Type | Method and Description |
|---|---|
double |
solve(int maxEval,
FUNC f,
double min,
double max,
AllowedSolution allowedSolution)
Solve for a zero in the given interval.
|
double |
solve(int maxEval,
FUNC f,
double min,
double max,
double startValue,
AllowedSolution allowedSolution)
Solve for a zero in the given interval, start at
startValue. |
default BracketedUnivariateSolver.Interval |
solveInterval(int maxEval,
FUNC f,
double min,
double max)
Solve for a zero in the given interval and return a tolerance interval surrounding
the root.
|
BracketedUnivariateSolver.Interval |
solveInterval(int maxEval,
FUNC f,
double min,
double max,
double startValue)
Solve for a zero in the given interval and return a tolerance interval surrounding
the root.
|
getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMaxEvaluations, getRelativeAccuracy, solve, solve, solvedouble solve(int maxEval,
FUNC f,
double min,
double max,
AllowedSolution allowedSolution)
maxEval - Maximum number of evaluations.f - Function to solve.min - Lower bound for the interval.max - Upper bound for the interval.allowedSolution - The kind of solutions that the root-finding algorithm may
accept as solutions.MathIllegalArgumentException - if the arguments do not satisfy the requirements specified by the solver.MathIllegalStateException - if
the allowed number of evaluations is exceeded.double solve(int maxEval,
FUNC f,
double min,
double max,
double startValue,
AllowedSolution allowedSolution)
startValue.
A solver may require that the interval brackets a single zero root.
Solvers that do require bracketing should be able to handle the case
where one of the endpoints is itself a root.maxEval - Maximum number of evaluations.f - Function to solve.min - Lower bound for the interval.max - Upper bound for the interval.startValue - Start value to use.allowedSolution - The kind of solutions that the root-finding algorithm may
accept as solutions.MathIllegalArgumentException - if the arguments do not satisfy the requirements specified by the solver.MathIllegalStateException - if
the allowed number of evaluations is exceeded.default BracketedUnivariateSolver.Interval solveInterval(int maxEval, FUNC f, double min, double max) throws MathIllegalArgumentException, MathIllegalStateException
It is required that the starting interval brackets a root or that the function value at either end point is 0.0.
maxEval - Maximum number of evaluations.f - Function to solve.min - Lower bound for the interval.max - Upper bound for the interval. Must be greater than min.absolute
accuracy + max(ta, tb) * relative accuracy) or (
max(|f(ta)|, |f(tb)|) <= BaseUnivariateSolver.getFunctionValueAccuracy()) or there are no
floating point numbers between ta and tb. The width of the interval (tb - ta) may
be zero.MathIllegalArgumentException - if the arguments do not satisfy the
requirements specified by the solver.MathIllegalStateException - if the allowed number of evaluations is
exceeded.BracketedUnivariateSolver.Interval solveInterval(int maxEval, FUNC f, double min, double max, double startValue) throws MathIllegalArgumentException, MathIllegalStateException
It is required that the starting interval brackets a root or that the function value at either end point is 0.0.
maxEval - Maximum number of evaluations.startValue - start value to use. Must be in the interval [min, max].f - Function to solve.min - Lower bound for the interval.max - Upper bound for the interval. Must be greater than min.absolute
accuracy + max(ta, tb) * relative accuracy) or (
max(|f(ta)|, |f(tb)|) <= BaseUnivariateSolver.getFunctionValueAccuracy()) or there are no
floating point numbers between ta and tb. The width of the interval (tb - ta) may
be zero.MathIllegalArgumentException - if the arguments do not satisfy the
requirements specified by the solver.MathIllegalStateException - if the allowed number of evaluations is
exceeded.Copyright © 2016–2017 Hipparchus.org. All rights reserved.