LU decomposition
(Quaternion and octonion overloadings of standard MATLAB® function)
[L,U,P] = lu(A)
The third output parameter is optional. Computes a decomposition such that P * A = L * U, where L and U are lower and upper triangular respectively.
If the third output parameter is omitted, the result in L will be permuted so that A = L * U. This behaviour matches that of the corresponding MATLAB® function.
The LU decomposition is not guaranteed to exist for all quaternion matrices. At present there is no checking for zero divisors or divisors of zero during the Gaussian elimination steps, and consequently the results returned may contain NaNs without warning. The same applies to octonion matrices.
The algorithm used includes partial pivoting and is based on that described by Golub and van Loan for real matrices.