Giter Club home page Giter Club logo

Comments (6)

martinus avatar martinus commented on September 10, 2024 1

I've finally fixed the issue. As explained above, I've added a buffer for the overflow, so there's no wrap around any more. The added benefit is that a lot less & mMask are necessary. The disadvantage is that for the worst case of bucket size 256, I need an additional 256 buckets. That's not too bad though. For larger maps I still only need 256 extra buckets, and for small maps the buffer is also smaller.

from robin-hood-hashing.

ktprime avatar ktprime commented on September 10, 2024

The iterator pos must be valid and dereferenceable. Thus the end() iterator (which is valid, but is not dereferenceable) cannot be used as a value for pos.

from robin-hood-hashing.

martinus avatar martinus commented on September 10, 2024

@ktprime, this is not about the end() iterator, this is about the backward-shift-deletion which shuffles elements around when erasing an element. See Tessil/robin-map#20

from robin-hood-hashing.

ed-lam avatar ed-lam commented on September 10, 2024

Any progress on this or any workaround? If not, is there any alternative unordered_map that you recommend? Thanks.

from robin-hood-hashing.

martinus avatar martinus commented on September 10, 2024

Unfortunately, not yet. This is an edge case that's very difficult to solve in an efficient way. If you need the standard behavior, switch to std::unordered_map.

from robin-hood-hashing.

martinus avatar martinus commented on September 10, 2024

I think of all the possible solutions to this problem, the least bad is to ditch the wrap around and add a buffer to the end of the data array.

Since mInfo is limited, The size of that buffer can also be very limited: std::min(mMaxNumElementsAllowed, 128).

from robin-hood-hashing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.