ampl_eval_spst_w_rc — evaluate the sparsity structure of the Hessian of the constraints plus the objective function of a given AMPL problem
[irow, jcol] = ampl_eval_spst_w_rc(asl, v)
the dual variables
a structure which handles the pointer to the problem
a list of indexes corresponding to the lines of the non null elements of the Hessian. The sparsity structure of the Hessian is not supposed to change when x varies
a list of indexes corresponding to the columns of the non null elements of the Hessian. The sparsity structure of the Hessian is not supposed to change when x varies
Evaluate the sparsity structure of the Hessian of the constraints and the objective function of a given AMPL problem. The Hessian is evaluated at the last point given to ampl_evalf.
[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