All sparse polynomials are implemented within Sage, in sage.rings.polynomial.polynomial_generic_sparse. It would be good if the constructor only used the implementation as part of the key for dense polynomials. David
On Wed, May 11, 2011 at 04:37, Simon King <simon.k...@uni-jena.de> wrote: > Hi! > > When constructing a polynomial ring, one can provide arguments > "sparse" and "implementation". But it seems that there is no sparse > version based on NTL implementation: > > sage: R.<x> = PolynomialRing(ZZ, sparse=False, implementation='NTL') > sage: R.is_sparse() > False > sage: R > Univariate Polynomial Ring in x over Integer Ring (using NTL) > sage: S.<x> = PolynomialRing(ZZ, sparse=True, implementation='NTL') > sage: S.is_sparse() > True > sage: S > Sparse Univariate Polynomial Ring in x over Integer Ring > > So, S is sparse, but the implementation is not mentioned (so, it seems > to be the default, i.e. FLINT). > > However, providing "implementation" is not ignored, it is used for the > cache key: > sage: T.<x> = PolynomialRing(ZZ, sparse=True) > sage: T > Sparse Univariate Polynomial Ring in x over Integer Ring > sage: S is T > False > > Question 1: > What is the underlying implementation of S? Is it NTL, as requested? > > Question 2, if the implementation of S is based on FLINT (the > default): > Should the "implementation" argument be silently ignored, so that "S > is T" in the example above? > Or should an error be raised instead ("explicit is better than > implicit")? > > If the answer to question 1 is that it does use NTL, then of course it > should be mentioned in the string representation. > > Best regards, > Simon > > -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org > -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org