<< AMPL Toolbox AMPL Toolbox ampl_eval_sp_g >>

AMPL Toolbox >> AMPL Toolbox > ampl_eval_hvcomp

ampl_eval_hvcomp

compute the Hessian of the Lagrangian times vector p of a given AMPL problem

Calling Sequence

hv = ampl_eval_hvcomp(asl, p[, OW[, Y]])

Parameters

asl

a structure which handles the pointer to the problem

p

a vector of size n_var

OW

an optional parameter which contains weights for the objective function. Must be of the same size as the number of objective functions

Y

an optional parameter which contains weights for the constraints. Must be of the same size as the number of constraints functions

hv

the Hessian of the Lagrangian times vector p.

Description

stores in hv (a full vector of length n_var) the Hessian of the Lagrangian times vector p. In other words, ampl_eval_hvcomp computes

where W is the Lagrangian Hessian.

where f and c correspond to the objective functions and constraints functions

W is evaluated at the point where the objective(s) and constraints were most recently computed

Normally one computes gradients before dealing with W, and if necessary, the gradient computing routines first recompute the objective(s) and constraints at the point specified in their argument lists. The Hessian computations use partial derivatives stored during the objective and constraint evaluations.

Examples

[asl, x0, bl, bu, v, cl, cu] = ampl_init('demos/data/ASL/ch03.nl');

W = ampl_evalw(asl, v);
HV = ampl_eval_hvcomp(asl, ones(x0));

ampl_free(asl); // free the memory

See Also

Authors


Report an issue
<< AMPL Toolbox AMPL Toolbox ampl_eval_sp_g >>