Name

ampl_eval_sp_w — evaluate the sparse Hessian of the objective function and of the constraints of a given AMPL problem

Calling Sequence

W = ampl_eval_sp_w(asl, v)

Parameters

v

the dual variables

asl

a structure which handles the pointer to the problem

W

a matrix handling the Hessian (dimension: n_var x n_var)

Description

Evaluate the sparse Hessian of the objective function and of the constraintsof 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');

W   = ampl_evalw(asl, v);
spW = ampl_eval_sp_w(asl, v);

printf('Difference between Hessian and sparse Hessian = %f\n', norm(W, spW));

ampl_free(asl); // free the memory
 

See Also

ampl_init, ampl_free, ampl_evalf, ampl_evalg, ampl_get_size, ampl_write_sol, ampl_evalw

Authors

Yann COLLETTE