lu.decomposition: LU Decomposition of Square Matrix

View source: R/lu.decomposition.R

lu.decompositionR Documentation

LU Decomposition of Square Matrix

Description

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

Usage

lu.decomposition(x)

Arguments

x

a numeric square matrix

Details

The Doolittle decomposition without row exchanges is performed generating the lower and upper triangular matrices separately rather than in one matrix.

Value

A list with two named components.

L

The numeric lower triangular matrix

U

The number upper triangular matrix

Author(s)

Frederick Novomestky fnovomes@poly.edu

References

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.

Examples

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 )

matrixcalc documentation built on Sept. 15, 2022, 1:05 a.m.