Skip to content

Conversation

@dlesnoff
Copy link
Contributor

@dlesnoff dlesnoff commented Oct 27, 2025

I tried to improve in this pull request the random generation functions for matrices mod n.
Partially answers #2424 #715
I added documentation for the fmpz_randtest function. Only the unsigned variant was documented.
I had to update fmpz_mat_randtest to generate sparse matrices with increased probability, so that fmpz_mod_mat_randtest also generates sparse matrices with increased probability.
I made sure that the new fmpz_mod_mat_randfull does not generate zero to check for overflows.
Most importantly, we have now fmpz_mod_vec_randunif and fmpz_mod_mat_randunif which generates fully dense coefficients uniformly with potential zero coefficients.
I will perform polynomial in another PR.

@dlesnoff dlesnoff marked this pull request as draft October 27, 2025 15:22
@fredrik-johansson
Copy link
Collaborator

Minor naming thing: I prefer random over randunif.

@vneiger vneiger changed the title Fmpz mod mat randunif and randfull functions Fmpz mod mat rand and randfull functions Oct 27, 2025
Co-authored-by: Vincent Neiger <[email protected]>
@dlesnoff dlesnoff force-pushed the fmpz_mod_mat_randfull branch from fe74c71 to 2ff76f1 Compare October 28, 2025 09:45
@dlesnoff dlesnoff marked this pull request as ready for review October 28, 2025 10:36
@vneiger
Copy link
Collaborator

vneiger commented Oct 28, 2025

The last changes look good to me. When CI completes, ok to merge.

@vneiger vneiger merged commit 27e44f6 into flintlib:main Oct 28, 2025
14 checks passed
@dlesnoff dlesnoff deleted the fmpz_mod_mat_randfull branch October 29, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants