This subroutine must compute the nonlinear constraint functions F(x) and (optionally) their gradients J(x), where x is the current value of the Jacobian variables x''. The jth column of the Jacobian matrix J(x) is the vector DF/Dxj.
Gradients are stored column-wise in the output array gCon .
Recall that J(x) is the top left corner of a larger matrix A that is stored column-wise in snopt's input arrays a, ha, ka (see Eqn(3.2) and Identifying structure in the objective and constraints). Jacobian elements must be stored in gCon in the same order as the corresponding parts of a, ha, ka.
For small problems (or large dense ones) it is convenient to treat the
Jacobian as a dense matrix and declare gCon as a two-dimensional
array gCon(*,*) (which is stored column-wise in Fortran).
It is then simple to compute the Jacobian by rows or by columns. For
problems with sparse Jacobians, it is essential to use a one-dimensional
array gCon(*) in order to conserve storage. Thus,
funcon should use just one of the declarations
double precision
gCon(nnCon,nnJac)
double precision
gCon(neJac)
according to convenience.
__________________________________________________________________
|
|
subroutine funcon( |
mode, nnCon, nnJac, neJac, |
|
$ |
|
x, fCon, gCon, nState, |
|
$ |
|
cu, lencu, iu, leniu, ru, lenru ) |
|
|
|
|
|
|
integer |
mode, nnCon, nnJac, neJac, nState |
|
|
double precision |
x(nnJac), fCon(nnCon) |
*** Choose ONE of the following:
|
* |
double precision |
gCon(nnCon,nnJac) |
|
* |
double precision |
gCon(neJac) |
|
|
|
|
|
|
integer |
lencu, leniu, lenru |
|
|
character*8 |
cu(lencu) |
|
|
integer |
iu(leniu) |
|
|
double precision |
ru(lenru) |