Algorithm-LBFGS

 view release on metacpan or  search on metacpan

lbfgs.c  view on Meta::CPAN

646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
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 (;;) {
        /*

lbfgs.c  view on Meta::CPAN

906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
        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.585 second using v1.01-cache-2.11-cpan-49f99fa48dc )