76 SelectionSet() { bitsets_.resize(N_SELECTIONTYPES); }
78 SelectionSet(std::vector<int> nbits);
85 void flip(std::vector<int> bitIndex);
89 void flip(std::vector<int> fromIndex, std::vector<int> toIndex);
95 std::vector<bool>
get(std::vector<int> bitIndex);
99 SelectionSet
get(std::vector<int> fromIndex, std::vector<int> toIndex);
102 std::vector<bool>
any();
105 std::vector<bool>
none();
107 std::vector<int> firstOffBit()
const;
111 std::vector<int>
nextOffBit(std::vector<int> fromIndex)
const;
113 std::vector<int> firstOnBit()
const;
117 std::vector<int>
nextOnBit(std::vector<int> fromIndex)
const;
129 void setBitOn(std::vector<int> bitIndex);
131 void setBitOff(std::vector<int> bitIndex);
146 std::vector<int>
size()
const;
149 void resize(std::vector<int> nbits);
151 SelectionSet& operator&=(
const SelectionSet& ss) {
155 SelectionSet& operator|=(
const SelectionSet& ss) {
159 SelectionSet& operator^=(
const SelectionSet& ss) {
163 SelectionSet& operator-=(
const SelectionSet& ss) {
164 SelectionSet tmp = *
this ^ ss;
169 SelectionSet parallelReduce();
171 std::vector<bool> operator[](std::vector<int> bitIndex)
const {
172 std::vector<bool> result(N_SELECTIONTYPES);
173 for (
int i = 0; i < N_SELECTIONTYPES; i++)
174 result[i] = bitsets_[i][bitIndex[i]];
178 friend SelectionSet operator|(
const SelectionSet& bs1,
179 const SelectionSet& bs2);
180 friend SelectionSet operator&(
const SelectionSet& bs1,
181 const SelectionSet& bs2);
182 friend SelectionSet operator^(
const SelectionSet& bs1,
183 const SelectionSet& bs2);
184 friend SelectionSet operator-(
const SelectionSet& bs1,
185 const SelectionSet& bs2);
187 friend bool operator==(
const SelectionSet& bs1,
const SelectionSet& bs2);
190 friend std::ostream& operator<<(std::ostream&,
const SelectionSet& bs);
192 std::vector<OpenMDBitSet> bitsets_;