#16516: Faster roots computation for sparse polynomials over ZZ
-------------------------------------+-------------------------------------
Reporter: bruno | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.3
Component: commutative | Resolution:
algebra | Merged in:
Keywords: roots, sparse | Reviewers:
polynomial | Work issues:
Authors: | Commit:
Report Upstream: N/A | e725544b76363ea517a262419a092f9414c1b4a4
Branch: | Stopgaps:
u/bruno/faster_roots_computation_for_sparse_polynomials_over_zz|
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Hi Bruno,
It seems reasonable to have it in `integer_ring.pyx`. And I think that it
would be good to allow it for dense polynomial as well. You certainly know
what is the good measure of sparseness... you could implement a method
`.density()` of `.sparness_XYZ()` on polynomials that would help you to
find the good threshold for the different algorithms.
For better code, please:
- remove the trailing whitespaces
- there is no need for `;` at the end of each line
- for list update it is better to use `.append(x)` for adding one element
and `.extend(iterator)` for extending with several elements
- `not ring is None` -> `ring is not None` (the `is not` is a Python
operator)
And you must provide timings to see whether it is better with your code
for small input. You can use the command `timeit` as in
{{{
sage: R.<T> = ZZ[]
sage: p = R.random_element(degree=10)
sage: timeit("p.roots()")
625 loops, best of 3: 223 µs per loop
}}}
It would be nice to make the following works:
{{{
sage: R.<T> = PolynomialRing(ZZ, sparse=True)
sage: p = R.random_element(degree=10)
sage: p.roots(QQbar)
Traceback (most recent call last):
...
AttributeError: 'Polynomial_generic_sparse' object has no attribute 'gcd'
}}}
It will be a nice thing to have in Sage!
More remarks to come,
Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/16516#comment:5>
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.