126 return NullObjectRef<bitSet>();
143 inline explicit
bitSet(const label
n);
146 inline
bitSet(const label
n, const
bool val);
203 inline
bitSet(const label
n,
std::initializer_list<label> locations);
235 inline
bool all() const;
239 inline
bool any() const;
243 inline
bool none() const;
249 inline
unsigned int count(const
bool on=true) const;
260 bool test(const label
pos)
const {
return this->
get(
pos); }
305 List<bool>
values()
const;
311 inline void fill(
const bool val);
365 inline void flip(
const label
pos);
411 template<
class InputIter>
412 label
setMany(InputIter first, InputIter last);
418 inline label
set(
const labelUList& locations);
438 template<
class InputIter>
439 label
unset(InputIter first, InputIter last);
490 inline void operator=(
const unsigned int val);
493 inline operator unsigned int ()
const;
525 inline const_iterator&
operator++();
533 inline const_iterator
begin() const;
536 inline const_iterator
cbegin() const;
540 inline const_iterator
begin(label
pos) const;
544 inline const_iterator
cbegin(label
pos) const;
561 inline
unsigned int operator[](const label i) const;
565 inline reference
operator[](const label i);
615 void assign(
const unsigned int val) { this->
fill(val); }
622 template<>
struct Hash<
bitSet> : bitSet::hasher {};
631 Ostream& operator<<(Ostream& os, const InfoProxy<bitSet>& iproxy);
A reference supporting read/write access to an entry.
unsigned int count(const bool on=true) const
Count number of bits set.
bitSet & orEq(const bitSet &other)
The set logical OR.
label setMany(InputIter first, InputIter last)
Set the locations listed by the iterator range, auto-vivify entries if needed.
void fill(const bool val)
Assign all entries to the given value.
bitSet operator~(const bitSet &bitset)
Bitset complement, returns a copy of the bitset with all its bits flipped.
A 1D vector of objects of type <T> with a fixed length <N>.
static const bitSet & null() noexcept
Return a null bitSet (reference to a nullObject).
label find_last() const
Locate the last bit set.
unsigned int const_reference
bool found(const label pos) const
Same as contains()
A range or interval of labels defined by a start and a size.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void flip()
Invert all bits in the addressable region.
reference(bitSet *parent, const label index)
Construct by taking reference of block from within the list and the specified index.
List< bool > values() const
Return the bitset values as a boolList.
labelList sortedToc() const
The indices of the on bits as a sorted labelList.
label find_first() const
Locate the first bit that is set.
InfoProxy< bitSet > info() const noexcept
Return info proxy, used to print information to a stream.
void flip()
Flip the bit at the position, no range-checking.
bitSet & minusEq(const bitSet &other)
The set difference.
label find_next(label pos) const
Locate the next bit set, starting one beyond the specified position.
const_iterator begin() const
Iterator set to the position of the first on bit.
Base for lists with indirect addressing, templated on the list contents type and the addressing type...
bitSet & xorEq(const bitSet &other)
The set logical XOR.
bitSet operator|(const bitSet &a, const bitSet &b)
Bitwise-OR of two bitsets.
void resize_last()
Resize to include the last on bit only.
label find_first_not() const
Locate the first bit that is unset.
bool any() const
True if any bits in this bitset are set.
dimensionedScalar pos(const dimensionedScalar &ds)
autoPtr< bitSet > clone() const
Clone.
ClassName("bitSet")
Declare type-name (with debug switch)
A dynamic list of packed unsigned integers, with the number of bits per item specified by the <Width>...
bitSet & unset(const bitSet &other)
Unset (subtract) the bits specified in the other bitset, which is a set difference corresponds to the...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
bool set(const label i, unsigned int val=~0u)
Set value at index i, default value set is the max_value.
void operator=(const reference &other)
Value assignment.
void transfer(bitSet &bitset)
Transfer the contents of the argument list into this list and annul the argument list.
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
bool test(const label pos) const
Test for True value at specified position, never auto-vivify entries.
const_iterator cend() const noexcept
Iterator beyond the end of the bitSet.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
constexpr bitSet() noexcept
Default construct an empty, zero-sized bitSet.
List< bool > bools(const labelHashSet &locations)
Transform the on locations to a boolList, with true for each non-negative location and false for all ...
bitSet & andEq(const bitSet &other)
The set logical AND.
OBJstream os(runTime.globalPath()/outputName)
friend Ostream & operator(Ostream &os, const InfoProxy< PackedList< Width >> &info)
labelList toc() const
The indices of the on bits as a sorted labelList.
const Vector< label > N(dict.get< Vector< label >>("N"))
bitSet operator^(const bitSet &a, const bitSet &b)
Bitwise-XOR of two bitsets to form a unique bit-set.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
A const_iterator for iterating across on values.
A helper class for outputting values to Ostream.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
bool contains(const label pos) const
Test for True value at specified position, never auto-vivify entries.
tmp< GeometricField< Type, faPatchField, areaMesh > > operator &(const faMatrix< Type > &, const DimensionedField< Type, areaMesh > &)
Macro definitions for declaring ClassName(), NamespaceName(), etc.
const_iterator cbegin() const
Iterator set to the position of the first on bit.
void assign(const UList< bool > &bools)
Copy assign all entries from a list of bools.
bool intersects(const bitSet &other) const
True if any bits in the other bitset intersect (are the same).
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
List< label > labelList
A List of labels.
const_iterator end() const noexcept
Iterator beyond the end of the bitSet.
void swap(bitSet &bitset)
Swap contents.
bitSet & extend(const label minSize)
Ensure that minSize is covered by the bitSet.
bool none() const
True if no bits in this bitset are set.
bitSet bitset(const labelHashSet &locations)
Transform the on locations to a bitSet.
bool all() const
True if all bits in this bitset are set or if the set is empty.
bitSet & bound(const label maxSize)
Ensure the addressable range does not exceed maxSize.