<< ampl_eval_spst_g_rc AMPL Toolbox ampl_eval_spst_w_rc >>

AMPL Toolbox >> AMPL Toolbox > ampl_eval_spst_g_val

ampl_eval_spst_g_val

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

Calling Sequence

val = ampl_eval_spst_g_val(asl, x)

Parameters

x

the point where we evaluate the gradient and the Jacobian

asl

a structure which handles the pointer to the problem

val

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

Description

Evaluate the values of the Jacobian for the position corresponding to the sparsity structure of the Jacobian of a given AMPL problem. Be careful, the "matrix" return corresponds to the transpose of the Jacobian. It has [nb_constr x nb_var] as dimensions.

Examples

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

[irow, jcol] = ampl_eval_spst_g_rc(asl, x0);
val          = ampl_eval_spst_g_val(asl, x0);

A = 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_g_rc AMPL Toolbox ampl_eval_spst_w_rc >>