#16880: prime_power_range
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: number theory | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/16880 | a3195f7bb4e16cc4eb3f3ae4ef58a4b5d0341ad2
Dependencies: #16878 | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by vdelecroix):
* dependencies: => #16878
Old description:
> The cythonization of `prime_powers` is much faster (around x4 in the
> timings). We introduce in a new function `prime_power_range` in
> `fast_arith.pyx` (that also has a keyword `py_ints` as `prime_range`).
New description:
The cythonization of `prime_powers` is much faster (around x4 in the
timings). We introduce in a new function `prime_power_range` in
`fast_arith.pyx` that is similar to `prime_range`.
Since #16878, 1 is not a prime power anymore! So we fix `prime_powers` to
never return 1 in its output.
--
Comment:
And with timings
using `prime_powers`
{{{
sage: timeit("prime_powers(1000)", number=4000)
4000 loops, best of 3: 86.7 µs per loop
sage: timeit("prime_powers(5000)", number=2000)
2000 loops, best of 3: 314 µs per loop
}}}
using `prime_power_range` instead::
{{{
sage: timeit("prime_power_range(1000)", number=4000)
4000 loops, best of 3: 17.6 µs per loop
sage: timeit("prime_power_range(5000)", number=2000)
2000 loops, best of 3: 72.3 µs per loop
}}}
using `prime_power_range` with `py_ints=True`::
{{{
sage: timeit("prime_power_range(1000,py_ints=True)", number=4000)
4000 loops, best of 3: 14.6 µs per loop
sage: timeit("prime_power_range(5000,py_ints=True)", number=2000)
2000 loops, best of 3: 33.9 µs per loop
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/16880#comment:7>
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.