lu2inv | R Documentation |
Invert a square matrix from its LU factorization.
lu2inv(x)
x |
object representing an LU factorization. This will typically have
come from a previous call to |
The inverse of the matrix whose LU factorization was given.
Unsuccessful results from the underlying LAPACK code will result in an
error giving a positive error code: these can only be interpreted by
detailed study of the Fortran
code.
This is an interface to the LAPACK routine DGETRI
. LAPACK is from
https://netlib.org/lapack/ and its guide is listed in the references.
Anderson. E., Bai, Z., Bischof, C., Blackford, S., Demmel, J., Dongarra, J., Du Croz, J., Greenbaum, A., Hammarling, S., McKenney, A. Sorensen, D. (1999). LAPACK Users' Guide, 3rd Edition. SIAM.
Golub, G.H., Van Loan, C.F. (1996). Matrix Computations, 3rd Edition. John Hopkins University Press.
lu
, solve
.
a <- matrix(c(3,2,6,17,4,18,10,-2,-12), ncol = 3)
z <- lu(a)
a %*% lu2inv(z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.