Resizes the bitset to contain \p num_bits. If the new size is greater than the current size the new bits are set to zero.
| 122 | /// Resizes the bitset to contain \p num_bits. If the new size is greater |
| 123 | /// than the current size the new bits are set to zero. |
| 124 | void resize(size_type num_bits, command_queue &queue) |
| 125 | { |
| 126 | // resize bits |
| 127 | const size_type current_block_count = m_bits.size(); |
| 128 | m_bits.resize(num_bits * bits_per_block, queue); |
| 129 | |
| 130 | // fill new block with zeros (if new blocks were added) |
| 131 | const size_type new_block_count = m_bits.size(); |
| 132 | if(new_block_count > current_block_count){ |
| 133 | fill_n( |
| 134 | m_bits.begin() + current_block_count, |
| 135 | new_block_count - current_block_count, |
| 136 | block_type(0), |
| 137 | queue |
| 138 | ); |
| 139 | } |
| 140 | |
| 141 | // store new size |
| 142 | m_size = num_bits; |
| 143 | } |
| 144 | |
| 145 | /// Sets the bit at position \p n to \c true. |
| 146 | void set(size_type n, command_queue &queue) |