Skip to content

Commit facf124

Browse files
committed
Remove sum performance test from matrix variable tests
Deleted the test_sum_performance function from test_matrix_variable.py. This test was benchmarking sum operations on matrix variables, but has been removed, possibly due to redundancy or irrelevance.
1 parent 8b3718f commit facf124

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

tests/test_matrix_variable.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -210,24 +210,6 @@ def test_matrix_sum_argument():
210210
assert (m.getVal(y) == np.full((2, 4), 3)).all().all()
211211

212212

213-
@pytest.mark.parametrize("n", [50])
214-
def test_sum_performance(n):
215-
model = Model()
216-
x = model.addMatrixVar((n, n))
217-
218-
# Original sum via `np.ndarray.sum`, `np.sum` will call subclass method
219-
start_orig = time()
220-
np.ndarray.sum(x)
221-
end_orig = time()
222-
223-
# Optimized sum via `quicksum`
224-
start_matrix = time()
225-
x.sum()
226-
end_matrix = time()
227-
228-
assert model.isGT(end_orig - start_orig, end_matrix - start_matrix)
229-
230-
231213
def test_add_cons_matrixVar():
232214
m = Model()
233215
matrix_variable = m.addMatrixVar(shape=(3, 3), vtype="B", name="A", obj=1)

0 commit comments

Comments
 (0)