DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


LUdecomposition

Declaration: 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 to use LUPDecomposition (which performs partial pivoting).