Scilab Function

cgr - Evaluate gradient of the objective or Lagrangian function, and the gradients of the general constraint functions

Calling Sequence

[g,cjac] = cgr(x,v,options)

Parameters

Description

cgr Evaluate gradient of the objective or Lagrangian function, and the gradients of the general constraint functions.

[g,cjac]=cgr(x) returns the gradient of the objective function in g and the gradients of the general constraint functions in cjac. cjac(i,j) contains the partial derivative of the i-th constraint with respect to the j-th variable.

[g,cjac]=cgr(x,v) returns the gradient of the Lagrangian function in g and the gradients of the general constraint functions in cjac, where x is the current estimate of the solution and v is the current estimate of the Lagrange multipliers.

[g,cjac]=cgr(x,v,options), where options is a 2-dimensional boolean vector, allows cjac to be transposed and requests the gradient of the Lagrangian to be placed in g.

options( 1 ) = jtrans, set to %t if the user wants the transpose of the Jacobian, where the i,j-th component is the partial derivative of the j-th constraint with respect to the i-th variable. If options is not given, jtrans defaults to %f.

options( 2 ) = grlagf, set to %t if the gradient of the Lagrangian is required and set to %f if the gradient of the objective function is sought. Note that grlagf defaults to %f if v is not given, and defaults to 1 if v is given.

Examples

Authors

Bibliography

Based on CUTEr authored by

Nicholas I.M. Gould - n.gould@rl.ac.uk - RAL

Dominique Orban - orban@ece.northwestern.edu - Northwestern

Philippe L. Toint - Philippe.Toint@fundp.ac.be - FUNDP

see http://hsl.rl.ac.uk/cuter-www