Is there any built in function to compute the remainder of a variable in cvxpy? For instance, the following example code:
m = 3
n = 2
k = 5
A = cp.Variable((m,n),boolean=True)
B = np.ones((1,m))
C = np.ones(n)
constraints = []
objective = cp.Maximize((B@A%2)@C)
prob = cp.Problem(objective, constraints)
optimal_value = prob.solve()
gives error:
Exception has occurred: TypeError
unsupported operand type(s) for %: 'MulExpression' and 'int'
Because of the % operation
question from:
https://stackoverflow.com/questions/65874543/remainder-operation-in-cvxpy 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…