Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Fix ignoring non-monics with all coefficients divisible by uniformize…
Browse files Browse the repository at this point in the history
…r. Fixes in FrameElt.
  • Loading branch information
sebejias committed Jan 7, 2014
1 parent 61d57ef commit 0ec528d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/sage/rings/polynomial/padics/factor/factoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def dist_den(facts,multval):
if multval > 0:
uni = Kx(uni)
facts = [Kx(fact) for fact in facts]
if multval < 0:
uni = uni * f.base_ring().uniformizer() ** -multval
return Factorization([(uni,1)]+[(fact,1) for fact in facts])

def pfactor(Phi):
Expand Down
6 changes: 3 additions & 3 deletions src/sage/rings/polynomial/padics/factor/frameelt.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,15 @@ def polynomial(self,denominator=False):
sage: fe1.polynomial()
(6 + O(2^20))*x^2 + (0 + O(2^20))*x + (1 + O(2^20))
"""
if min([a._exponent for a in self.terms]) < 0:
raise ValueError, "Cannot cconstruct polynomial representation of FrameElt with negative exponents"
if denominator:
piexp = self.find_denominator()
if piexp < 0:
return (self * FrameElt(self.frame,self.frame.Ox(self.frame.O.uniformizer()**(-piexp)))).polynomial(),-piexp
else:
return self.polynomial(),0
else:
if min([a._exponent for a in self.terms]) < 0:
raise ValueError, "Cannot construct polynomial representation of FrameElt over Zp with negative exponents without denominator flag"
if self.frame.is_first():
return self.frame.O.uniformizer()**int(self.terms[0]._exponent)*self.terms[0]._unit
else:
Expand Down Expand Up @@ -862,7 +862,7 @@ def is_reduced(self):
"""
if self.frameelt.frame.prev is None:
return True
if self._exponent < self.frameelt.frame.prev.segment.Eplus:
if self._exponent < self.frameelt.frame.prev.segment.Eplus * self.frameelt.frame.prev.Fplus:
return self._coefficient.is_reduced()
return False

Expand Down

0 comments on commit 0ec528d

Please sign in to comment.