Commit be883d5
Feature: Matrix
* Remove custom sum method from MatrixExpr
Deleted the overridden sum method in MatrixExpr to rely on the default numpy ndarray behavior.
* Revert "Remove custom sum method from MatrixExpr"
This reverts commit 72c42f4.
* Improve MatrixExpr.sum to handle scalar results
Updated the MatrixExpr.sum method to return a scalar when the result is a single value, preserving array output otherwise. This enhances usability for matrix expressions that may reduce to a single value.
* Add test for matrix sum argument in Model
* Update CHANGELOG for MatrixExpr.sum() change
* add case to test 3d array
* Fix axis argument in matrix sum test
Replaces positional argument with explicit 'axis=2' in y.sum() to improve clarity and correctness in test_matrix_sum_argument.
* Correct method name
* Add more complex test cases
* correct function name
* Fix test to constrain matrix variable values
* Fix z value and get x and y values
* Update tests/test_matrix_variable.py
* Update CHANGELOG.md
Co-authored-by: Copilot <[email protected]>
* typo
---------
Co-authored-by: João Dionísio <[email protected]>
Co-authored-by: Copilot <[email protected]>sum method supports arguments inputting (#1025)1 parent ed56984 commit be883d5
File tree
3 files changed
+32
-2
lines changed- src/pyscipopt
- tests
3 files changed
+32
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
167 | 191 | | |
168 | 192 | | |
169 | 193 | | |
| |||
0 commit comments