Matlab implementation of Sequential coordinate-wise algorithm.
The quadratic programming (QP) task with the non-negativity constraints is
Minimize f(x) = 0.5 * x'*H*x + x'*f w.r.t. x
subject to the constraint x >= 0.
where, H is symmetric and positive semidefinite N x N matrix and f is a N dimensional column vector.
[x,fval] = qpsca(H,f)
H = [1 -1; -1 2];
f = [-2; -6];
[x,fval] = qpsca(H,f)
x =
9.9688
7.9844
fval =
-33.9998
H = [1 -1; -1 2];
f = [-2; -6];
A = [-1 0; 0 -1];
b = [0; 0];
[x,fval] = quadprog(H,f,A,b)
x =
10
8
fval =
-34