diff scripts/optimization/qp.m @ 22224:20e0c0b8820c

Allow sequential quadratic programs with infeasible QPs (bug #36015). * qp.m: Use conformant sizes of temporary C and lower bound in call to glpk. * glpk.m: State size of A if its size doesn't match C and lb. * sqp.m: If the QP was infeasible, restore lambda to the correct size.
author Lachlan Andrew <lachlanbis@gmail.com>
date Sat, 27 Feb 2016 16:16:36 +1100
parents 516bb87ea72e
children bac0d6f07a3e
line wrap: on
line diff
--- a/scripts/optimization/qp.m	Thu Feb 11 21:06:45 2016 +1100
+++ b/scripts/optimization/qp.m	Sat Feb 27 16:16:36 2016 +1100
@@ -373,8 +373,8 @@
             Atmp = [Ain, gamma];
             btmp = bin;
           endif
-          ctmp = [zeros(n-n_eq, 1); ones(n_in, 1)];
-          lb = [-Inf(n-n_eq,1); zeros(n_in,1)];
+          ctmp = [zeros(n, 1); ones(n_in, 1)];
+          lb = [-Inf(n,1); zeros(n_in,1)];
           ub = [];
           ctype = repmat ("L", n_in, 1);
           [P, dummy, status] = glpk (ctmp, Atmp, btmp, lb, ub, ctype);