optic.comm.fec.inverseMatrixGF2

inverseMatrixGF2(A)

Invert a square binary matrix over GF(2) using Gauss-Jordan elimination.

Parameters:

A (np.array of shape (n, n), dtype=np.uint8) – Binary square matrix.

Returns:

  • Ainv (np.array of shape (n, n), dtype=np.uint8) – Inverse of A over GF(2), if invertible. If not invertible, returns the identity matrix.

  • success (bool) – True if A is invertible, False otherwise.