FLINT3.7.0-dev

fmpz_mat_multi_mod_ui, fmpz_mat_multi_mod_ui_precomp

Synopsis#include <flint/fmpz_mat.h>
void fmpz_mat_multi_mod_ui(nmod_mat_t * residues, slong nres, const fmpz_mat_t mat)source
void fmpz_mat_multi_mod_ui_precomp(nmod_mat_t * residues, slong nres, const fmpz_mat_t mat, const fmpz_comb_t comb)source

Reduces mat modulo the moduli of the nres matrices residues, which must be initialised with the dimensions of mat and pairwise coprime moduli, writing the residues into them. The precomp variant uses a comb precomputed with fmpz_comb_init for the same moduli in the same order; comb may be NULL.

The reduction uses the subproduct tree of fmpz_comb_t, so that reducing an entry of b bits modulo k word-size moduli costs about M(b) \log k instead of kb word operations. Rows are distributed over threads when the number of entries times the number of moduli is large enough.

Guides#

Cite this page

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