Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/pyscipopt/scip.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
if rc == SCIP_OKAY:
pass
elif rc == SCIP_ERROR:
raise Exception('SCIP: unspecified error!')

Check failure on line 325 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / test-coverage (3.11)

SCIP: unspecified error!
elif rc == SCIP_NOMEMORY:
raise MemoryError('SCIP: insufficient memory error!')
elif rc == SCIP_READERROR:
Expand All @@ -341,7 +341,7 @@
raise Exception('SCIP: method cannot be called at this time'
+ ' in solution process!')
elif rc == SCIP_INVALIDDATA:
raise Exception('SCIP: error in input data!')

Check failure on line 344 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / test-coverage (3.11)

SCIP: error in input data!
elif rc == SCIP_INVALIDRESULT:
raise Exception('SCIP: method returned an invalid result code!')
elif rc == SCIP_PLUGINNOTFOUND:
Expand Down Expand Up @@ -7447,7 +7447,7 @@
Parameters
----------
cons : ExprCons
a linear inequality of the form "<="
a linear inequality
binvar : Variable, optional
binary indicator variable, or None if it should be created (Default value = None)
activeone : bool, optional
Expand Down
13 changes: 13 additions & 0 deletions tests/test_cons.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,19 @@ def test_cons_indicator():
assert m.isEQ(m.getVal(x), 1)
assert c1.getConshdlrName() == "indicator"

def test_cons_indicator_geq():
m = Model()
m.hideOutput()

x = m.addVar(lb=0, ub=10, name="x")
b = m.addVar(vtype="B", name="b", lb=1)

m.addConsIndicator(x >= 5, binvar=b)
m.setObjective(x)
m.optimize()

assert m.getVal(x) == 5

def test_cons_indicator_with_matrix_binvar():
# test matrix variable binvar #1043
m = Model()
Expand Down
Loading