You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logic of the hash function should be the same as that of isequal, since the intention is that a == b should imply hash(a) == hash(b). I doubt this is the case right now.
The fact that 2..1 and 3..1 hash to different values results in unique returning two elements rather than one. DomainSets has an elaborate way of checking for equality of domains, but the hash function doesn't, so I bet there are many more examples of this type of error.
The text was updated successfully, but these errors were encountered:
I've concluded that this is hard to do. It is harder than deciding on the equality of domains, because you only have a single argument and not a combination of arguments. Since Point(0.5) == 0.5..0.5 their hashes should be the same. But a closed ball with radius zero is also a point, so should have the same hash. A unit ball in 1D is a unit interval. Etcetera.
This was completed in 8742d3a, noting that the definition of hash in Base can still be invoked as a fallback, even if a generic implementation is made at the level of Domain.
The logic of the
hash
function should be the same as that ofisequal
, since the intention is thata == b
should implyhash(a) == hash(b)
. I doubt this is the case right now.An example when using intervals is given in JuliaMath/IntervalSets.jl#167:
The fact that
2..1
and3..1
hash to different values results inunique
returning two elements rather than one. DomainSets has an elaborate way of checking for equality of domains, but thehash
function doesn't, so I bet there are many more examples of this type of error.The text was updated successfully, but these errors were encountered: