41 const auto max = std::max_element(locations.
begin(), locations.
end());
42 const label len = (
max != locations.
end() ? (1 + *
max) : 0);
44 if (len > bools.
size())
49 for (label i : locations)
81 for (
const label i : slice)
94 for (
const label i : slice)
109 for (
const label i : locations)
119 for (
const label i :
range)
128 for (
const label i :
range)
149 BitOps::set(bools, locations);
159 BitOps::set(bools, locations);
168 const label len = bools.
size();
173 for (
const bool b : bools)
183 const label total(
count);
186 for (label i = 0; i < len; ++i)
191 if (++
count == total)
205 return BitOps::toc(bools);
220 for (
const label idx : locations)
242 for (
const label idx : locations)
266 const label len = std::min(
n, values.size());
268 for (label idx = 0; idx < len; ++idx)
270 if (select == values[idx])
bool unset(const Key &key)
Unset the specified key - same as erase.
bool set(const Key &key)
Same as insert (no value to overwrite)
bool empty() const noexcept
True if range is empty (zero-sized)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
void resize(const label len)
Adjust allocated size of list.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
iterator end() noexcept
Return an iterator to end traversing the UList.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type unset(const label i)
void size(const label n)
Older name for setAddressableSize.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
bitSet & unset(const bitSet &other)
A range or interval of labels defined by a start and a size.
void adjust() noexcept
Adjust the start to avoid negative indices.
label after() const noexcept
The value after the last element in the range.
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
List< bool > select(const label n, const labelUList &locations)
void unset(List< bool > &bools, const labelUList &locations)
Unset the listed locations (assign 'false').
List< label > toc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
bitSet create(const label n, const labelHashSet &locations, const bool on=true)
Create a bitSet with length n with the specified on locations.