hash tables and equality definitions
Nov. 18th, 2009 05:20 pmI've just realized that using hash tables properly requires a notion of when two objects have equal value.
How come I never had to worry about this in the past?
---
I want my hash table to encode an equivalence relation (permutations of node labels), automatically dealing with my label-switching problem.
---
Do any of the normal languages/libraries let you pass an equality test, and adapt the hash function accordingly? I imagine you'd need to pass a function that brings the objects into a normal form.
---
I've installed R's hash library, but it seems to be pretty basic.
How come I never had to worry about this in the past?
---
I want my hash table to encode an equivalence relation (permutations of node labels), automatically dealing with my label-switching problem.
---
Do any of the normal languages/libraries let you pass an equality test, and adapt the hash function accordingly? I imagine you'd need to pass a function that brings the objects into a normal form.
---
I've installed R's hash library, but it seems to be pretty basic.