#8109: wrap NTL's lzz_pE and lzz_pEX and use them
---------------------------+------------------------------------------------
Reporter: ylchapuy | Owner: AlexGhitza
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.3.2
Component: algebra | Keywords: ntl
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------+------------------------------------------------
Changes (by ylchapuy):
* keywords: => ntl
* milestone: sage-wishlist => sage-4.3.2
Comment:
Preliminary version.
note: this is mostly a copy of existing files for wrapping ZZ_pE and
ZZ_pEX with
'sed s/ZZ/zz/g' applied.
warning: there is no test (yet) for checking that the modulus is <
NTL_SP_BOUND
still, doctests pass and here are some results:
{{{
sage: c=ntl.zz_pEContext(ntl.zz_pX([1,1,1,1,1], 19800713))
sage: a = ntl.zz_pE([3,2], c); b = ntl.zz_pE([1,2], c)
sage: f = ntl.zz_pEX([a, b, b])
sage: p = f**123
sage: q = p+f**77+f
sage:
sage: C=ntl.ZZ_pEContext(ntl.ZZ_pX([1,1,1,1,1], 19800713))
sage: A = ntl.ZZ_pE([3,2], C); B = ntl.ZZ_pE([1,2], C)
sage: F = ntl.ZZ_pEX([A, B, B])
sage: P = F**123
sage: Q = P+F**77+F
sage:
sage: %timeit p+q
625 loops, best of 3: 59.6 µs per loop
sage: %timeit P+Q
625 loops, best of 3: 180 µs per loop
sage:
sage: %timeit p*q
125 loops, best of 3: 2.62 ms per loop
sage: %timeit P*Q
125 loops, best of 3: 5.65 ms per loop
sage:
sage: %timeit p.gcd(q)
125 loops, best of 3: 7.28 ms per loop
sage: %timeit P.gcd(Q)
5 loops, best of 3: 62.5 ms per loop
sage:
sage: %timeit p**17
5 loops, best of 3: 58 ms per loop
sage: %timeit P**17
5 loops, best of 3: 129 ms per loop
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8109#comment:1>
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 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-trac?hl=en.