
132 A QP Solution Algorithm Chap. 6
41 while flag == 0
42 QPStep1
43 QPStep2
44 QPStep3
45 end
46
47 minvalue = fxj;
48 minimizer = xj;
49 IndexSet = Kj;
50 multipliers = uj;
Figure 6.5 QPSolver.m.
QPStep1.m (Figure 6.6 ) implements Step 1 of QPSolver. Line 3
constructs
Hj =
BigC Aj
′
Aj 0
,
and line 4 constructs
rhs =
gxj
0
.
Line 5 solves the linear equations Hj y = rhs. Line 6 extracts the first n
components into sj and line 7 extracts the last active components into
vj.
1 %Q PStep1.m
2 %S tep 1: Computation of Search Direction sj.
3 Hj = ve rtcat([BigC Aj'],[Aj ze ros(active,active)]);
4 rh s = vertcat(gxj, zeros(active,1));
5 y = Hjˆ−1
*
rhs;
6 sj = y(1:n);
7 vj = y(n+1:n+active); ...