We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9451cc6 commit 7ee3a6fCopy full SHA for 7ee3a6f
1 file changed
tests/test_cons.py
@@ -179,6 +179,19 @@ def test_cons_indicator():
179
assert m.isEQ(m.getVal(x), 1)
180
assert c1.getConshdlrName() == "indicator"
181
182
+def test_cons_indicator_with_matrix_binvar():
183
+ m = Model()
184
+
185
+ x = m.addVar(vtype="B")
186
+ binvar = m.addMatrixVar(1, vtype="B")
187
+ # binvar is a matrix variable to fix #1043
188
+ m.addConsIndicator(x >= 1, binvar)
189
190
+ m.setObjective(binvar, "maximize")
191
+ m.optimize()
192
193
+ assert m.getVal(x) == 1
194
195
@pytest.mark.xfail(
196
reason="addConsIndicator doesn't behave as expected when binary variable is False. See Issue #717."
197
)
0 commit comments