
typedef UINT block_type; boost::dynamic_bitset
succ; /* no resizing needed */ // (assuming m_N is a multiple of the UINT width, i.e. 32) for(UINT i=1; i <= m_N / (block + 1); ++i) { block_type b = /*random...*/; succ.append(b); }
Let us know if it worked for you.
I should have read the manuals more closely! I did not notice that
append is appending a block of bits, while push_back appends only one
bit.
Your code works fine, but I worry about the size of block so I use
dynamic_bitset<>::block_type and bits_per_block. The code is now more
complicated but runs *much* faster!
succ.clear();
size_t numblock = m_N/BitSet::bits_per_block;
vectorBitSet::block_type first_blocks(numblock);
for(size_t i=0; i