FLINT3.7.0-dev

fmpq_mat_rref, fmpq_mat_rref_classical, fmpq_mat_rref_fraction_free

Synopsis#include <flint/fmpq_mat.h>
slong fmpq_mat_rref(fmpq_mat_t B, const fmpq_mat_t A)source
slong fmpq_mat_rref_classical(fmpq_mat_t B, const fmpq_mat_t A)source
slong fmpq_mat_rref_fraction_free(fmpq_mat_t B, const fmpq_mat_t A)source

Sets B to the reduced row echelon form of A and returns the rank. B may be A. fmpq_mat_rref_classical uses Gauss–Jordan elimination with rational arithmetic; fmpq_mat_rref_fraction_free clears the denominators of the rows and calls fmpz_mat_rref. fmpq_mat_rref uses the classical algorithm if A has at most 2 rows or columns and the fraction-free one otherwise.

Cite this page

The FLINT team, “fmpq_mat_rref, fmpq_mat_rref_classical, fmpq_mat_rref_fraction_free (fmpq_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpq_mat/fmpq_mat_rref.html (generated 2026-10-20).