Algorithm-LBFGS
view release on metacpan or search on metacpan
finit = *f;
dgtest = param->ftol * dginit;
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;
#ifndef UV_MAX
# define UV_MAX PERL_ULONG_MAX
#endif
#endif
#ifndef IVSIZE
# ifdef LONGSIZE
# define IVSIZE LONGSIZE
# else
# define IVSIZE 4 /* A bold guess, but the best we can make. */
# endif
#endif
#ifndef UVTYPE
# define UVTYPE unsigned IVTYPE
#endif
#ifndef UVSIZE
# define UVSIZE IVSIZE
#endif
#endif
#ifndef PERL_MAGIC_backref
# define PERL_MAGIC_backref '<'
#endif
#ifndef PERL_MAGIC_ext
# define PERL_MAGIC_ext '~'
#endif
/* That's the best we can do... */
#ifndef SvPV_force_nomg
# define SvPV_force_nomg SvPV_force
#endif
#ifndef SvPV_nomg
# define SvPV_nomg SvPV
#endif
#ifndef sv_catpvn_nomg
# define sv_catpvn_nomg sv_catpvn
( run in 1.145 second using v1.01-cache-2.11-cpan-4e96b696675 )