Contents
ALGORITHMS
Site map
Links
Site and author
News
About the site
FAQ
Contact
TERMS OF USE
Contents - Matrix and vector operations - Operations on general matrices - LU decomposition of a rectangular matrix

LU decomposition of a rectangular matrix

The subroutine performs the LU decomposition of a rectangular general matrix with partial pivoting (with rows permutations).

LU decomposition

The LU decomposition of a rectangular matrix A of size MxN is a representation of matrix A as a product of permutation matrix P, lower triangular matrix L with unit diagonal (or lower trapezoid matrix, if M > N) and upper triangular matrix U (or upper trapezoid matrix, if M > N):

A = PLU

This representation is often used when solving systems of linear equations, finding matrix condition numbers, inverting matrices and so on.

To perform a decomposition, the Crout algorithm with pivoting is used. It should be taken into account that the matrix A is not represented as the product of L and U, but a certain permutation of A which is given by matrix P.

Subroutine description

The RMatrixLU subroutine uses matrix A as the input and returns its LU decomposition. In this case, the matrices L and U replace matrix A as follows, and the permutation matrix is saved in Pivots array.

A11 A12 A13   =>    U11 U12 U13
A21 A22 A23   =>    L21 U22 U23
A31 A32 A33   =>    L31 L32 U33
A41 A42 A43   =>    L41 L42 L43

This algorithm is transferred from the LAPACK library.

Report a bug

Source codes

C#

C# 1.0 source.
lu.csharp.zip - LU decomposition of a rectangular matrix


C++

C++ source.
lu.cpp.zip - LU decomposition of a rectangular matrix
ablas.zip - optimized basic linear algebra subroutines with SSE2 support (for C++ sources only)


C++, multiple precision arithmetic

C++ source. MPFR/GMP is used.
GMP source is available from gmplib.org. MPFR source is available from www.mpfr.org.
lu.mpfr.zip - LU decomposition of a rectangular matrix
mpfr.zip - precompiled Win32 MPFR/GMP binaries


Delphi

Delphi source.
Can be compiled under FPC (in Delphi compatibility mode).
lu.delphi.zip - LU decomposition of a rectangular matrix


Visual Basic 6

Visual Basic 6 source.
lu.vb6.zip - LU decomposition of a rectangular matrix


Zonnon beta

Zonnon source.
Zonnon is an experimental language developed at ETH Zurich.
See www.zonnon.ethz.ch for more information.
lu.zonnon.zip - LU decomposition of a rectangular matrix



 
 
Sergey Bochkanov, Vladimir Bystritsky
Copyright © 1999-2008