public class BrentSolver extends UnivariateRealSolverImpl
The function should be continuous but not necessarily smooth.
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_ABSOLUTE_ACCURACY
Default absolute accuracy
|
static int |
DEFAULT_MAXIMUM_ITERATIONS
Default maximum number of iterations
|
Constructor and Description |
---|
BrentSolver()
Deprecated.
in 2.2 (to be removed in 3.0).
|
BrentSolver(double absoluteAccuracy)
Construct a solver with the given absolute accuracy.
|
BrentSolver(int maximumIterations,
double absoluteAccuracy)
Contstruct a solver with the given maximum iterations and absolute accuracy.
|
BrentSolver(UnivariateRealFunction f)
Deprecated.
as of 2.0 the function to solve is passed as an argument
to the
solve(UnivariateRealFunction, double, double) or
UnivariateRealSolver.solve(UnivariateRealFunction, double, double, double)
method. |
Modifier and Type | Method and Description |
---|---|
double |
solve(double min,
double max)
Deprecated.
|
double |
solve(double min,
double max,
double initial)
Deprecated.
|
double |
solve(int maxEval,
UnivariateRealFunction f,
double min,
double max)
Find a zero in the given interval.
|
double |
solve(int maxEval,
UnivariateRealFunction f,
double min,
double max,
double initial)
Find a zero in the given interval with an initial guess.
|
double |
solve(UnivariateRealFunction f,
double min,
double max)
Deprecated.
in 2.2 (to be removed in 3.0).
|
double |
solve(UnivariateRealFunction f,
double min,
double max,
double initial)
Deprecated.
in 2.2 (to be removed in 3.0).
|
getFunctionValue, getFunctionValueAccuracy, getResult, resetFunctionValueAccuracy, setFunctionValueAccuracy
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
public static final double DEFAULT_ABSOLUTE_ACCURACY
public static final int DEFAULT_MAXIMUM_ITERATIONS
@Deprecated public BrentSolver(UnivariateRealFunction f)
solve(UnivariateRealFunction, double, double)
or
UnivariateRealSolver.solve(UnivariateRealFunction, double, double, double)
method.f
- function to solve.@Deprecated public BrentSolver()
public BrentSolver(double absoluteAccuracy)
absoluteAccuracy
- lower bound for absolute accuracy of solutions returned by the solverpublic BrentSolver(int maximumIterations, double absoluteAccuracy)
maximumIterations
- maximum number of iterationsabsoluteAccuracy
- lower bound for absolute accuracy of solutions returned by the solver@Deprecated public double solve(double min, double max) throws MaxIterationsExceededException, FunctionEvaluationException
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.
min
- the lower bound for the interval.max
- the upper bound for the interval.FunctionEvaluationException
- if an error occurs evaluating the functionMaxIterationsExceededException
@Deprecated public double solve(double min, double max, double initial) throws MaxIterationsExceededException, FunctionEvaluationException
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.
min
- the lower bound for the interval.max
- the upper bound for the interval.initial
- the start value to useFunctionEvaluationException
- if an error occurs evaluating the functionMaxIterationsExceededException
@Deprecated public double solve(UnivariateRealFunction f, double min, double max, double initial) throws MaxIterationsExceededException, FunctionEvaluationException
Throws IllegalArgumentException
if the values of the
function at the three points have the same sign (note that it is
allowed to have endpoints with the same sign if the initial point has
opposite sign function-wise).
f
- function to solve.min
- the lower bound for the interval.max
- the upper bound for the interval.initial
- the start value to use (must be set to min if no
initial point is known).MaxIterationsExceededException
- the maximum iteration count is exceededFunctionEvaluationException
- if an error occurs evaluating the functionjava.lang.IllegalArgumentException
- if initial is not between min and max
(even if it is a root)public double solve(int maxEval, UnivariateRealFunction f, double min, double max, double initial) throws MaxIterationsExceededException, FunctionEvaluationException
Throws IllegalArgumentException
if the values of the
function at the three points have the same sign (note that it is
allowed to have endpoints with the same sign if the initial point has
opposite sign function-wise).
solve
in class UnivariateRealSolverImpl
f
- function to solve.min
- the lower bound for the interval.max
- the upper bound for the interval.initial
- the start value to use (must be set to min if no
initial point is known).maxEval
- Maximum number of evaluations.MaxIterationsExceededException
- the maximum iteration count is exceededFunctionEvaluationException
- if an error occurs evaluating the functionjava.lang.IllegalArgumentException
- if initial is not between min and max
(even if it is a root)@Deprecated public double solve(UnivariateRealFunction f, double min, double max) throws MaxIterationsExceededException, FunctionEvaluationException
Requires that the values of the function at the endpoints have opposite
signs. An IllegalArgumentException
is thrown if this is not
the case.
f
- the function to solvemin
- the lower bound for the interval.max
- the upper bound for the interval.MaxIterationsExceededException
- if the maximum iteration count is exceededFunctionEvaluationException
- if an error occurs evaluating the functionjava.lang.IllegalArgumentException
- if min is not less than max or the
signs of the values of the function at the endpoints are not oppositespublic double solve(int maxEval, UnivariateRealFunction f, double min, double max) throws MaxIterationsExceededException, FunctionEvaluationException
Requires that the values of the function at the endpoints have opposite
signs. An IllegalArgumentException
is thrown if this is not
the case.
solve
in class UnivariateRealSolverImpl
f
- the function to solvemin
- the lower bound for the interval.max
- the upper bound for the interval.maxEval
- Maximum number of evaluations.MaxIterationsExceededException
- if the maximum iteration count is exceededFunctionEvaluationException
- if an error occurs evaluating the functionjava.lang.IllegalArgumentException
- if min is not less than max or the
signs of the values of the function at the endpoints are not oppositesCopyright © 2010 - 2020 Adobe. All Rights Reserved