|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import pprint
from cvxopt import matrix, solvers
P = matrix([[0.05556,0.00774,0.00042],[0.00774,0.02224,-0.0004],[0.00042,-0.0004,0.003]])
q = matrix([0.0,0.0,0.0])
G = matrix([[-1.0,0.0,0.0],[0.0,-1.0,0.0],[0.0,0.0,-1.0],[-0.1073,-0.0737,-0.0627]])
h = matrix([0.0,0.0,0.0,-0.065])
A = matrix([[1.0],[1.0],[1.0]])
b = matrix([1.0])
result = solvers.qp(P,q,G,h,A,b)
print('x\n',result['x'])
纯小白。。。做优化作业重复老师的例子,复现不出来,请问是哪里错了呀 |
|