The control problems (P) and (EB) defined in the previous sections
lead after suitable discretization to nonlinear finite-dimensional
optimization problems of the form
A discretization (P) of (P) is given in section 2 while the elliptic problem is assumed to be discretized as described in detail in [16,18]. symbolizes the state equation and boundary conditions while denotes both pointwise control and state constraints, the only constraints of inequality type prescribed above. Thus, alternatively, it can be written as
We state the well-known SSC for (4.1), assuming , , . Let be an admissible point satisfying the first-order necessary optimality conditions with associated Lagrange multipliers and . Let further
The point is a strict local minimizer if a exists such that, see, for example, 
After computing a solution an AMPL stub (or ) file is written as well as a file with the computed Lagrange multipliers. This allows to check the SSC (4.3) with the help of a Fortran, alternatively, a C or Matlab, program.
This program reads the files and verifies first the necessary first-order optimality conditions, the column regularity of and the strict complementarity. For this, it utilizes routines provided by AMPL which permit evaluation of the objective and constraint gradients. Next, the the QR decomposition of is computed by one of the methods exploiting sparsity. We have utilized the algorithm described in . AMPL also provides a routine to multiply the Hessian of the Lagrangian times a vector. This is called with the columns of and thus can be formed. Its eigenvalues are computed with LAPACK routine DSYEV and the smallest eigenvalue is determined. The use of this eigenvalue routine is possible since the order of the matrices corresponding to the "free" control variables is moderate. In case of distributed control problems when this number may be on the order of the state variables, a sparse solver, preferably just for finding the minimal eigenvalue, will have to be used.