| 228 | } |
| 229 | |
| 230 | int luRank(const matrix aMat, const bool isRowEchelon, const ring R) |
| 231 | { |
| 232 | if (isRowEchelon) return rankFromRowEchelonForm(aMat); |
| 233 | else |
| 234 | { /* compute the LU-decomposition and read off the rank from |
| 235 | the upper triangular matrix of that decomposition */ |
| 236 | matrix pMat; |
| 237 | matrix lMat; |
| 238 | matrix uMat; |
| 239 | luDecomp(aMat, pMat, lMat, uMat,R); |
| 240 | int result = rankFromRowEchelonForm(uMat); |
| 241 | |
| 242 | /* clean-up */ |
| 243 | id_Delete((ideal*)&pMat,R); |
| 244 | id_Delete((ideal*)&lMat,R); |
| 245 | id_Delete((ideal*)&uMat,R); |
| 246 | |
| 247 | return result; |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | bool upperRightTriangleInverse(const matrix uMat, matrix &iMat, |
| 252 | bool diagonalIsOne, const ring R) |
no test coverage detected