jerrro
March 11th, 2008, 10:25 PM
Hello,
I am having serious problems with hash maps in STL.
The thing I am try to do is very simple: have a hash map with a unique key.
I am sure my key is unique per object, and my equality function checks if two keys are completely identical. My hash function depends on a random component, though - and I don't get the same size of the hash map for different hash functions (depending on that random factor). If I am not mistaken, the hash map .size() method does not depend on the hash function, but on the number of unique elements in the hash map. Still, I seem to get a different number of unique elements for different hash functions. That should not happen. Any ideas what could be the problem? I am really confused here.
Thanks.
Jerr.
I am having serious problems with hash maps in STL.
The thing I am try to do is very simple: have a hash map with a unique key.
I am sure my key is unique per object, and my equality function checks if two keys are completely identical. My hash function depends on a random component, though - and I don't get the same size of the hash map for different hash functions (depending on that random factor). If I am not mistaken, the hash map .size() method does not depend on the hash function, but on the number of unique elements in the hash map. Still, I seem to get a different number of unique elements for different hash functions. That should not happen. Any ideas what could be the problem? I am really confused here.
Thanks.
Jerr.