#5921: [with patch, needs review] factoring integer polynomials does not factor
the content
---------------------+------------------------------------------------------
Reporter: cremona | Owner: tbd
Type: defect | Status: new
Priority: major | Milestone: sage-4.0
Component: algebra | Keywords:
---------------------+------------------------------------------------------
Comment(by AlexGhitza):
Yes, the problem is in {{{f.roots()}}} for a polynomial f with integer
coefficients. The code used to just run {{{f.factor()}}}, but of course
now if the content is a huge integer it's gonna take a while for the
factoring to finish. There's a doctest in the sage library that runs into
precisely this problem now, since it's an illustration of RSA and has huge
coefficients (and a huge content) floating around. However, you don't
care about the content if you just want the roots of the polynomial.
So the attached patch makes {{{roots()}}} divide by the content first,
then call {{{factor()}}}. It also adds a warning to this effect in the
docstrings of the two {{{factor()}}} methods.
I'm happy with John's patch, so if someone reviews my patch we're done.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5921#comment:6>
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
-~----------~----~----~----~------~----~------~--~---