# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1284839883 7200
# Node ID 0ccac25fd82fb088e24412aed8d6a2741889501f
# Parent 61f9d3d455ee83e7c977d4f70628f268b6ea5fea
#4000: Fix PARI error in hensel_lift()
diff r 61f9d3d455ee r 0ccac25fd82f sage/rings/polynomial/polynomial_rational_flint.pyx
a

b


1528  1528  
1529  1529  def hensel_lift(self, p, e): 
1530  1530  r""" 
1531   Assuming that this polynomial factors modulo `p` into distinct 
1532   factors, computes the Hensel lifts of these factors modulo `p^e`. 
1533   We assume that self has integer coefficients. 
 1531  Assuming that this polynomial factors modulo `p` into distinct 
 1532  monic factors, computes the Hensel lifts of these factors modulo 
 1533  `p^e`. We assume that ``self`` has integer coefficients. 
1534  1534  
1535  1535  Returns an empty list if this polynomial has degree less than one. 
1536  1536  
… 
… 

1549  1549  sage: R((x1)*(x+1)).hensel_lift(7, 2) 
1550  1550  [x + 1, x + 48] 
1551  1551  
 1552  If the input polynomial `f` is not monic, we get a factorization of 
 1553  `f / lc(f)`:: 
 1554  
 1555  sage: R(2*x^2  2).hensel_lift(7, 2) 
 1556  [x + 1, x + 48] 
 1557  
1552  1558  TESTS:: 
1553  1559  
1554  1560  sage: R.<x> = QQ[] 
… 
… 

1584  1590  if n > 1: 
1585  1591  raise ArithmeticError, ("The polynomial must be square free " + 
1586  1592  "modulo p") 
1587   y.append(g) 
 1593  y.append(self.parent()(g)) 
1588  1594  H = self._pari_().polhensellift(y, p, e) 
1589  1595  R = IntegerModRing(p**e) 
1590  1596  S = R[self.parent().variable_name()] 
1591   return [S(eval(str(m.Vec().Polrev().Vec()))) for m in H] 
 1597  return [S(m) for m in H] 
1592  1598  
1593  1599  def discriminant(self): 
1594  1600  r""" 