@@ -1106,7 +1106,7 @@ cdef class fmpz_mod_poly(flint_poly):
1106
1106
)
1107
1107
return res
1108
1108
1109
- def mulmod (self , other , modulus ):
1109
+ def mul_mod (self , other , modulus ):
1110
1110
"""
1111
1111
Computes the multiplication of ``self`` with ``other``
1112
1112
modulo the polynomial ``modulus``
@@ -1117,7 +1117,7 @@ cdef class fmpz_mod_poly(flint_poly):
1117
1117
>>> g = 43*x**6 + 91*x**5 + 77*x**4 + 113*x**3 + 71*x**2 + 132*x + 60
1118
1118
>>> mod = x**4 + 93*x**3 + 78*x**2 + 72*x + 149
1119
1119
>>>
1120
- >>> f.mulmod (g, mod)
1120
+ >>> f.mul_mod (g, mod)
1121
1121
106*x^3 + 44*x^2 + 53*x + 77
1122
1122
"""
1123
1123
cdef fmpz_mod_poly res
@@ -1504,7 +1504,7 @@ cdef class fmpz_mod_poly(flint_poly):
1504
1504
>>> h = f.sqrt_trunc(5)
1505
1505
>>> h
1506
1506
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
1508
1508
True
1509
1509
1510
1510
"""
@@ -1647,38 +1647,6 @@ cdef class fmpz_mod_poly(flint_poly):
1647
1647
)
1648
1648
return res
1649
1649
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
-
1682
1650
def pow_trunc (self , slong e , slong n ):
1683
1651
"""
1684
1652
Returns ``self`` raised to the power ``e`` modulo `x^n`:
0 commit comments