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), gCon(nnCon,nnJac) integer lencu, leniu, lenru character*8 cu(lencu) integer iu(leniu) double precision ru(lenru) * ================================================================== * Toy NLP problem from the SNOPT User's Guide. * ================================================================== integer nout nout = 15 * --------------------------------------- * First entry. Print something. * --------------------------------------- if (nState .eq. 1) then if (nout .gt. 0) write(nout, '(/a)') ' This is problem Toy' end if if (mode .eq. 0 .or. mode .eq. 2) then fCon( 1) = x(1)**2 + x(2)**2 fCon( 2) = x(1)**4 + x(2)**4 end if if (mode .ge. 1) then * Jacobian elements for column 1. gCon(1,1) = 2.0d+0*x(1) gCon(2,1) = 4.0d+0*x(1)**3 * Jacobian elements for column 2. gCon(1,2) = 2.0d+0*x(2) gCon(2,2) = 4.0d+0*x(2)**3 end if * ------------ * Last entry. * ------------ if (nState .ge. 2) then if (nout .gt. 0) write(nout, '(/a)') ' Finished problem Toy' end if * end of funcon for toy NLP end