|Description||The inverse of the matrix MA is stored in MInv. If MA is non-invertible, the function fails with an error message. Internally, inversion is accomplished via LU decomposition.
In order to prevent the function from failing, you can define a minimum pivot for the decomposition. If you wish to do so for all calls to MF_LUdecompose and to the functions based upon it, namely MF_inv and MF_solve, you can do so by calling MF_LUDsetEdit. However, as this method is not thread-safe, you cannot use it in order to set different thresholds for different calls to the functions mentioned. Instead of defining a default editing threshold then, use their "wEdit" variants, i.e. MF_LUdecomposewEdit, MF_invwEdit or MF_solvewEdit. They take the desired threshold as the additional argument thresh. Note that thresh is always real, also in the complex versions.
The return value of MF_inv and MF_invwEdit indicates if the inversion was successful:
|0||Matrix MA is regular; inversion successful|
|1||Matrix MA is singular; result matrix contains no useful information|
|2||Matrix MA is (nearly) singular; could be inverted only by pivot editing; if the result is still useful, depends on the specific application.|
To check if MF_inv was successful, in single-thread programs, you may also call MF_LUDresult, whose return value will be FALSE (0), if the MA could be inverted without problems (and without pivot editing), and TRUE (1) for singular MA. In multi-thread programs, on the other hand, it would not be clear wich instance of MF_inv the call to MF_LUDresult would refer to. So, here, inspection of the return value of MF_inv is the only option.