GithubHelp home page GithubHelp logo

Renaming of bit_magic about sdsl-lite HOT 2 CLOSED

simongog avatar simongog commented on June 18, 2024
Renaming of bit_magic

from sdsl-lite.

Comments (2)

mpetri avatar mpetri commented on June 18, 2024

I have been thinking about this some more after our discussion. If I were to read a piece of code that uses bits::sel() or bit_magic::i1BP() and I'm not very familiar with the library I would not necessarily know what the function does.

the same goes for bits::lo and bits::hi. I understand that these function would make the code very concise and neat looking. but would probably require another comment above the line to explain what it does. for example

/* return the position in the final word */ return bits::sel(x,i);

is less descriptive and requires a comment compared to

return bits::selectWord(x,i) or something similar.

the same case could be made for a few other functions. for example bits::cnt could be renamed to bits::count or similar.

another example might potentially be the size() function. I realize that this is a standard c++ container requirement but in succinct data structure land kind of implies the "space usage" not the length especially since there are no real "space usage" functions in the int vector class. the cheat sheet will probably help to point to the "get_size_in_bytes() functions. (maybe also remove the unnecessary get_ prefix here?)

from sdsl-lite.

simongog avatar simongog commented on June 18, 2024
  • have removed the get_ prefix in get_size... methods.
  • we stay with bits::cnt, bits::sel, bits::lo, bits::hi, since selectWord also don't tell unexperienced users what is done. All renamed methods are also explained on the cheat sheet so that no comments are necessary in the client source.

from sdsl-lite.

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.