FLINT3.7.0-dev

fmpq_mat_set_fmpz_mat_mod_fmpz

Synopsis#include <flint/fmpq_mat.h>
int fmpq_mat_set_fmpz_mat_mod_fmpz(fmpq_mat_t X, const fmpz_mat_t Xmod, const fmpz_t mod)source

Sets X to the rational matrix congruent to Xmod modulo mod whose entries are obtained by rational reconstruction with balanced bounds (_fmpq_reconstruct_fmpz, Rational reconstruction), using a running common denominator: each entry is multiplied by the product of the denominators found so far before it is reconstructed. Returns 1 on success and 0 if some entry cannot be reconstructed, in which case X is partially written. The result is correct if every numerator and every partial common denominator is less than \sqrt{\mathit{mod}/2}.

Guides#

Cite this page

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