Class min_quad_golden (o2scl)¶
-
template<class
func_t
= funct>
classo2scl
::
min_quad_golden
: public o2scl::min_bkt_base<funct>¶ Minimization of a function using the safeguarded step-length algorithm of Gill and Murray [GSL].
This class is unfinished.
Documentation from GSL:
This algorithm performs univariate minimization (i.e., line search). It requires only objective function values g(x) to compute the minimum. The algorithm maintains an interval of uncertainty [a,b] and a point x in the interval [a,b] such that a < x < b, and g(a) > g(x) and g(x) < g(b). The algorithm also maintains the three points with the smallest objective values x, v and w such that g(x) < g(v) < g(w). The algorithm terminates when max( x-a, b-x ) < 2(r |x| + t) where r and t are small positive reals. At a given iteration, the algorithm first fits a quadratic through the three points (x, g(x)), (v, g(v)) and (w, g(w)) and computes the location of the minimum u of the resulting quadratic. If u is in the interval [a,b] then g(u) is computed. If u is not in the interval [a,b], and either v < x and w < x, or v > x and w > x (i.e., the quadratic is extrapolating), then a point u' is computed using a safeguarding procedure and g(u') is computed. If u is not in the interval [a,b], and the quadratic is not extrapolating, then a point u'' is computed using approximate golden section and g(u'') is computed. After evaluating g() at the appropriate new point, a, b, x, v, and w are updated and the next iteration is performed. The algorithm is based on work presented in the following references. Algorithms for Minimization without derivatives Richard Brent Prentice-Hall Inc., Englewood Cliffs, NJ, 1973 Safeguarded Steplength Algorithms for Optimization using Descent Methods Philip E. Gill and Walter Murray Division of Numerical Analysis and Computing National Physical Laboratory, Teddington, United Kingdom NPL Report NAC 37, August 1974
- Idea for Future:
Take common elements of this and min_brent and move to a generic GSL minimizer type?
Public Functions
-
min_quad_golden
()¶
-
~min_quad_golden
()¶
-
int
set
(func_t &func, double xmin, double lower, double upper)¶ Set the function and the initial bracketing interval.
-
int
set_with_values
(func_t &func, double xmin, double fmin, double lower, double fl, double upper, double fu)¶ Set the function, the initial bracketing interval, and the corresponding function values.
-
int
iterate
()¶ Perform an iteration.
-
int
min_bkt
(double &x2, double x1, double x3, double &fmin, func_t &func)¶ Calculate the minimum
fmin
offunc
withx2
bracketed betweenx1
andx3
.Note that this algorithm requires that the initial guess already brackets the minimum, i.e. \( x_1<x_2<x_3 \), \( f(x_1)>f(x_2) \) and \( f(x_3)>f(x_2) \). This is different from min_cern, where the initial value of the first parameter to min_cern::min_bkt() is ignored.
-
const char *
type
()¶ Return string denoting type (“min_quad_golden”)
Public Members
-
double
x_minimum
¶ Location of minimum.
-
double
x_lower
¶ Lower bound.
-
double
x_upper
¶ Upper bound.
-
double
f_minimum
¶ Minimum value.
-
double
f_lower
¶ Value at lower bound.
-
double
f_upper
¶ Value at upper bound.
Protected Functions