bitset
Efficient way of iterating over true bits in std::bitset?
Is there a way of iterating over a (possibly huge) std::bitset 开发者_如何学Cthat is linear in the number of bits that are set to true? I want to prevent having to check every single position in the b[详细]
2023-02-04 08:39 分类:问答How does one store a vector<bool> or a bitset into a file, but bit-wise?
How to write bitset data to a file? The first answer doesn\'t answer the question correctly, since it takes 8 t开发者_StackOverflow中文版imes more space than it should.[详细]
2023-02-03 14:46 分类:问答Fastest ways to set and get a bit
I\'m just trying to develop ultra-fast functions for setting and getting bits in uint32 arrays. For example, you can say \"set bit 1035 to 1\". Then, the uint32 indexed with 1035 / 32 is used with the[详细]
2023-01-29 03:06 分类:问答How to implement a bitset in C?
I have been using the Bitset class in Java and I would like to do something similar in C. I suppose I would have to do it manually as most stuff in C. What would be an efficient way to implement?[详细]
2023-01-28 23:49 分类:问答Good library for bitsets or bitarrays
Hallo all, I\'m looking for some good library, that works with bitsets or bitarra开发者_如何学Goys. Anybody knows something better (or not worse in all cases) then boost::dynamic_bitset? No matter if[详细]
2023-01-22 08:09 分类:问答Resizing a java BitSet
I sub classed the BitSet class to add some additional methods. One of the is called \"fold\". It splits the BitSet in 2 halves 开发者_运维知识库and \"combines\" them with an or.[详细]
2023-01-19 23:42 分类:问答Unordered (hash) map from bitset to bitset on boost
I want to use a cache, implemented by boost\'s unordered_map, from a dynamic_bitset to a dynamic_bitset. The problem, of course, is that there is no default hash function from the bitset. It doesn\'t[详细]
2023-01-19 20:38 分类:问答bitscan (bsf) on std::bitset ? Or similar
I\'m doing a project that involves solving some NP-hard graph problems. Specifically triangulation of Bayesian networks...[详细]
2023-01-19 01:00 分类:问答bitset for more than 32 bits?
I need to use bit flags with more than 32 bits (33 to be exact right now). I tried and find std::bitset doesn\'t handle more than 32 bits (ulong). Do I have to use vector or there\'s a way to make bit[详细]
2023-01-14 12:57 分类:问答how to store larger binary numbers in bitset (C++)
i m trying to make a program to convert a number into it\'s binary. Code: #include<iostream> #include<algorithm>[详细]
2023-01-14 05:07 分类:问答