Skip to content

Commit 62eed99

Browse files
committed
Fix: Don't negate rhs in constraint properties (getter/setter)
This is different from the "constant" in Constraint.
1 parent 4e2dc15 commit 62eed99

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mip/highs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -727,11 +727,11 @@ def constr_get_rhs(self: "SolverHighs", idx: int) -> numbers.Real:
727727

728728
# case distinction for sense
729729
if lower[0] == -mip.INF:
730-
return -upper[0]
730+
return upper[0]
731731
if upper[0] == mip.INF:
732-
return -lower[0]
732+
return lower[0]
733733
assert lower[0] == upper[0]
734-
return -lower[0]
734+
return lower[0]
735735

736736
def constr_set_rhs(self: "SolverHighs", idx: int, rhs: numbers.Real):
737737
# first need to figure out which bound to change (lower or upper)
@@ -757,9 +757,9 @@ def constr_set_rhs(self: "SolverHighs", idx: int, rhs: numbers.Real):
757757
# update bounds as needed
758758
lb, ub = lower[0], upper[0]
759759
if lb != -mip.INF:
760-
lb = -rhs
760+
lb = rhs
761761
if ub != mip.INF:
762-
ub = -rhs
762+
ub = rhs
763763

764764
# set new bounds
765765
check(self._lib.Highs_changeRowBounds(self._model, idx, lb, ub))

0 commit comments

Comments
 (0)