Home » U++ Library support » U++ Core » what about VectorBiMap / ArrayBiMap ?
Re: what about VectorBiMap / ArrayBiMap ? [message #26517 is a reply to message #26503] |
Fri, 07 May 2010 14:37   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
kohait00 wrote on Thu, 06 May 2010 14:38 | sorry, i try to make it more clear..
in containers, by default, it is possible adding another element with same hash. this is called hash collision, because normaly a hash value should map to exactly one counterpart.
is there a possib in the containers internally, to restrict such behaviour besides manually checking before adding another element?
i know of FindAdd, but this handles it kind of differently..
|
Uh, I am not quite sure what you want to check.
Generally, hashing is always a little bit stochastic. In theory, it is possible that collisions would slow down your code, but statistically, it is quite unlikely.
Or, if you want some analogy, some very special pattern of memory allocations and frees could put down to knees any memory allocator and/or any cache subsystem. But it is so unlikely to happen (unless engineered) that we are still using memory allocators and caches... 
BTW, of course, U++ changes the size of hashing space dynamically based on number of elements...
Whatever, my advice is to forget about this. It is internal issue, do not think in terms of hash codes...
|
|
|
Goto Forum:
Current Time: Fri Aug 29 20:41:20 CEST 2025
Total time taken to generate the page: 0.04327 seconds
|