Skip to content

Commit

Permalink
highs: add comments about confusion between BINARY and INTEGER
Browse files Browse the repository at this point in the history
  • Loading branch information
rschwarz committed Jan 17, 2025
1 parent 3a4bd7b commit 5de89ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mip/highs.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def __init__(self, model: mip.Model, name: str, sense: str):
# Buffer string for storing names
self._name_buffer = ffi.new(f"char[{self._lib.kHighsMaximumStringLength}]")

# type conversion maps
# type conversion maps (can not distinguish binary from integer!)
self._var_type_map = {
mip.CONTINUOUS: self._lib.kHighsVarTypeContinuous,
mip.BINARY: self._lib.kHighsVarTypeInteger,
Expand Down Expand Up @@ -815,6 +815,8 @@ def add_var(
if name:
check(self._lib.Highs_passColName(self._model, col, name.encode("utf-8")))
if var_type != mip.CONTINUOUS:
# Note that HiGHS doesn't distinguish binary and integer variables
# by type. There is only a boolean flag for "integrality".
self._num_int_vars += 1
check(
self._lib.Highs_changeColIntegrality(
Expand Down

0 comments on commit 5de89ae

Please sign in to comment.