The last line of this code fails:
A = np.random.rand(d, d)*5.0
b = np.random.rand(d)*10.0
m = gp.Model()
x = m.addMVar(d, name='x')
y = m.addMVar(d, name='y', vtype=gp.GRB.BINARY)
m.addConstr(A@x <= b)
m.addConstr(A@x >= y*b) // error occurs here on y*b
It gives this error for gurobipy version 9.5.1:
File "src/gurobipy/mvar.pxi", line 108, in gurobipy.MVar.__mul__
File "src/gurobipy/mvar.pxi", line 184, in gurobipy.MVar._scalar_mult
TypeError: only size-1 arrays can be converted to Python scalars
I was expecting per-element multiplication with the asterisk. How do I declare the per-element multiplication in a way that is compatible with the gurobipy API?