On Thursday, August 29, 2013 12:54:02 PM UTC-4, Nils Bruin wrote:
>
> On Thursday, August 29, 2013 8:52:02 AM UTC-7, Simon King wrote:
>>
>> Hi Stefan,
>>
>> On 2013-08-29, Stefan wrote:
>> > Actually, this is not quite true. reduce() is, by default, called
>> > automatically for elements of
On Thursday, August 29, 2013 8:52:02 AM UTC-7, Simon King wrote:
>
> Hi Stefan,
>
> On 2013-08-29, Stefan > wrote:
> > Actually, this is not quite true. reduce() is, by default, called
> > automatically for elements of exact rings at creation time. It will
> > correctly get rid of common factor
Hi Stefan,
On 2013-08-29, Stefan wrote:
> Actually, this is not quite true. reduce() is, by default, called
> automatically for elements of exact rings at creation time. It will
> correctly get rid of common factors, but it does not normalize the leading
> coefficients:
Bad. But of course, it
>
> But there is also a generically implemented method .reduce() for
> fraction field elements (so, not necessarily needed to implement it in
> subclasses). Of course, it is expensive and it may fail (if
> the gcd is not defined). But *if* it works, then fraction f1 is equal to
> fraction f2 i
Hello,
The following is I guess for the symbolic ring and is what we want
sage: cmp((x+1)^2, x^2 + 2*x + 1)
1
while the following is in a polynomial ring and is also what we want
sage: cmp((c+1)^2, c^2 + 2*c+1)
0
The only issue is about hashing and not == vs cmp, right ?
Note that there are oth
On Thursday, August 29, 2013 2:08:49 AM UTC-7, Simon King wrote:
>
> Hi Robert, hi Stefan,
>
>
>
> If I am not mistaken, containment in sets and dicts relies on cmp and
> not on ==. Hence, in this case, I think the hash is not to blame.
>
Indeed, comparing using == works:
sage: H5. = Frac
Hi Robert, hi Stefan,
On 2013-08-28, Robert Bradshaw wrote:
> What could perhaps be added is some kind of a normalization routine
> (to be implemented by subclasses) that is called before performing a
> hash. This might be quite expensive.
Sorry, I intended to answer yesterday evening along the