Dear Tim,
On Dec 3, 10:57 am, Tim Lahey <[EMAIL PROTECTED]> wrote:
-- snip --
> Yes, and it's what someone else told me earlier in this thread.
Where? I only found your own suggestion [(i^j).factor() for i,j in f].
But this is likely not a good idea, because
* i^j is computed (may take time),
* the result is factorized (may take even more time), and
* eventually only yields what you already knew, namely i and j.
> However,
> in the case of polynomials one has to be careful that it isn't expanded
> when raising to the power.
No. It works the same way.
sage: R.<x> = ZZ[]
sage: f = x**10-1
sage: F = (f^2).factor() ; F
(x - 1)^2 * (x + 1)^2 * (x^4 - x^3 + x^2 - x + 1)^2 * (x^4 + x^3 + x^2
+ x + 1)^2
sage: [Factorization([X]) for X in F]
[(x - 1)^2,
(x + 1)^2,
(x^4 - x^3 + x^2 - x + 1)^2,
(x^4 + x^3 + x^2 + x + 1)^2]
You see the difference? Your suggestion was to compute X[0]^X[1] and
then to apply factorization to it. My suggestion was to simply
*define* (not compute!!) the factorization.
Cheers,
Simon
--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---