-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order in keys and values for identical hash tables #3468
Comments
By the way, there's some code depending on this behavior, so we should be careful about changing it: M2/M2/Macaulay2/m2/document.m2 Line 521 in 1fd2382
|
simpler example:
|
For this particular case, it's because the hash table is small (the minimum size of 4 buckets), and so i1 : hash true % 4
o1 = 1
i2 : hash false % 4
o2 = 1 So the order in which they get stuffed affect where in the linked list they appear. |
That makes sense. Is this a feature or a misfeature in this case? Maybe we can make sure true and false don't have the same remainder mod 4? |
Yeah, I think so -- see #3471. |
Shouldn't the order of keys and values of a hash table depend only on the hash? Why can I get two identical hash tables with different keys and values?
Of course, I see that the buckets are different:
So is this just because the first element,
1
, in the call topartition
was odd? I don't think the output hash table itself should be affected by this.The text was updated successfully, but these errors were encountered: