Description | MA is decomposed into a product MA = L * U, where L is lower-triangular with the diagonal elements equal to 1, and U is upper-triangular. As the combined number of non-trivial elements of L and U just fit into a matrix of the same dimensions as MA, the result is stored in a single matrix MLU rather than in to distinct matrices L and U. Actually, it is not the "true" matrices L and U which are combined into MLU, but rather a row-wise permutation, whose indices are output in the vector *Ind*. The return value indicates if the number of permuations was even (+1) or uneven (-1).
MA may or may not be overwritten by MLU. To check if *MF_LUdecompose* was successful, call *MF_LUDresult*, whose return value will be FALSE (0), if the MA could be decomposed, and TRUE (1) for singular MA.
There are applications where it makes sense to make near-singular matrices decomposable by "pivot editing": If, in the partial pivoting process employed in the decomposition and inversion, no diagonal element larger than the threshold is available, the scaling of the matrix is done with the threshold value rather than with the tiny diagonal element. That way, divisions by (near-)zero are avoided. This pivot editing can be chosen through a call to *MF_LUDsetEdit*. By default, pivot editing is switched off.
Please note that the present implementation of this function does not employ the fastest possible algorithm. In order to avoid excessive accumulation of round-off error, all dot products are internally summed up in double or extended precision, thus precluding the use of the faster SIMD instructions. |