Minimization of a function using the safeguarded step-length algorithm of Gill and Murray [GSL]. More...
#include <min_quad_golden.h>
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
Definition at line 105 of file min_quad_golden.h.
Public Member Functions | |
| 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. | |
| virtual int | min_bkt (double &x2, double x1, double x3, double &fmin, func_t &func) |
Calculate the minimum fmin of func with x2 bracketed between x1 and x3. More... | |
| virtual const char * | type () |
| Return string denoting type ("min_quad_golden") | |
Public Member Functions inherited from o2scl::min_bkt_base< funct > | |
| virtual int | min (double &x, double &fmin, funct &func) |
Calculate the minimum min of func w.r.t 'x'. More... | |
| virtual int | min_bkt (double &x2, double x1, double x3, double &fmin, funct &func)=0 |
Calculate the minimum min of func with x2 bracketed between x1 and x3. More... | |
| virtual int | min_de (double &x, double &fmin, funct &func, funct &df) |
Calculate the minimum min of func with derivative dfunc w.r.t 'x'. More... | |
Public Member Functions inherited from o2scl::min_base< funct, funct > | |
| virtual int | print_iter (double x, double y, int iter, double value=0.0, double limit=0.0, std::string comment="") |
| Print out iteration information. More... | |
| virtual int | bracket (double &ax, double &bx, double &cx, double &fa, double &fb, double &fc, funct &func) |
Given interval (ax,bx), attempt to bracket a minimum for function func. More... | |
Public Attributes | |
| 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. | |
Public Attributes inherited from o2scl::min_bkt_base< funct > | |
| int | bracket_iter |
| The number of iterations for automatically bracketing a minimum (default 20) | |
Public Attributes inherited from o2scl::min_base< funct, funct > | |
| int | verbose |
| Output control. | |
| int | ntrial |
| Maximum number of iterations. | |
| double | tol_rel |
| The tolerance for the minimum function value. | |
| double | tol_abs |
| The tolerance for the location of the minimum. | |
| int | last_ntrial |
| The number of iterations used in the most recent minimization. | |
| int | bracket_iter |
| The number of iterations for automatically bracketing a minimum (default 20) | |
| bool | err_nonconv |
| If true, call the error handler if the routine does not "converge". | |
Protected Member Functions | |
| int | compute_f_values (func_t &func, double xminimum, double *fminimum, double xlower, double *flower, double xupper, double *fupper) |
| Compute the function values at the various points. | |
Protected Attributes | |
| func_t * | uf |
| The function. | |
| double | x_prev_small |
| double | f_prev_small |
| double | x_small |
| double | f_small |
| double | step_size |
| double | stored_step |
| double | prev_stored_step |
| size_t | num_iter |
| double | rel_err_val |
| double | abs_err_val |
| double | golden_mean |
| double | golden_ratio |
|
inlinevirtual |
Note that this algorithm requires that the initial guess already brackets the minimum, i.e.
,
and
. This is different from min_cern, where the initial value of the first parameter to min_cern::min_bkt() is ignored.
Definition at line 406 of file min_quad_golden.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).