Class BrentMinimizer.Solution
- java.lang.Object
-
- dev.nm.root.univariate.bracketsearch.BracketSearchMinimizer.Solution
-
- dev.nm.root.univariate.bracketsearch.BrentMinimizer.Solution
-
- All Implemented Interfaces:
UnivariateMinimizer.Solution
,MinimizationSolution<Double>
- Enclosing class:
- BrentMinimizer
public class BrentMinimizer.Solution extends BracketSearchMinimizer.Solution
This is the solution to a Brent's univariate optimization.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
init(double xmin, double fmin)
Initializes the algorithm states with initial \(x_{min}\) and \(f_{min}\) before iterations.protected boolean
isMinFound()
the convergence criteriondouble
search(double lower, double upper)
Search for a minimum within the interval [lower, upper].double
search(double lower, double initial, double upper)
Search for a minimum within the interval [lower, upper].protected void
updateStates()
Update the bracketing interval and the best min found so far.protected double
xnext()
Compute the next best estimate within the bracketing interval.-
Methods inherited from class dev.nm.root.univariate.bracketsearch.BracketSearchMinimizer.Solution
isBracketing, minimizer, minimum
-
-
-
-
Method Detail
-
search
public double search(double lower, double initial, double upper)
Description copied from interface:UnivariateMinimizer.Solution
Search for a minimum within the interval [lower, upper].- Specified by:
search
in interfaceUnivariateMinimizer.Solution
- Overrides:
search
in classBracketSearchMinimizer.Solution
- Parameters:
lower
- the lower bound for the bracketing interval which contains a minimuminitial
- an initial guessupper
- the upper bound for the bracketing interval which contains a minimum- Returns:
- an approximate minimizer
-
search
public double search(double lower, double upper)
Description copied from interface:UnivariateMinimizer.Solution
Search for a minimum within the interval [lower, upper].- Parameters:
lower
- the lower bound for the bracketing interval which contains a minimumupper
- the upper bound for the bracketing interval which contains a minimum- Returns:
- an approximate minimizer
-
init
protected void init(double xmin, double fmin)
Description copied from class:BracketSearchMinimizer.Solution
Initializes the algorithm states with initial \(x_{min}\) and \(f_{min}\) before iterations. The function value of the initial minimum point is evaluated in this class. If the subclass algorithm needs the computed function value, it can override this method to avoid an unnecessary evaluation. By default, the implementation is empty. If the subclass algorithm does not need to initialize states from the function value, no overriding is needed.- Overrides:
init
in classBracketSearchMinimizer.Solution
- Parameters:
xmin
- the initial minimum pointfmin
- the function value of the initial minimum point
-
isMinFound
protected boolean isMinFound()
the convergence criterion The search stops when-
\((x_u - x_l) < 2 \left | x \right | \varepsilon \)
\(\left | \rm xmin - \rm mid \right | < \left | x \right |
\varepsilon\)
- Specified by:
isMinFound
in classBracketSearchMinimizer.Solution
- Returns:
true
if the minimum is found- See Also:
- "Chapter 10.3, Numerical Recipes."
-
xnext
protected double xnext()
Description copied from class:BracketSearchMinimizer.Solution
Compute the next best estimate within the bracketing interval. A particular univariate minimization algorithm implements the logic in this method.- Specified by:
xnext
in classBracketSearchMinimizer.Solution
- Returns:
- the next best guess of the minimizer
-
updateStates
protected void updateStates()
Description copied from class:BracketSearchMinimizer.Solution
Update the bracketing interval and the best min found so far.- Overrides:
updateStates
in classBracketSearchMinimizer.Solution
-
-