gringotopies

Kwadratowe 1

Dec 18th, 2019
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. from cvxopt import matrix, solvers
  2. Q = matrix([ [10.0, 2.0], [2.0, 1.0] ])
  3. p = matrix([-10.0,-25.0])
  4. G = matrix([[1.0,-1.0,-1.0,0.0],[2.0,-1.0,0.0,-1.0]])
  5. h = matrix([10.0,-9.0,0.0,0.0])
  6.  
  7. sol=solvers.qp(Q, p, G, h)
  8.  
  9. print(sol['x'])
Add Comment
Please, Sign In to add comment