Assumes that aMat is already in row echelon form */
| 215 | |
| 216 | /* Assumes that aMat is already in row echelon form */ |
| 217 | int rankFromRowEchelonForm(const matrix aMat) |
| 218 | { |
| 219 | int rank = 0; |
| 220 | int rr = aMat->rows(); int cc = aMat->cols(); |
| 221 | int r = 1; int c = 1; |
| 222 | while ((r <= rr) && (c <= cc)) |
| 223 | { |
| 224 | if (MATELEM(aMat, r, c) == NULL) c++; |
| 225 | else { rank++; r++; } |
| 226 | } |
| 227 | return rank; |
| 228 | } |
| 229 | |
| 230 | int luRank(const matrix aMat, const bool isRowEchelon, const ring R) |
| 231 | { |