Re: [sage-devel] content of polynomials

2016-05-18 Thread John Cremona
I had completely forgotten this old discussion. Thanks for bringing it up again; I assume that it has not been resolved in the meantime. [I do not promise to be consistent today with anything I have said before on the subject.] Consistency with existing code and with Magma et al is surely

[sage-devel] content of polynomials

2016-05-17 Thread Johan S . R . Nielsen
>3. Make `content` always return an element, create a method ` >content_ideal` to return an ideal, and implement `content` only over >PIDs. I vote 3 as well. It limits confusion when coming from other systems while not really being confusing for new-CAS users. > A. What kind of

Re: [sage-devel] content of polynomials

2016-05-17 Thread Jeroen Demeyer
On 2016-05-17 16:33, Bruno Grenet wrote: B. What should the content (element) over QQ (or other fraction fields) be? I think that the gcd of the coefficients is the only good answer. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To

Re: [sage-devel] content of polynomials

2016-05-17 Thread Jeroen Demeyer
On 2016-05-17 16:33, Bruno Grenet wrote: 3. Make `content` always return an element, create a method `content_ideal` to return an ideal, and implement `content` only over PIDs. I vote for 3. -- You received this message because you are subscribed to the Google Groups "sage-devel"

Re: [sage-devel] content of polynomials

2016-05-17 Thread Bruno Grenet
Dear all, This issue concerning the semantic of the method `content` has not been resolved since it was raised by Vincent almost 2 years ago (see ticket #16613 ). The needed changes are technically easy to perform, we "simply" need to reach a consensus

Re: [sage-devel] content of polynomials

2014-06-30 Thread Bruno Grenet
Salut Vincent, I was tempted to open a ticket for this bug (or is it a feature?), so I am very much in favor of your proposition! Best wishes, Bruno Le dim. 29 juin 2014 23:32:42 CEST, Vincent Delecroix a écrit : Hello, While reviewing #16516 I bumped into the following bug {{{ sage: R.x =

Re: [sage-devel] content of polynomials

2014-06-30 Thread John Cremona
I'm not sure about the name content_gen, or whether it is necessary if pol.content().gen() works. Also, I suspect that there may be quite a lot of code out there which this change will break. Would it be possible to make the change you suggest for content() but to have a parameter flag such as

Re: [sage-devel] content of polynomials

2014-06-30 Thread Vincent Delecroix
Dear John, Thanks for your answer. The method content for dense polynomial over ZZ is implemented at a very low level... I am sure somebody cares about its speed. In particular, I am not in favour of pol.content().gen() which needs to build the ideal. Your flag idea is nice. For the deprecation

Re: [sage-devel] content of polynomials

2014-06-30 Thread John Cremona
That sounds OK -- yes, it must be possible to return the content as a number without any complicated construction, especially as the content (as a number) will be returned by some lower-level library such as FLINT. John On 30 June 2014 08:53, Vincent Delecroix 20100.delecr...@gmail.com wrote:

[sage-devel] content of polynomials

2014-06-29 Thread Vincent Delecroix
Hello, While reviewing #16516 I bumped into the following bug {{{ sage: R.x = PolynomialRing(ZZ, sparse=True) sage: (3*x^5 + 3).content() Principal ideal (3) of Integer Ring sage: R.x = PolynomialRing(ZZ, sparse=False) sage: (3*x^5 + 3).content() 3 }}} It is documented in the corresponding