1

I'm trying to solve a QP problem using cvxopt. There are two constraints

0<=y<=b wy=0

So I define

p=np.diag(-np.ones(len(myset))

p1=np.diag(np.ones(len(myset)))

dd=np.concatenate((p,p1),axis=0)

which are two identity matrix, which allow me to define:

-y<=0

I also write

v=np.concatenate((zero,b),axis=0)

in which 'zero' is an array which has the dimension (len(set),1) and also b, and are respectively my lower and upper bound for the variable y. I define G and h:

G=matrix(dd)
h=matrix(v)

But when I print the solution the values for y are also negative, so it ignores completely the constraint which impose to y to be positive. Could someone help me please?

I printed the matrix G,h and A,b and were chacaracterized by all zero values, so there's an error in the definition of these matrix?

donatella
  • 11
  • 2

0 Answers0