Describe the bug
MIP allows to create constraint like mip.LinExprTensor <= mip.Var, but not the opposite way.
To Reproduce
>>> import mip
>>> m = mip.Model()
>>> y = m.add_var_tensor((10,2), 'y')
>>> x = m.add_var('x')
>>> m += y >= x
>>> m += x >= y
Traceback (most recent call last):
File "python\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
File "<input>", line 1, in <module>
File "lib\site-packages\mip\entities.py", line 632, in __ge__
raise TypeError("type {} not supported".format(type(other)))
TypeError: type <class 'mip.ndarray.LinExprTensor'> not supported
Expected behavior
Both constraints mip.LinExprTensor <= mip.Var and mip.Var <= mip.LinExprTensor are supported and behave identically.
Desktop (please complete the following information):
Operating System, version: Windows
Python version: 3.10.11
Python-MIP version (we recommend you to test with the latest version): 1.15.0
Describe the bug MIP allows to create constraint like
mip.LinExprTensor <= mip.Var
, but not the opposite way.To Reproduce
Expected behavior Both constraints
mip.LinExprTensor <= mip.Var
andmip.Var <= mip.LinExprTensor
are supported and behave identically.Desktop (please complete the following information):
Additional context N/A