SyTen

◆ linesearch()

template<typename Hp >
SRDef syten::GradientOpt::linesearch ( Hp  h_hp,
SRDef  lower,
SRDef  upper,
Index const  max_steps 
)

Attempt at a bisecting line search.

Template Parameters
HpType of the function returning f(x-a*g) and f'(x-a*g) with respect to a
Parameters
h_hpfunction object evaluating f(x-a*g) and f'(x-a*g)
lowerlower end of the line search
upperupper end of the line search
max_stepsmaximal number of steps
Returns
a step size a minimising f(x-a*g) if it is found in the range [lower,upper] or NAN if the initial condition is not fulfilled, i.e. f'(x-a*g) is not negative at a=0 or zero if no good step size was found.

References syten::abs(), and std::tie().

Referenced by gradient_descent_linesearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: