# HG changeset patch # User John W. Eaton # Date 1316875099 14400 # Node ID 658aa9fd866506694d33a56f8a3ee6eb53e5d286 # Parent abf1e00111ddedc7d06793dad595d4d8201d46d5 sqp: provide warnings for QP subproblem failures * sqp.m: Warn if the QP subproblem is non-convex and unbounded, infeasible, or the solution fails to converge. diff -r abf1e00111dd -r 658aa9fd8665 scripts/optimization/sqp.m --- a/scripts/optimization/sqp.m Sat Sep 24 03:46:36 2011 -0500 +++ b/scripts/optimization/sqp.m Sat Sep 24 10:38:19 2011 -0400 @@ -443,7 +443,19 @@ info = INFO.info; - ## Check QP solution and attempt to recover if it has failed. + ## FIXME -- check QP solution and attempt to recover if it has + ## failed. For now, just warn about possible problems. + + id = "Octave:SQP-QP-subproblem"; + switch (info) + case 2 + warning (id, "sqp: QP subproblem is non-convex and unbounded"); + case 3 + warning (id, "sqp: QP subproblem failed to converge in %d iterations", + INFO.solveiter); + case 6 + warning (id, "sqp: QP subproblem is infeasible"); + endswitch ## Choose mu such that p is a descent direction for the chosen ## merit function phi.