From f8441e5642c2fbba96007108ac7d3c84537eef3e Mon Sep 17 00:00:00 2001 From: Dimitri LESNOFF Date: Mon, 27 Oct 2025 11:12:12 +0100 Subject: [PATCH 1/4] Add fmpz_mod_mat_equal to the fmpz_mod_mat API documentation --- doc/source/fmpz_mod_mat.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/source/fmpz_mod_mat.rst b/doc/source/fmpz_mod_mat.rst index e667b240b0..658010d1c9 100644 --- a/doc/source/fmpz_mod_mat.rst +++ b/doc/source/fmpz_mod_mat.rst @@ -144,6 +144,11 @@ Input and output Comparison -------------------------------------------------------------------------------- +.. function:: int fmpz_mod_mat_equal(const nmod_mat_t mat1, const nmod_mat_t mat2) + + Returns nonzero if ``mat1`` and ``mat2`` have the same dimensions and elements, + and zero otherwise. The moduli are ignored. Coefficients are assumed to be reduced. + .. function:: int fmpz_mod_mat_is_zero(const fmpz_mod_mat_t mat, const fmpz_mod_ctx_t ctx) From 65dd4ea545229a685f4e104938cb1d45995be6eb Mon Sep 17 00:00:00 2001 From: Dimitri LESNOFF Date: Mon, 27 Oct 2025 12:01:41 +0100 Subject: [PATCH 2/4] Fix documentation --- doc/source/fmpz_mod_mat.rst | 9 +++++++-- doc/source/nmod_mat.rst | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/source/fmpz_mod_mat.rst b/doc/source/fmpz_mod_mat.rst index 658010d1c9..ff46a73785 100644 --- a/doc/source/fmpz_mod_mat.rst +++ b/doc/source/fmpz_mod_mat.rst @@ -2,6 +2,7 @@ **fmpz_mod_mat.h** -- matrices over integers mod n =============================================================================== +Unless indicated, functions may assume that the stored values are in the range `[0, n)`. The user can manipulate matrix entries directly, but must assume responsibility for normalising all values to the range `[0, n)`. Types, macros and constants ------------------------------------------------------------------------------- @@ -91,6 +92,10 @@ Basic manipulation Random generation -------------------------------------------------------------------------------- +.. function:: void fmpz_mod_mat_randfull(fmpz_mod_mat_t mat, flint_rand_t state, const fmpz_mod_ctx_t ctx) + + Generate a random matrix with the existing dimensions and entries in + `[0, n)` where ``n`` is the modulus. .. function:: void fmpz_mod_mat_randtest(fmpz_mod_mat_t mat, flint_rand_t state, const fmpz_mod_ctx_t ctx) @@ -144,10 +149,10 @@ Input and output Comparison -------------------------------------------------------------------------------- -.. function:: int fmpz_mod_mat_equal(const nmod_mat_t mat1, const nmod_mat_t mat2) +.. function:: int fmpz_mod_mat_equal(const fmpz_mod_mat_t mat1, const fmpz_mod_mat_t mat2, const fmpz_mod_ctx_t ctx) Returns nonzero if ``mat1`` and ``mat2`` have the same dimensions and elements, - and zero otherwise. The moduli are ignored. Coefficients are assumed to be reduced. + and zero otherwise. The moduli are ignored. .. function:: int fmpz_mod_mat_is_zero(const fmpz_mod_mat_t mat, const fmpz_mod_ctx_t ctx) diff --git a/doc/source/nmod_mat.rst b/doc/source/nmod_mat.rst index b1da8f22ca..5d2e0ebca1 100644 --- a/doc/source/nmod_mat.rst +++ b/doc/source/nmod_mat.rst @@ -31,8 +31,7 @@ perform some kind of division, solving, or Gaussian elimination in functions that only perform basic manipulation and ring operations (e.g. transpose and matrix multiplication). -The user can manipulate matrix entries directly, but must assume -responsibility for normalising all values to the range `[0, n)`. +Unless indicated, functions may assume that the stored values are in the range `[0, n)`. The user can manipulate matrix entries directly, but must assume responsibility for normalising all values to the range `[0, n)`. Types, macros and constants ------------------------------------------------------------------------------- From 2283fd0fd68dea4ec4dd6ced5fade5acd74c0854 Mon Sep 17 00:00:00 2001 From: Dimitri LESNOFF Date: Mon, 27 Oct 2025 13:27:25 +0100 Subject: [PATCH 3/4] Remove fmpz_mod_mat_randfull --- doc/source/fmpz_mod_mat.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doc/source/fmpz_mod_mat.rst b/doc/source/fmpz_mod_mat.rst index ff46a73785..3771e3ffb5 100644 --- a/doc/source/fmpz_mod_mat.rst +++ b/doc/source/fmpz_mod_mat.rst @@ -92,11 +92,6 @@ Basic manipulation Random generation -------------------------------------------------------------------------------- -.. function:: void fmpz_mod_mat_randfull(fmpz_mod_mat_t mat, flint_rand_t state, const fmpz_mod_ctx_t ctx) - - Generate a random matrix with the existing dimensions and entries in - `[0, n)` where ``n`` is the modulus. - .. function:: void fmpz_mod_mat_randtest(fmpz_mod_mat_t mat, flint_rand_t state, const fmpz_mod_ctx_t ctx) Generate a random matrix with the existing dimensions and entries in From 04572fdc6711a73e8004d7adaf6e13fdc1bbe7c5 Mon Sep 17 00:00:00 2001 From: Dimitri LESNOFF Date: Mon, 27 Oct 2025 13:27:25 +0100 Subject: [PATCH 4/4] Remove fmpz_mod_mat_randfull --- doc/source/fmpz_mod_mat.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/fmpz_mod_mat.rst b/doc/source/fmpz_mod_mat.rst index 3771e3ffb5..896407d98e 100644 --- a/doc/source/fmpz_mod_mat.rst +++ b/doc/source/fmpz_mod_mat.rst @@ -92,6 +92,7 @@ Basic manipulation Random generation -------------------------------------------------------------------------------- + .. function:: void fmpz_mod_mat_randtest(fmpz_mod_mat_t mat, flint_rand_t state, const fmpz_mod_ctx_t ctx) Generate a random matrix with the existing dimensions and entries in