2 %> Algorithm 11.3: Exact line search
using quadratic interpolation. Implementation of algorithm 11.3 of \cite Bier15-book
4 %> @author <a href=
"http://people.epfl.ch/michel.bierlaire">Michel Bierlaire</a>
5 %> @date Fri Mar 20 17:21:38 2015
9 %> \note Tested with \ref runQuadraticInterpolation.m
12 %> Find a local minimum of the problem \f$\min_{x \geq 0} h(x)\f$, where \f$h:\mathbb{R}\to\mathbb{R}\f$.
13 %> @param obj the name of the Octave
function defining h(x)
14 %> @param delta the parameter to initialize the line search. Must be such that \f$ h(\delta) < h(0)\f$.
15 %> @param eps tolerance.
16 %> @
return xstar the local minimum
21 beta1 = ((b-c)*ha+(c-a)*hb+(a-b)*hc)/((a-b)*(c-a)*(c-b)) ;
24 xplus = (beta1 * (a+b) - beta2 - beta3) / (2 * beta1) ;
27 xplus = b + eps / 2.0 ;
29 xplus = b - eps / 2.0 ;
32 hxplus = feval(obj,xplus) ;
33 printf(
"%d\t%.6g\t%.6g\t%.6g\t%.6g\t%.6g\t%.6g\t%.6g\t%.6g\n",k,a,b,c,xplus,ha,hb,hc,hxplus)
58 until (s1 <= eps || s2 <= eps)
60 printf(
"%d\t%.6g\t%.6g\t%.6g\t%.6g\t%.6g\t%.6g\t%.6g\t%.6g\n",k,a,b,c,xplus,ha,hb,hc,hxplus)
function quadraticInterpolation(in obj, in delta, in eps)
Find a local minimum of the problem , where .
function initLineSearch(in obj, in delta)
Calculate , and such that , and .