Title: | Working with Matrices over Finite Prime Fields |
---|---|
Description: | Provides functions for row-reducing and inverting matrices with entries in many of the finite fields (those with a prime number of elements). With this package, users will be able to find the reduced row echelon form (RREF) of a matrix and calculate the inverse of a (square, invertible) matrix. |
Authors: | Ryan Higginbottom [aut, cre, cph] |
Maintainer: | Ryan Higginbottom <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.2.0 |
Built: | 2024-11-13 06:14:25 UTC |
Source: | https://github.com/rhigginbottom/matrixmodp |
inv_p()
finds the inverse of a square matrix over the field . The function checks for invertibility and then row-reduces the augmented matrix
over
to find the inverse.
inv_p(A, p)
inv_p(A, p)
A |
A square matrix |
p |
A prime integer |
A square matrix of the same size as A
B <- matrix(c(5, 2, 3, 6, 5, 5, 4, 0, 2), 3, 3) inv_p(B, 7) C <- matrix(c(3, 0, 4, 0, 2, 1, 1, 3, 0, 3, 0, 1, 3, 0, 2, 1), 4, 4) inv_p(C, 5)
B <- matrix(c(5, 2, 3, 6, 5, 5, 4, 0, 2), 3, 3) inv_p(B, 7) C <- matrix(c(3, 0, 4, 0, 2, 1, 1, 3, 0, 3, 0, 1, 3, 0, 2, 1), 4, 4) inv_p(C, 5)
rref_p()
calculates the unique reduced-row echelon form of a matrix with entries in the finite field .
rref_p(A, p)
rref_p(A, p)
A |
A matrix |
p |
A prime integer |
A matrix of the same size as A
which is the unique reduced-row echelon form of A
.
B <- matrix(c(3, 4, 1, 3, 2, 0), 2, 3) rref_p(B, 5) C <- matrix(c(0, 2, 0, 0, 0, 2, 0, 1, 1), 3, 3) rref_p(C, 3)
B <- matrix(c(3, 4, 1, 3, 2, 0), 2, 3) rref_p(B, 5) C <- matrix(c(0, 2, 0, 0, 0, 2, 0, 1, 1), 3, 3) rref_p(C, 3)