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....



LUDecomposition


Unit:SDL_openarrays
Class: none
Declaration: function LUdecomposition (Data: TDouble2DArray; var MatL, MatU: TDouble2DArray): integer;

The function LUDecomposition decomposes the square matrix Data into two triangular matrices MatL and MatU, with the matrix MatL being the lower triangular matrix (containing all 1s in the diagonal), and matrix MatU being the upper triangular matrix. The figure below shows the LU decomposition of a matrix of order 5.

LUDECOMP.gif

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 this function does no pivoting which may result in increased round-off errors, especially for large arrays. If you need a better accuracy you may consider either LUPDecomposition (which performs partial pivoting) or TMatrix.LUDecomposition (which uses Crout's algorithm)



Last Update: 2023-Dec-10