File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -4773,6 +4773,46 @@ def test_fq_default_poly():
47734773 assert raises (lambda : f .pow_trunc (- 1 , 5 ), ValueError )
47744774
47754775
4776+ def _test_R (R ):
4777+ # inverse_mod
4778+ while True :
4779+ # Ensure f is invertible
4780+ f = R .random_element ()
4781+ if not f .constant_coefficient ().is_zero ():
4782+ break
4783+ assert raises (lambda : f .inverse_mod (2 * f ), ValueError )
4784+
4785+
4786+ def test_1 ():
4787+ R = flint .fq_default_poly_ctx (5 )
4788+ _test_R (R )
4789+
4790+
4791+ def test_2 ():
4792+ R = flint .fq_default_poly_ctx (65537 )
4793+ _test_R (R )
4794+
4795+
4796+ def test_3 ():
4797+ R = flint .fq_default_poly_ctx (2 ** 127 - 1 )
4798+ _test_R (R )
4799+
4800+
4801+ def test_4 ():
4802+ R = flint .fq_default_poly_ctx (5 , 5 )
4803+ _test_R (R )
4804+
4805+
4806+ def test_5 ():
4807+ R = flint .fq_default_poly_ctx (65537 , 3 )
4808+ _test_R (R )
4809+
4810+
4811+ def test_6 ():
4812+ R = flint .fq_default_poly_ctx (2 ** 127 - 1 , 2 )
4813+ _test_R (R )
4814+
4815+
47764816def test_python_threads ():
47774817 #
47784818 # https://github.com/flintlib/python-flint/issues/224
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ cdef class _nmod_poly_sort_key:
5555 cdef nmod_poly p
5656 cdef ulong mult
5757 cdef slong len
58+
5859 def __init__ (self , tuple fac_m ):
5960 self .p = fac_m[0 ]
6061 self .len = nmod_poly_length(self .p.val)
You can’t perform that action at this time.
0 commit comments