@@ -1106,7 +1106,7 @@ cdef class fmpz_mod_poly(flint_poly):
11061106 )
11071107 return res
11081108
1109- def mulmod (self , other , modulus ):
1109+ def mul_mod (self , other , modulus ):
11101110 """
11111111 Computes the multiplication of ``self`` with ``other``
11121112 modulo the polynomial ``modulus``
@@ -1117,7 +1117,7 @@ cdef class fmpz_mod_poly(flint_poly):
11171117 >>> g = 43*x**6 + 91*x**5 + 77*x**4 + 113*x**3 + 71*x**2 + 132*x + 60
11181118 >>> mod = x**4 + 93*x**3 + 78*x**2 + 72*x + 149
11191119 >>>
1120- >>> f.mulmod (g, mod)
1120+ >>> f.mul_mod (g, mod)
11211121 106*x^3 + 44*x^2 + 53*x + 77
11221122 """
11231123 cdef fmpz_mod_poly res
@@ -1504,7 +1504,7 @@ cdef class fmpz_mod_poly(flint_poly):
15041504 >>> h = f.sqrt_trunc(5)
15051505 >>> h
15061506 82*x^4 + 162*x^3 + x^2 + x + 1
1507- >>> h.mulmod (h, x**5) == f
1507+ >>> h.mul_mod (h, x**5) == f
15081508 True
15091509
15101510 """
@@ -1647,38 +1647,6 @@ cdef class fmpz_mod_poly(flint_poly):
16471647 )
16481648 return res
16491649
1650- def mul_mod (self , other , modulus ):
1651- r """
1652- Returns remainder of the product of ``self`` with ``other`` after reduction by ``modulus``
1653-
1654- Equivalent to computing `f( x) \c dot g( x) \m od x^ n`
1655-
1656- >>> R = fmpz_mod_poly_ctx( 163)
1657- >>> f = R( [2,3,5,7,11 ])
1658- >>> g = R( [1,2,4,8,16 ])
1659- >>> h = R( [1,0,1 ])
1660- >>> f. mul_mod( g, h) == ( f * g) % h
1661- True
1662- >>> f. mul_mod( g, h)
1663- 63* x + 80
1664- """
1665- # Only allow multiplication and reduction with other fmpz_mod_poly
1666- if not typecheck(other, fmpz_mod_poly) or not typecheck(modulus, fmpz_mod_poly):
1667- raise TypeError (" input polynomials must be of type fmpz_mod_poly" )
1668-
1669- # Ensure the contexts match
1670- other_c = < fmpz_mod_poly> other
1671- modulus_c = < fmpz_mod_poly> modulus
1672- if (self .ctx != other_c.ctx) or (self .ctx != modulus_c.ctx):
1673- raise ValueError (" other polynomial's context does not match" )
1674-
1675- cdef fmpz_mod_poly res
1676- res = self .ctx.new_ctype_poly()
1677- fmpz_mod_poly_mulmod(
1678- res.val, self .val, other_c.val, modulus_c.val, res.ctx.mod.val
1679- )
1680- return res
1681-
16821650 def pow_trunc (self , slong e , slong n ):
16831651 """
16841652 Returns ``self`` raised to the power ``e`` modulo `x^n`:
0 commit comments