MCPcopy Create free account
hub / github.com/Singular/Singular / luInverse

Function luInverse

kernel/linear_algebra/linearAlgebra.cc:200–214  ·  view source on GitHub ↗

* This code first computes the LU-decomposition of aMat, * and then calls the method for inverting a matrix which * is given by its LU-decomposition. **/

Source from the content-addressed store, hash-verified

198 * is given by its LU-decomposition.
199 **/
200bool luInverse(const matrix aMat, matrix &iMat, const ring R)
201{ /* aMat is guaranteed to be an (n x n)-matrix */
202 matrix pMat;
203 matrix lMat;
204 matrix uMat;
205 luDecomp(aMat, pMat, lMat, uMat, R);
206 bool result = luInverseFromLUDecomp(pMat, lMat, uMat, iMat, R);
207
208 /* clean-up */
209 id_Delete((ideal*)&pMat,R);
210 id_Delete((ideal*)&lMat,R);
211 id_Delete((ideal*)&uMat,R);
212
213 return result;
214}
215
216/* Assumes that aMat is already in row echelon form */
217int rankFromRowEchelonForm(const matrix aMat)

Callers 1

jjLU_INVERSEFunction · 0.85

Calls 3

luDecompFunction · 0.85
luInverseFromLUDecompFunction · 0.85
id_DeleteFunction · 0.85

Tested by

no test coverage detected