flintlib / flint

FLINT (Fast Library for Number Theory)
http://www.flintlib.org
GNU Lesser General Public License v3.0
424 stars 241 forks source link

Flesh out fmpz_mod_mat module #715

Open wbhart opened 4 years ago

wbhart commented 4 years ago

It has some basic things, but many of the things in nmod_mat are still missing.

dlesnoff commented 1 year ago

https://www.flintlib.org/doc/nmod_mat.html https://www.flintlib.org/doc/fmpz_mod_mat.html

fmpz_mod_mat_print_pretty does not output the dimensions of the matrix while nmod_mat_print_pretty does. fmpz_mod_mat_equal does not appear on the online documentation but is present in the code source. Which PR added it? Why is it not in the documentation?

There is only fmpz_mod_mat_randtest and I do not see fmpz_mod_mat_randfull? I wish random function would not generate sparse matrices (with probability ½) by default. If there are still other missing functions that I did not see, I would gladly implement them and open a PR.

fredrik-johansson commented 1 year ago

Feel free to do a PR to fix such issues!

Another issue is that some methods don't use a context object, but probably should.

randtest methods are specifically intended to produce non-uniform inputs (sparse matrices are far more likely than dense matrices to hit corner cases in many algorithms); there should indeed be separate functions for creating uniformly random matrices.

fredrik-johansson commented 1 year ago

Also consider using gr_mat with the fmpz_mod base ring. This provides a more consistent interface, and more performant too for some tasks.