#18215: Huge speed up for hash of quadratic number field elements
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.7
Component: number fields | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/18215 | 3ec20b4245a23f27931b00e54256743709e38e18
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Replying to [comment:8 ncohen]:
> Hello,
>
> Can you tell where this `42082631` comes from?
This is to avoid conflicts for small values of `a` and `b`. It avoids
conflicts between `a=1, b=-1` and `a=b=0`.
> Also, is it true that `mpz_pythonhash(self.b)` is zero when `self.b` is
0 ?
Yes. This is the same algorithm as Python hash for `int/long`.
--
Ticket URL: <http://trac.sagemath.org/ticket/18215#comment:9>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.