Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d33379c
Replace Variable with Expr in MatrixExpr
Zeroto521 Sep 4, 2025
6c48a73
add test case
Zeroto521 Sep 4, 2025
b578ea5
Replace Variable with Expr in MatrixExprCons
Zeroto521 Sep 4, 2025
e8db5a1
add test case
Zeroto521 Sep 4, 2025
aae9df9
Update CHANGELOG.md
Zeroto521 Sep 4, 2025
d8a9377
Add test for ranged matrix constraint
Zeroto521 Sep 4, 2025
99446bc
Refactor matrix comparison operators using helper
Zeroto521 Sep 4, 2025
a09be1a
Replace TypeError with NotImplementedError in __eq__
Zeroto521 Sep 4, 2025
771437b
Add tests for matrix constraint operators
Zeroto521 Sep 4, 2025
2b9a3c0
Update CHANGELOG.md
Zeroto521 Sep 4, 2025
b7b1321
BUG: fix circular imports
Zeroto521 Sep 4, 2025
987c219
Fix matrix comparison shape handling
Zeroto521 Sep 4, 2025
7a1275d
Fix redundant .all() calls in matrix variable tests
Zeroto521 Sep 4, 2025
f1dc2fa
Fix matrix variable test assertions to use getVal
Zeroto521 Sep 4, 2025
b6dcf42
let MatrixExprCons support <= and >= operator
Zeroto521 Sep 4, 2025
64ae70e
Refactor matrix comparison tests to optimize assertions and remove re…
Zeroto521 Sep 4, 2025
f69ce7e
let MatrixExprCons support <= and >= operator
Zeroto521 Sep 4, 2025
3700261
find what type it is
Zeroto521 Sep 4, 2025
c677b34
align with `__add__`
Zeroto521 Sep 4, 2025
bca7262
test "==" first
Zeroto521 Sep 4, 2025
cb600b2
Revert "let MatrixExprCons support <= and >= operator"
Zeroto521 Sep 4, 2025
a3a6239
Revert "let MatrixExprCons support <= and >= operator"
Zeroto521 Sep 4, 2025
06f8ebc
find what type it is
Zeroto521 Sep 4, 2025
ef5aecf
test expr
Zeroto521 Sep 4, 2025
ceaab05
Change the order
Zeroto521 Sep 4, 2025
3861420
Remove ExprCons
Zeroto521 Sep 4, 2025
a2ae9c9
Ranged ExprCons requires number
Zeroto521 Sep 4, 2025
6afa150
Update CHANGELOG.md
Zeroto521 Sep 4, 2025
88a935f
Lint codes with 4 spaces
Zeroto521 Sep 4, 2025
d3b0fff
Merge branch 'master' into fix/1061
Zeroto521 Oct 10, 2025
cdfbf82
Merge branch 'master' into fix/1061
Zeroto521 Oct 18, 2025
1601484
keep `_is_number` in expr.pxi
Zeroto521 Oct 18, 2025
a985bda
Update CHANGELOG.md
Zeroto521 Oct 18, 2025
581f63d
Add quotes for annotations
Zeroto521 Oct 18, 2025
e5ba3f3
Merge branch 'fix/1061' of github.com:Zeroto521/PySCIPOpt into fix/1061
Zeroto521 Oct 18, 2025
fcf7921
Merge branch 'master' into fix/1061
Zeroto521 Oct 21, 2025
ad03e9b
Simplify loop via `numpy.ndarray.flat`
Zeroto521 Oct 22, 2025
384c299
Merge branch 'master' into fix/1061
Zeroto521 Oct 22, 2025
cf7ede1
Add shape check for ndarray comparison in _matrixexpr_richcmp
Zeroto521 Oct 22, 2025
47a7cd7
Merge branch 'fix/1061' of https://github.com/Zeroto521/PySCIPOpt int…
Zeroto521 Oct 22, 2025
9d42cac
TST: test MatrixExprCons vs Variable
Zeroto521 Oct 22, 2025
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
Prev Previous commit
Next Next commit
Ranged ExprCons requires number
  • Loading branch information
Zeroto521 committed Sep 4, 2025
commit a2ae9c9676ec5aea3f9a0f3f8894f75789815368
4 changes: 2 additions & 2 deletions src/pyscipopt/matrix.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ class MatrixGenExpr(MatrixExpr):

class MatrixExprCons(np.ndarray):

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

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

def __eq__(self, other):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_matrix_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def test_ranged_matrix_cons_with_expr():

# test "<=" and ">=" operator
x = m.addMatrixVar(3)
m.addMatrixCons((x <= 1) >= var + 1)
m.addMatrixCons((x <= 1) >= 1)

m.setObjective(x.sum())
m.optimize()
Expand Down