18 F &&phi, M &&model,
const Scalar phi0,
19 const typename Linesearch<Scalar>::Options &ls_params, Scalar th_grad,
20 Scalar &d1, Scalar th_accept_step = 0.1, Scalar th_accept_neg_step = 2.0) {
21 const Scalar beta = ls_params.contraction_min;
24 Scalar dVreal, dVmodel;
25 constexpr Scalar eps = std::numeric_limits<Scalar>::epsilon();
29 if (atry < ls_params.alpha_min + eps) {
34 }
catch (const ::aligator::RuntimeError &) {
38 dVreal = phitry - phi0;
39 dVmodel = model(atry) - phi0;
42 if (std::abs(d1) < th_grad || dVreal <= th_accept_step * dVmodel) {
47 if (dVreal <= th_accept_neg_step * dVmodel) {
52 atry = std::max(atry, ls_params.alpha_min);
54 return {atry, phitry};
ALIGATOR_INLINE std::pair< Scalar, Scalar > fddp_goldstein_linesearch(F &&phi, M &&model, const Scalar phi0, const typename Linesearch< Scalar >::Options &ls_params, Scalar th_grad, Scalar &d1, Scalar th_accept_step=0.1, Scalar th_accept_neg_step=2.0)
The backtracking linesearch from FDDP (Mastalli et al).