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
