linesearch.m

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Performs a bracket section line search to find an appropriate optimisation step length in the specified direction. Based on fminlbfgs.m code from D. Kroon, University of Twente (Nov 2010). This function assumes cheap gradients.

Syntax

    [alpha,fx_1,gfx_1,exitflag,data]=linesearch(spin_system,cost_function,d_0,x_0,fx_0,gfx_0,data)


Arguments

   cost_function  - objective function handle

d_0    - proposed step vector

x_0    - current point

fx_0   - function value at the current point

gfx_0  - gradient at the current point

data   - diagnostic data structure


Returns

   alpha     - optimum step length multiplier

fx_1      - function value at the resulting point

gfx_1     - gradient at the resulting point

exitflag  - termination message

data      - updated disgnostic data structure