| 165 | template<class IndexType> |
| 166 | template<bool sparse> |
| 167 | forceinline void |
| 168 | BitSet<IndexType>::intersect_with_mask(const BitSetData* mask) { |
| 169 | assert(_limit > 0U); |
| 170 | if (sparse) { |
| 171 | for (IndexType i = _limit; i--; ) { |
| 172 | assert(!_bits[i].none()); |
| 173 | BitSetData w_i = _bits[i]; |
| 174 | BitSetData w_a = BitSetData::a(w_i, mask[_index[i]]); |
| 175 | replace_and_decrease(i,w_a); |
| 176 | assert(i == _limit || !_bits[i].none()); |
| 177 | } |
| 178 | } else { // The same except different _indexing in mask |
| 179 | for (IndexType i = _limit; i--; ) { |
| 180 | assert(!_bits[i].none()); |
| 181 | BitSetData w_i = _bits[i]; |
| 182 | BitSetData w_a = BitSetData::a(w_i, mask[i]); |
| 183 | replace_and_decrease(i,w_a); |
| 184 | assert(i == _limit || !_bits[i].none()); |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | template<class IndexType> |
| 190 | forceinline void |