The following picture illustrates the problem structure just described:

The dimensions are all input parameters
to subroutine snopt (see the next section). For
linear programs, nnCon, nnJac and nnObj
are all zero. If
a linear objective term exists, iObj points to one of
the bottom rows (nnCon < iObj
m ).
The dashed boxes indicate that a nonlinear
objective function f(x') may involve either a subset
or a superset of the variables in the nonlinear constraint functions F(x'')
, counting from the left.
Thus, nnObj
nnJac or
vice versa.
Sometimes the objective and constraints really involve disjoint sets of nonlinear variables. We then recommend ordering the variables so that nnObj > nnJac and x' = (x'', x'''), where the objective is nonlinear in just the last vector x'''. Subroutine funobj should set g(j) = 0.0 for j = 1: nnJac . It should then set as many remaining gradients as possible—preferably all!