#4038: [with patch, needs review] Problem in factor() and roots() for p-adic
polynomials
---------------------------------+------------------------------------------
Reporter: cremona | Owner: malb
Type: defect | Status: new
Priority: major | Milestone: sage-3.4
Component: commutative algebra | Resolution:
Keywords: polynomial p-adic |
---------------------------------+------------------------------------------
Changes (by cremona):
* summary: Problem in factor() and roots() for p-adic polynomials =>
[with patch, needs review] Problem in factor()
and roots() for p-adic polynomials
Comment:
In 3.2.2 the error message changes to:
{{{
sage: g.factor()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/home/jec/.sage/temp/host_57_89/5017/_home_jec__sage_init_sage_0.py in
<module>()
----> 1
2
3
4
5
/home/jec/sage-3.2.2/local/lib/python2.5/site-
packages/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.pyc
in factor(self)
1009 R = ZpCA(base.prime(), prec = m)
1010 S = PolynomialRing(R, self.parent().variable_name())
-> 1011 F = S(self).factor()
1012 return Factorization([(self.parent()(a), b) for (a, b) in
F], base(F.unit()))
1013
/home/jec/sage-3.2.2/local/lib/python2.5/site-
packages/sage/rings/polynomial/padics/polynomial_padic_flat.pyc in
factor(self, absprec)
133 lval = F[i][0].leading_coefficient().valuation()
134 if upart != 1:
--> 135 F[i] = (F[i][0] // upart, F[i][1])
136 u *= upart ** F[i][1]
137 c -= lval * F[i][1]
/home/jec/sage-3.2.2/local/lib/python2.5/site-
packages/sage/rings/polynomial/polynomial_element.so in
sage.rings.polynomial.polynomial_element.Polynomial_generic_dense.__floordiv__
(sage/rings/polynomial/polynomial_element.c:30443)()
4436
4437
-> 4438
4439
4440
AttributeError: 'Polynomial_padic_flat' object has no attribute '_parent'
}}}
And the problem goes away if I change "//" to "/" on line 135 of
sage/rings/polynomial/padics/polynomial_padic_flat.py.
Attached patch applies to 3.2.2.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4038#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---