Macaulay2 Engine
Loading...
Searching...
No Matches

◆ rank() [2/5]

size_t MatrixOps::rank ( const DMatQQFlint & A)
inline

Definition at line 1096 of file mat-linalg.hpp.

1097{
1098 // fmpq_mat has no rank function.
1099 // So we clear denominators row-wise (or column-wise), and compute the rank of
1100 // that matrix.
1101 fmpz_mat_t m1;
1102 fmpz_mat_init(m1, A.numRows(), A.numColumns());
1103 fmpq_mat_get_fmpz_mat_rowwise(m1, nullptr, A.fmpq_mat());
1104 // fmpz_mat_print_pretty(m1);
1105 size_t rk = fmpz_mat_rank(m1);
1106 fmpz_mat_clear(m1);
1107 return rk;
1108}
const fmpq_mat_t & fmpq_mat() const

References DMat< M2::ARingQQFlint >::fmpq_mat(), DMat< M2::ARingQQFlint >::numColumns(), and DMat< M2::ARingQQFlint >::numRows().