Advanced Features¶
Kernel Routines¶
The SNOPT and SQOPT kernel routines live one level below the main
subroutines snoptA
, snoptB
, snoptC
, and SQOPT and expose additional
input arguments in the subroutine calls.
For each solver call, there are 4 additional external arguments snLog
,
snLog2
, sqLog
, and snSTOP
listed after the user-defined
subroutines. Each of these arguments is an external subroutine. The first
three subroutines can be used to customize the output logging routines for
major SQP iterations, minor SQP iterations, and QP iterations, respectively.
snSTOP
is a subroutine that is called every major iteration of the SQP
method and can be used to abort the run.
snKerA¶
subroutine snKerA
& ( start, nF, n, nxname, nFname,
& objUAdd, objRow, Prob,
& usrfun, snLog, snLog2, sqLog, snSTOP,
& iAfun, jAvar, lenA, neA, A,
& iGfun, jGvar, lenG, neG,
& xlow, xupp, xnames, Flow, Fupp, Fnames,
& x, xstate, xmul, F, Fstate, Fmul,
& INFO, mincw, miniw, minrw,
& nS, nInf, sInf,
& cu, lencu, iu, leniu, ru, lenru,
& cw, lencw, iw, leniw, rw, lenrw )
external
& usrfun, snLog, snLog2, sqLog, snSTOP
integer
& INFO, lenA, lencu, lencw, lenG, leniu, leniw, lenru, lenrw,
& mincw, miniw, minrw, n, neA, neG, nF, nFname, nInf, nS,
& nxname, objRow, start, iAfun(lenA), iGfun(lenG), iu(leniu),
& iw(leniw), jAvar(lenA), jGvar(lenG), xstate(n), Fstate(nF)
double precision
& objUAdd, sInf, A(lenA), F(nF), Fmul(nF), Flow(nF), Fupp(nF),
& ru(lenru), rw(lenrw), x(n), xlow(n), xmul(n), xupp(n)
character
& Prob*8, cu(lencu)*8, cw(lencw)*8, Fnames(nFname)*8,
& xnames(nxname)*8
snKerB¶
subroutine snKerB
& ( Start, m, n, neJ, nNames,
& nnCon, nnObjU, nnJac,
& iObjU, objUAdd, Prob,
& funcon, funobj,
& snLog, snLog2, sqLog, snSTOP,
& Jcol, indJ, locJ, bl, bu, Names,
& hs, x, pi, rc,
& INFO, mincw, miniw, minrw,
& nS, nInf, sInf, obj,
& cu, lencu, iu, leniu, ru, lenru,
& cw, lencw, iw, leniw, rw, lenrw )
external
& funcon, funobj,
& snLog, snLog2, sqLog, snSTOP
integer
& INFO, iObjU, lencu, lencw, leniu, leniw, lenru, lenrw, m,
& mincw, miniw, minrw, n, neJ, nInf, nNames, nnCon, nnJac,
& nnObjU, nS, hs(n+m), indJ(neJ), iu(leniu), iw(leniw),
& locJ(n+1)
double precision
& obj, objUAdd, sInf, Jcol(neJ), bl(n+m), bu(n+m), pi(m),
& rc(n+m), ru(lenru), rw(lenrw), x(n+m)
character*(*)
& Start
character
& Prob*8, cu(lencu)*8, cw(lencw)*8, Names(nNames)*8
snKerC¶
subroutine snKerC
& ( Start, m, n, neJ, nNames,
& nnCon, nnObjU, nnJac,
& iObjU, objUAdd, Prob,
& userfun, snLog, snLog2, sqLog, snSTOP,
& Jcol, indJ, locJ, bl, bu, Names,
& hs, x, pi, rc,
& INFO, mincw, miniw, minrw,
& nS, nInf, sInf, Obj,
& cu, lencu, iu, leniu, ru, lenru,
& cw, lencw, iw, leniw, rw, lenrw )
external
& userfun, snLog, snLog2, sqLog, snSTOP
integer
& INFO, iObjU, lencu, leniu, lenru, lencw, leniw, lenrw,
& mincw, miniw, minrw, m, n, neJ, nNames, nS, nInf, nnCon,
& nnObjU, nnJac, indJ(neJ), hs(n+m), locJ(n+1), iu(leniu),
& iw(leniw)
double precision
& sInf, Obj, objUAdd, Jcol(neJ), bl(n+m), bu(n+m), x(n+m),
& pi(m), rc(n+m), ru(lenru), rw(lenrw)
character*(*)
& Start
character
& Prob*8, Names(nNames)*8, cu(lencu)*8, cw(lencw)*8
snKerQ¶
subroutine snKerQ
& ( Start, qpHx, sqLog, m,
& n, neA, nNames, lencObj, ncolH,
& iObj, objAdd, Prob,
& Acol, indA, locA, bl, bu, cObj, Names,
& eType, hs, x, pi, rc,
& INFO, mincw, miniw, minrw,
& nS, nInf, sInf, obj,
& cu, lencu, iu, leniu, ru, lenru,
& cw, lencw, iw, leniw, rw, lenrw )
external
& qpHx, sqLog
integer
& m, n, neA, nNames, lencObj, ncolH, iObj, INFO, mincw, miniw,
& minrw, nS, nInf, lencu, leniu, lenru, lencw,
& leniw, lenrw, indA(neA), eType(n+m), hs(n+m), locA(n+1),
& iu(leniu), iw(leniw)
double precision
& objAdd, sInf, obj, Acol(neA), bl(n+m), bu(n+m),
& cObj(*), pi(m), rc(n+m), x(n+m), ru(lenru), rw(lenrw)
character*(*)
& Start
character
& Prob*8, Names(nNames)*8, cu(lencu)*8, cw(lencw)*8
Logging Routines¶
Below are the signatures of the log routines for SNOPT and SQOPT.
snLog
and snLog2
print the major and minor iteration logs when a
nonlinear problem is solved. sqLog
prints the QP iteration log when
SQOPT is called to solve a QP.
snLog¶
subroutine snLog
& ( iAbort,
& KTcond, mjrPrtlvl, minimize,
& n, nb, nnCon0, nnObj,
& nS, itn, nMajor, nMinor, nSwap,
& condZHZ, iObj, scaleObj, objAdd,
& fObj, fMerit, penParm, step,
& primalInf, dualInf, maxVi, maxViRel, hs,
& neJ, nlocJ, locJ, indJ, Jcol,
& scales, bl, bu, Fx, fCon, yCon, x,
& cu, lencu, iu, leniu, ru, lenru,
& cw, lencw, iw, leniw, rw, lenrw )
logical
& KTcond(2)
integer
& iAbort, iObj, lencu, lencw, leniu, leniw,
& lenru, lenrw, mjrPrtlvl, minimize, n, neJ, nb, nlocJ, nnCon0,
& nnObj, nS, itn, nMajor, nMinor, nSwap,
& hs(nb), locJ(nlocJ),
& indJ(neJ), iu(leniu), iw(leniw)
double precision
& condZHZ, scaleObj, objAdd, fMerit, fObj, maxViRel, maxVi,
& step, primalInf, dualInf, penParm(4), scales(nb),
& bl(nb), bu(nb), Fx(nnCon0), fCon(nnCon0), Jcol(neJ),
& yCon(nnCon0), x(nb), ru(lenru), rw(lenrw)
character
& cu(lencu)*8, cw(lencw)*8
The snLog
subroutine prints the major iteration log. Values should not be
modified by the user.
snLog2¶
subroutine snLog2
& ( probType, probTag,
& Elastic, GotR, FirstFeas, Feasible, JustPhase1,
& m, mBS, nnH, nS, jSq, jBr, jSr,
& linesP, linesS, itn, itQP, kPrc, lvlObjE,
& pivot, step, nInf, sInf, nInfE, sInfE, wtInf,
& nonOpt, objPrt, condZHZ, djqPrt, rgNorm, kBS, xBS,
& iw, leniw )
character
& probTag*20
logical
& Elastic, FirstFeas, Feasible, JustPhase1, GotR
integer
& probType, m, mBS, nnH, nS, jSq, jBr, jSr, itn, itQP, kPrc,
& leniw, linesP, linesS, lvlObjE, nonOpt, nInf, nInfE,
& kBS(mBS), iw(leniw)
double precision
& condZHZ, djqPrt, objPrt, pivot, rgNorm, step, sInf, sInfE,
& wtInf, xBS(mBS)
The snLog2
subroutine prints the minor iteration log. Values should not be
modified by the user.
Additional Subroutines¶
snSTOP¶
subroutine snSTOP
& ( iAbort,
& KTcond, mjrPrtlvl, minimize,
& m, maxS, n, nb, nnCon0, nnCon, nnObj0, nnObj, nS,
& itn, nMajor, nMinor, nSwap,
& condZHZ, iObj, scaleObj, objAdd,
& fObj, fMerit, penParm, step,
& primalInf, dualInf, maxVi, maxViRel, hs,
& neJ, nlocJ, locJ, indJ, Jcol, negCon,
& scales, bl, bu, Fx, fCon, gCon, gObj,
& yCon, pi, rc, rg, x,
& cu, lencu, iu, leniu, ru, lenru,
& cw, lencw, iw, leniw, rw, lenrw )
logical
& KTcond(2)
integer
& iAbort, iObj, itn,
& lencu, lencw, leniu, leniw, lenru, lenrw,
& mjrPrtlvl, minimize, m, maxS, n, nb, neJ, negCon, nlocJ,
& nnCon0, nnCon, nnObj0, nnObj,
& nMajor, nMinor, nS, nSwap,
& hs(nb), locJ(nlocJ), indJ(neJ), iu(leniu), iw(leniw)
double precision
& condZHZ, scaleObj, objAdd, fObj, fMerit, penParm(4),
& maxViRel, maxVi, step, primalInf, dualInf,
& scales(nb), bl(nb), bu(nb), Fx(nnCon0),
& fCon(nnCon0), gCon(negCon), gObj(nnObj0), Jcol(neJ), pi(m),
& rc(nb), rg(maxS), yCon(nnCon0), x(nb), ru(lenru), rw(lenrw)
character
& cu(lencu)*8, cw(lencw)*8
The snSTOP
subroutine is called every major iteration. snSTOP
can be
used to examine or print information at the current iteration. A nonzero
value of iAbort
will terminate SNOPT at this iteration. Otherwise,
SNOPT continues until some termination criteria is met.
snSTOP
is a subroutine that is called every major iteration of the SQP
method and can be used to check values during a run or abort the run.
sqLog¶
subroutine sqLog
& ( probType, probTag,
& Elastic, GotR, FirstFeas, Feasible, JustPhase1,
& m, mBS, nnH, nS, jSq, jBr, jSr,
& linesP, linesS, itn, itQP, kPrc, lvlObjE,
& pivot, step, nInf, sInf, nInfE, sInfE, wtInf,
& nonOpt, ObjPrt, condZHZ, djqPrt, rgNorm, kBS, xBS,
& iw, leniw )
character
& probTag*20
logical
& Elastic, FirstFeas, Feasible, JustPhase1, GotR
integer
& probType, m, mBS, nnH, nS, jSq, jBr, jSr, itn, itQP, kPrc,
& leniw, linesP, linesS, lvlObjE, nonOpt, nInf, nInfE,
& kBS(mBS), iw(leniw)
double precision
& condZHZ, djqPrt, ObjPrt, pivot, rgNorm, step, sInf, sInfE,
& wtInf, xBS(mBS)
The sqLog
subroutine prints the iteration log when a stand-alone QP is
being solved.. Values should not be modified by the user.