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

Function rankFromRowEchelonForm

kernel/linear_algebra/linearAlgebra.cc:217–228  ·  view source on GitHub ↗

Assumes that aMat is already in row echelon form */

Source from the content-addressed store, hash-verified

215
216/* Assumes that aMat is already in row echelon form */
217int 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
230int luRank(const matrix aMat, const bool isRowEchelon, const ring R)
231{

Callers 1

luRankFunction · 0.85

Calls 2

rowsMethod · 0.80
colsMethod · 0.80

Tested by

no test coverage detected