Skip to content

Commit a2ae9c9

Browse files
committed
Ranged ExprCons requires number
1 parent 3861420 commit a2ae9c9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/pyscipopt/matrix.pxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ class MatrixGenExpr(MatrixExpr):
9696

9797
class MatrixExprCons(np.ndarray):
9898

99-
def __le__(self, other: Union[float, int, Expr, np.ndarray, MatrixExpr]) -> MatrixExprCons:
99+
def __le__(self, other: Union[float, int, np.ndarray]) -> MatrixExprCons:
100100
return _matrixexpr_richcmp(self, other, 1)
101101

102-
def __ge__(self, other: Union[float, int, Expr, np.ndarray, MatrixExpr]) -> MatrixExprCons:
102+
def __ge__(self, other: Union[float, int, np.ndarray]) -> MatrixExprCons:
103103
return _matrixexpr_richcmp(self, other, 5)
104104

105105
def __eq__(self, other):

tests/test_matrix_variable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def test_ranged_matrix_cons_with_expr():
424424

425425
# test "<=" and ">=" operator
426426
x = m.addMatrixVar(3)
427-
m.addMatrixCons((x <= 1) >= var + 1)
427+
m.addMatrixCons((x <= 1) >= 1)
428428

429429
m.setObjective(x.sum())
430430
m.optimize()

0 commit comments

Comments
 (0)