On Feb 25, 2008, at 6:13 AM, David Harvey wrote: > > Currently in sage.rings.polynomial we have the following class > hierarchy: > > Polynomial > Polynomial_dense_modn > Polynomial_dense_modn_ntl_zz > Polynomial_dense_modn_ntl_ZZ > Polynomial_dense_modp > > The implementations are via some weird combination of direct NTL > access and libs.ntl. > > Is there eventually supposed to be Polynomial_dense_modp_ntl_zz and > Polynomial_dense_modp_ntl_ZZ as well?
Yes. If there is not a trac ticket for it yet, there should be. It shouldn't be that hard (just extend the modn polynomials and add some functionality, e.g. gcd. > Currently, if I do > PolynomialRing(Integers(7)), it's apparently implemented via ZZ_pX > (via libs.ntl!), but if I do PolynomialRing(Integers(1000)), it's > implemented via zz_pX. So we get weird things like: > > sage: R.<x> = PolynomialRing(Integers(7)) > sage: f = R([ZZ.random_element() for _ in range(100)]) > sage: timeit("g = f*f") > 625 loops, best of 3: 168 µs per loop > > but: > > sage: R.<x> = PolynomialRing(Integers(100)) > sage: f = R([ZZ.random_element() for _ in range(100)]) > sage: timeit("g = f*f") > 625 loops, best of 3: 26.2 µs per loop > > i.e. it's six times faster if the modulus is composite. > > david > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---