Summary
XpressPersistent.update_var does not properly set existing bound when the variable type changes (e.g., from continuous to discrete).
Steps to reproduce the issue
import pyomo.environ as pyo
m = pyo.ConcreteModel()
m.x = pyo.Var(bounds=(0, 1))
m.o = pyo.Objective(expr=m.x)
opt = pyo.SolverFactory('xpress_persistent')
opt.set_instance(m)
m.x.fix(1)
opt.update_var(m.x)
opt.solve(m)
opt.load_vars()
# prints 1
print(m.x.value)
m.x.domain = pyo.Binary
opt.update_var(m.x)
opt.solve(m)
opt.load_vars()
# prints 0
print(m.x.value)
Error Message
Information on your system
Pyomo version: c5a50b7
Python version: 3.11.8
Operating system: macOS
How Pyomo was installed (PyPI, conda, source): source
Solver (if applicable): Xpress
Additional information
Summary
XpressPersistent.update_var does not properly set existing bound when the variable type changes (e.g., from continuous to discrete).
Steps to reproduce the issue
Error Message
Information on your system
Pyomo version: c5a50b7
Python version: 3.11.8
Operating system: macOS
How Pyomo was installed (PyPI, conda, source): source
Solver (if applicable): Xpress
Additional information