#18461: Implement Field._gcd_univariate_polynomial()
--------------------------------+----------------------------------
Reporter: pbruin | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone: sage-6.8
Component: basic arithmetic | Keywords: polynomial gcd
Merged in: | Authors: Peter Bruin
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
--------------------------------+----------------------------------
We implement `Field._gcd_univariate_polynomial()` using the standard
Euclidean algorithm. This is much faster than the existing Python method
`Fields.ParentMethods._gcd_univariate_polynomial()` (which calls
`EuclideanDomains.ElementMethods.gcd()`). (The
`_gcd_univariate_polynomial` mechanism was introduced in #13442.)
The following bug can then be fixed by just removing
`PolynomialRealDense.gcd()`, which does not take into account the case
where one of the arguments of `gcd` is zero:
{{{
sage: R.<x> = RR[]
sage: x.gcd(R.zero())
Traceback (most recent call last):
...
TypeError: 'MinusInfinity' object cannot be interpreted as an index
}}}
Removing this method ''without'' implementing
`Field._gcd_univariate_polynomial()` (falling back on Python code) is
about twice as slow; with this ticket there is no slowdown.
--
Ticket URL: <http://trac.sagemath.org/ticket/18461>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.