Class BracketSearchMinimizer.Solution

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected UnivariateRealFunction f  
      protected double fmin
      the best minimum found so far
      protected double fnext
      the next guess of the minimum
      protected int iter
      the current iteration count
      protected double xl
      the lower bound of the bracketing interval
      protected double xmin
      the best minimizer found so far
      protected double xnext
      the next best guess of the minimizer
      protected double xu
      the upper bound of the bracketing interval
    • Field Detail

      • fmin

        protected double fmin
        the best minimum found so far
      • fnext

        protected double fnext
        the next guess of the minimum
      • xl

        protected double xl
        the lower bound of the bracketing interval
      • xu

        protected double xu
        the upper bound of the bracketing interval
      • xmin

        protected double xmin
        the best minimizer found so far
      • xnext

        protected double xnext
        the next best guess of the minimizer
      • iter

        protected int iter
        the current iteration count
    • Method Detail

      • init

        protected void init​(double xmin,
                            double fmin)
        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.
        Parameters:
        xmin - the initial minimum point
        fmin - the function value of the initial minimum point
      • isMinFound

        protected abstract boolean isMinFound()
        the convergence criterion
        Returns:
        true if the current min value is considered to have converged within a threshold
      • xnext

        protected abstract double xnext()
        Compute the next best estimate within the bracketing interval. A particular univariate minimization algorithm implements the logic in this method.
        Returns:
        the next best guess of the minimizer
      • 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 interface UnivariateMinimizer.Solution
        Parameters:
        lower - the lower bound for the bracketing interval which contains a minimum
        initial - an initial guess
        upper - the upper bound for the bracketing interval which contains a minimum
        Returns:
        an approximate minimizer
      • updateStates

        protected void updateStates()
        Update the bracketing interval and the best min found so far.
      • isBracketing

        protected boolean isBracketing​(double xl,
                                       double x,
                                       double xu)
        Check whether [xl, xu] is bracketing x.
        Parameters:
        xl - the lower bound of the bracketing interval
        x - a guess of the minimizer
        xu - the upper bound of the bracketing interval
        Returns:
        true if fx < fl && fx < fu