The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



LUPDecomposition


Unit:SDL_openarrays
Class: none
Declaration: function LUPdecomposition (Data: TDouble2DArray; var MatL, MatU: TDouble2DArray; var MatP: TInt2DArray; var NumPerm: integer): integer;

The function LUPDecomposition decomposes the square matrix Data into two triangular matrices MatL and MatU and the permutation matrix MatP, with the matrix MatL being the lower triangular matrix (containing all 1s in the diagonal), and MatU the upper triangular matrix. The variable parameter NumPerm returns the number of exchanged rows.

The figure below shows the LUP decomposition of a matrix of order 5 with the rows 3 and 4 exchanged.

The function returns the following error codes:

 0 ... everything is OK
-1 ... the data matrix is not square
-2 ... the data matrix is singular

Hint: Please note that the function LUPDecomposition uses partial pivoting and thus has a higher precision (less rounding errors) than the function LUDecomposition



Last Update: 2023-Dec-10