View source: R/lu.decomposition.R
lu.decomposition | R Documentation |
This function performs an LU decomposition of the given square matrix argument the results are returned in a list of named components. The Doolittle decomposition method is used to obtain the lower and upper triangular matrices
lu.decomposition(x)
x |
a numeric square matrix |
The Doolittle decomposition without row exchanges is performed generating the lower and upper triangular matrices separately rather than in one matrix.
A list with two named components.
L |
The numeric lower triangular matrix |
U |
The number upper triangular matrix |
Frederick Novomestky fnovomes@poly.edu
Bellman, R. (1987). Matrix Analysis, Second edition, Classics in Applied Mathematics, Society for Industrial and Applied Mathematics.
Golub, G. H. and C. F. Van Loan (1996). Matrix Computations, Third Edition, John Hopkins University Press
Horn, R. A. and C. R. Johnson (1985). Matrix Analysis, Cambridge University Press.
A <- matrix( c ( 1, 2, 2, 1 ), nrow=2, byrow=TRUE) luA <- lu.decomposition( A ) L <- luA$L U <- luA$U print( L ) print( U ) print( L %*% U ) print( A ) B <- matrix( c( 2, -1, -2, -4, 6, 3, -4, -2, 8 ), nrow=3, byrow=TRUE ) luB <- lu.decomposition( B ) L <- luB$L U <- luB$U print( L ) print( U ) print( L %*% U ) print( B )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.