Algorithm-LBFGS
view release on metacpan or search on metacpan
width = param->max_step - param->min_step;
prev_width = 2.0 * width;
/* Copy the value of x to the work area. */
veccpy(wa, x, n);
/*
The variables stx, fx, dgx contain the values of the step,
function, and directional derivative at the best step.
The variables sty, fy, dgy contain the value of the step,
function, and derivative at the other endpoint of
the interval of uncertainty.
The variables stp, f, dg contain the values of the step,
function, and derivative at the current step.
*/
stx = sty = 0.;
fx = fy = finit;
dgx = dgy = dginit;
for (;;) {
/*
a = (u) - (v); \
(qm) = (v) + (dv) / ((dv) - (du)) * a;
/**
* Update a safeguarded trial value and interval for line search.
*
* The parameter x represents the step with the least function value.
* The parameter t represents the current step. This function assumes
* that the derivative at the point of x in the direction of the step.
* If the bracket is set to true, the minimizer has been bracketed in
* an interval of uncertainty with endpoints between x and y.
*
* @param x The pointer to the value of one endpoint.
* @param fx The pointer to the value of f(x).
* @param dx The pointer to the value of f'(x).
* @param y The pointer to the value of another endpoint.
* @param fy The pointer to the value of f(y).
* @param dy The pointer to the value of f'(y).
* @param t The pointer to the value of the trial value, t.
* @param ft The pointer to the value of f(t).
* @param dt The pointer to the value of f'(t).
* @param tmin The minimum value for the trial value, t.
* @param tmax The maximum value for the trial value, t.
* @param brackt The pointer to the predicate if the trial value is
* bracketed.
* @retval int Status value. Zero indicates a normal termination.
( run in 0.460 second using v1.01-cache-2.11-cpan-49f99fa48dc )