qcqp
qcqp copied to clipboard
cvxpy 0.4 doesn't support slice
qcqp is based on the cvxpy 0.4, and cvxpy 0.4 doesn't support slice
# x_variable = cvx.Variable((len(LU) + 1, K)) cvxpy 1.0 can write like this
x_variable = cvx.Variable(L, K)
constraints = []
for i in LU:
constraints.append(cvx.sum_entries(x_variable[i]) == 1)
if i code like that,i would get: IndexError: Invalid index/slice.
if i want to add a constrain that the sum of each row of x_variable equal to 1, how can i code? can you help me, thank you every much!