* 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. **/
| 198 | * is given by its LU-decomposition. |
| 199 | **/ |
| 200 | bool 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 */ |
| 217 | int rankFromRowEchelonForm(const matrix aMat) |
no test coverage detected