Optimization: principles and algorithms, by Michel Bierlaire
initLineSearch.m
Go to the documentation of this file.
1 %> \file
2 %> Algorithm 11.2: Initialization of the exact line search. Implementation of algorithm 11.2 of \cite Bier15-book
3 %>
4 %> @author <a href="http://people.epfl.ch/michel.bierlaire">Michel Bierlaire</a>
5 %> @date Fri Mar 20 17:24:41 2015
6 %> @ingroup Algorithms
7 %> @ingroup chap11
8 
9 %> \note Called by \ref quadraticInterpolation
10 
11 %> Calculate \f$a\f$, \f$b\f$ and \f$c\f$ such that \f$a < b < c\f$, \f$h(a) > h(b)\f$ and \f$h(c) > h(b)\f$
12 %> @param obj the name of the Octave function defining h(x)
13 %> @param delta value such that \f$h(\delta) < h(0)\f$.
14 %> @return [a,b,c]
15 function [a,ha,b,hb,c,hc] = initLineSearch(obj,delta)
16  xkm1 = 0 ;
17  hxkm1 = feval(obj,xkm1) ;
18  xk = delta ;
19  hxk = feval(obj,xk) ;
20  do
21  xkm2 = xkm1 ;
22  hxkm2 = hxkm1 ;
23  xkm1 = xk ;
24  hxkm1 = hxk ;
25  xk = 2.0 * xk ;
26  hxk = feval(obj,xk) ;
27  until(hxk > hxkm1)
28  a = xkm2 ;
29  ha = hxkm2 ;
30  b = xkm1 ;
31  hb = hxkm1 ;
32  c = xk ;
33  hc = hxk ;
34 endfunction
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 .
Copyright 2015-2016 Michel Bierlaire