Invert the matrix using Gaussian elimination

invmatrix(m)

Arguments

m

a matrix

Value

the inverted matrix

Details

invmatrix invertse the given matrix using Gaussian elimination and returns the result.

See also

Examples

A <- matrix(c(1, 2, -7, -1, -1, 1, 2, 1, 5), 3)
refmatrix(A)
#>      [,1] [,2] [,3]
#> [1,]    1   -1    2
#> [2,]    0    1   -3
#> [3,]    0    0    1