<< ampl_eval_sp_w AMPL Toolbox ampl_eval_spst_g_val >>

AMPL Toolbox >> AMPL Toolbox > ampl_eval_spst_g_rc

ampl_eval_spst_g_rc

evaluate the sparsity structure of the Jacobian of the constraints of a given AMPL problem

Calling Sequence

[irow, jcol] = ampl_eval_spst_g_rc(asl, x)

Parameters

x

the point where we evaluate the gradient and the Jacobian

asl

a structure which handles the pointer to the problem

irow

a list of indexes corresponding to the lines of the non null elements of the Jacobian. The sparsity structure of the Jacobian is not supposed to change when x varies

jcol

a list of indexes corresponding to the columns of the non null elements of the Jacobian. The sparsity structure of the Jacobian is not supposed to change when x varies

Description

Evaluate the sparsity structure of the Jacobian of the constraints 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_sp_w AMPL Toolbox ampl_eval_spst_g_val >>