In the example given in https://cvxopt.org/examples/tutorial/qp.html, they give the syntax for the situation when there is one equality constraint but I am having problems getting it right when I have three equality constraints.
1 Answer
CVXOPT can be easily implemented with several inequality as well as equality constraint and they follow the same logic.
So for the inequality Gx <= h you will have
G = opt.matrix(np.concatenate([G1,Gn])
h = opt.matrix(np.concatenate([h1,hn])
The same logic will apply for multiple equality constraint where Ax == b, hence
A = opt.matrix(np.concatenate([A1,An])
b = opt.matrix(np.concatenate([b1,bn])
then you can set the solver to be
sol = solvers.qp(P, q, G, h, A, b)
The only thing you need to be careful not to have error is to make sure you concatenate matrixes, hence you need to transform value into matrix