flint icon indicating copy to clipboard operation
flint copied to clipboard

Ensure all nmod-type functions works with intended range of modulo

Open albinahlback opened this issue 1 year ago • 2 comments

For instance, nmod_mat_one does not work with modulo 1. I'm sure that this is the only modulus that is problematic.

Personally, I don't think we should allow modulo 1 since that only yield trivial results. Not sure how wide-spread this is.

Edit: nmod_mat_randfull is also problematic.

albinahlback avatar May 05 '24 22:05 albinahlback

We should implement functions such as nmod_mat_is_canonical, just like fmpz_is_canonical.

albinahlback avatar May 05 '24 22:05 albinahlback

Personally, I don't think we should allow modulo 1 since that only yield trivial results.

It is useful, just like it is useful to allow the 0 x 0 matrix, empty set, etc. For example, a user who CRTs results mod m1, m2, m3, ... might start with 1 as an initial value.

fredrik-johansson avatar May 06 '24 07:05 fredrik-johansson