Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mip/highs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,11 @@ def remove_constrs(self: "SolverHighs", constrsList: List[int]):

def constr_get_index(self: "SolverHighs", name: str) -> int:
idx = ffi.new("int *")
self._lib.Highs_getRowByName(self._model, name.encode("utf-8"), idx)
status = self._lib.Highs_getRowByName(self._model, name.encode("utf-8"), idx)
if status == STATUS_ERROR:
# This means that no constraint with that name was found. Unfortunately,
# Highs: getRowByName doesn't assign a value to idx in that case.
return -1
return idx[0]

# Variable-related getters/setters
Expand Down