PPOPT
PPOPT copied to clipboard
Incorrect constant term when multiplying linear expressions in MPModel
Describe the bug The square of the constant terms is added twice when it should only be added once, see here.
To Reproduce
from ppopt.mpmodel import MPModeler
x = MPModeler().add_var()
expr = x + 1
expr2 = expr**2
expr2.const
Should be 1, is 2.
Expected behavior The square of the constant terms should be added once.