<< ampl_eval_spst_w_rc AMPL Toolbox ampl_evalf >>

AMPL Toolbox >> AMPL Toolbox > ampl_eval_spst_w_val

ampl_eval_spst_w_val

evaluate the values of the Hessian for the position corresponding to the sparsity structure of the Hessian of a given AMPL problem

Calling Sequence

val = ampl_eval_spst_w_val(asl, v)

Parameters

v

the dual variables

asl

a structure which handles the pointer to the problem

val

a vector of values of the Hessian evaluated at the positions corresponding to the sparsity structure of the Hessian

Description

Evaluate the values of the Hessian for the position corresponding to the sparsity structure of the Jacobian of a given AMPL problem. The Hessian is evaluated at the last point given to ampl_evalf.

Examples

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

[f, g] = ampl_evalf(asl, x0);

[irow, jcol] = ampl_eval_spst_w_rc(asl, v);
val          = ampl_eval_spst_w_val(asl, v);

W = sparse([irow, jcol],[val],[length(x0),length(cl)]); // Create a real sparse matrix

ampl_free(asl); // free the memory

See Also

Authors


Report an issue
<< ampl_eval_spst_w_rc AMPL Toolbox ampl_evalf >>