solve method returns a zero x of the function f
in the given interval [a, b] to within a tolerance
2 eps abs(x) + t where eps is the relative accuracy and
t is the absolute accuracy.
The given interval must bracket the root.
The reference implementation is given in chapter 4 of
Algorithms for Minimization Without Derivatives, Richard P. Brent, Dover, 2002
BaseAbstractUnivariateSolver
| Modifier and Type | Field and Description |
|---|---|
| private static final double | DEFAULT_ABSOLUTE_ACCURACY
Default absolute accuracy. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | BrentSolver(double
Relative accuracy. relativeAccuracy, double Absolute accuracy. absoluteAccuracy)Construct a solver. |
| public | BrentSolver(double
Relative accuracy. relativeAccuracy, double Absolute accuracy. absoluteAccuracy, double Function value accuracy. functionValueAccuracy)Construct a solver. |
| Modifier and Type | Method and Description |
|---|---|
| private double | Returns: the value where the function is zero.Lower bound of the search interval. lo, double Higher bound of the search interval. hi, double Function value at the lower bound of the search interval. fLo, double Function value at the higher bound of the search interval. fHi)Search for a zero inside the provided interval.</it> |
| protected double | doSolve()
Implements abstract org. Method for implementing actual optimization algorithms in derived classes. |
| DEFAULT_ABSOLUTE_ACCURACY | back to summary |
|---|---|
| private static final double DEFAULT_ABSOLUTE_ACCURACY Default absolute accuracy. | |
| BrentSolver | back to summary |
|---|---|
| public BrentSolver() Construct a solver with default absolute accuracy (1e-6). | |
| BrentSolver | back to summary |
|---|---|
| public BrentSolver(double absoluteAccuracy) Construct a solver.
| |
| BrentSolver | back to summary |
|---|---|
| public BrentSolver(double relativeAccuracy, double absoluteAccuracy) Construct a solver.
| |
| BrentSolver | back to summary |
|---|---|
| public BrentSolver(double relativeAccuracy, double absoluteAccuracy, double functionValueAccuracy) Construct a solver.
| |
| brent | back to summary |
|---|---|
| private double brent(double lo, double hi, double fLo, double fHi) Search for a zero inside the provided interval. This implementation is based on the algorithm described at page 58 of the book Algorithms for Minimization Without Derivatives,
| |
| doSolve | back to summary |
|---|---|
| protected double doSolve() throws NoBracketingException, TooManyEvaluationsException, NumberIsTooLargeException Implements abstract org. Doc from org. Method for implementing actual optimization algorithms in derived classes.
| |