13void store_bits(
const std::vector<bool>& bits, std::vector<uint32_t>& store ){
14 const unsigned word_count = store.size();
15 const unsigned bits_count = bits.size();
17 for (
unsigned word = 0; word < word_count; ++word) {
18 uint32_t& temp(store[word]);
20 for (
unsigned bit = 0; bit < 32; ++bit) {
21 const unsigned position = word*32+bit;
22 if (position >= bits_count )
30void restore_bits(std::vector<bool>& bits,
const std::vector<uint32_t>& store) {
31 const unsigned word_count = store.size();
32 const unsigned bits_count = bits.size();
35 for (
unsigned word = 0; word < word_count; ++word) {
36 const uint32_t& temp(store[word]);
38 for (
unsigned bit = 0; bit < 32; ++bit) {
39 const unsigned position = word*32+bit;
40 if (position >= bits_count )
43 if (temp & (1 << bit))
44 bits[position] =
true;
46 bits[position] =
false;