fmpq_mat_set_fmpz_mat_mod_fmpz
#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)sourceSets 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#
- Exact linear algebra over the integers (
fmpz_mat)
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).
@misc{flint-doc-fmpq-mat-fmpq-mat-set-fmpz-mat-mod-fmpz,
author = {{The FLINT team}},
title = {{fmpq\_mat\_set\_fmpz\_mat\_mod\_fmpz (fmpq\_mat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpq_mat/fmpq_mat_set_fmpz_mat_mod_fmpz.html},
note = {Generated 2026-10-20}
}