PPOPT icon indicating copy to clipboard operation
PPOPT copied to clipboard

Incorrect constant term when multiplying linear expressions in MPModel

Open adrianlipow opened this issue 1 year ago • 0 comments

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.

adrianlipow avatar Nov 20 '24 17:11 adrianlipow