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 voidinit(double xmin, double fmin)Initializes the algorithm states with initial \(x_{min}\) and \(f_{min}\) before iterations.protected booleanisMinFound()the convergence criteriondoublesearch(double lower, double upper)Search for a minimum within the interval [lower, upper].doublesearch(double lower, double initial, double upper)Search for a minimum within the interval [lower, upper].protected voidupdateStates()Update the bracketing interval and the best min found so far.protected doublexnext()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.SolutionSearch for a minimum within the interval [lower, upper].- Specified by:
searchin interfaceUnivariateMinimizer.Solution- Overrides:
searchin 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.SolutionSearch 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.SolutionInitializes 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:
initin 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:
isMinFoundin classBracketSearchMinimizer.Solution- Returns:
trueif the minimum is found- See Also:
- "Chapter 10.3, Numerical Recipes."
-
xnext
protected double xnext()
Description copied from class:BracketSearchMinimizer.SolutionCompute the next best estimate within the bracketing interval. A particular univariate minimization algorithm implements the logic in this method.- Specified by:
xnextin classBracketSearchMinimizer.Solution- Returns:
- the next best guess of the minimizer
-
updateStates
protected void updateStates()
Description copied from class:BracketSearchMinimizer.SolutionUpdate the bracketing interval and the best min found so far.- Overrides:
updateStatesin classBracketSearchMinimizer.Solution
-
-