Skip to content

Commit

Permalink
Add unit test for #476
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed May 2, 2023
1 parent 09926f2 commit c882d72
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/fields/test_linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,28 @@ def test_plu_decompose(field_plu_decompose):
assert type(u) is GF


def test_bug_476():
"""
See https://github.com/mhostetter/galois/issues/476.
"""
GF = galois.GF(2)
A = GF(
[
[1, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 0, 1],
[1, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0],
[0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 0, 1],
]
)
P, L, U = A.plu_decompose()
PLU = P @ L @ U
assert np.array_equal(A, PLU)


def test_matrix_inverse_exceptions():
GF = galois.GF(2**8)
with pytest.raises(np.linalg.LinAlgError):
Expand Down

0 comments on commit c882d72

Please sign in to comment.