#16880: previous_prime, previous_prime_power, next_prime_power
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.7
Component: number theory | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/16880 | db1e869640dbb20d39e565970aaa8c5d58fa8953
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by vdelecroix:
Old description:
> In this ticket we add three methods to integers: `previous_prime`
> (calling pari `precprime`), `next_prime_power` and
> `previous_prime_power`. We also make changes in `sage.rings.arith` to
> call these (faster) methods.
>
> Follow up: #18298 and #18299
New description:
In this ticket we add three methods to integers: `previous_prime` (calling
pari `precprime`), `next_prime_power` and `previous_prime_power`. We also
make changes in `sage.rings.arith` to call these (faster) methods.
Timings on the current version (sage-6.7.beta2)
{{{
sage: timeit("for i in range(200): next_prime_power(i)", number=5000,
repeat=10)
5000 loops, best of 10: 311 µs per loop
sage: a = 33622489
sage: timeit("next_prime_power(a)", number=5000, repeat=10)
5000 loops, best of 10: 53.6 µs per loop
}}}
Timings with the branch applied
{{{
sage: timeit("for i in range(200): next_prime_power(i)", number=5000,
repeat=10)
5000 loops, best of 10: 184 µs per loop
sage: a = 33622489
sage: timeit("next_prime_power(a)", number=5000, repeat=10)
5000 loops, best of 10: 16.9 µs per loop
}}}
Follow up: #18298 and #18299
--
--
Ticket URL: <http://trac.sagemath.org/ticket/16880#comment:19>
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.