Skip to content

Commit

Permalink
Test ignored arguments for rank.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmtroffaes committed Sep 18, 2024
1 parent badc20e commit a7af3b3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test_matrix_rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,23 @@ def test_matrix_rank_1(
basis_cols,
rank,
)


def test_matrix_rank_2() -> None:
# check ignored_cols and ignored_rows
assert cdd.matrix_rank(
cdd.matrix_from_array([[0, 1], [1, 0]]), ignored_rows={0}
) == ({1}, {0}, 1)
assert cdd.matrix_rank(
cdd.matrix_from_array([[0, 1], [1, 0]]), ignored_cols={0}
) == ({0}, {1}, 1)
assert cdd.matrix_rank(
cdd.matrix_from_array([[1, 0, 0], [0, 0, 1], [0, 1, 0]]),
ignored_rows={1},
ignored_cols={2},
) == ({0, 2}, {0, 1}, 2)
assert cdd.matrix_rank(
cdd.matrix_from_array([[1, 1, 0], [0, 0, 1], [2, 2, 0], [0, 1, 0]]),
ignored_rows={1},
ignored_cols={2},
) == ({0, 3}, {0, 1}, 2)

0 comments on commit a7af3b3

Please sign in to comment.