A bitSet stores bits (elements with only two states) in packed internal format and supports a variety of bit-set operations. Its behaviour is largely list-like, with some HashSet features. More...
#include <bitSet.H>


Classes | |
| class | reference |
| A reference supporting read/write access to an entry. More... | |
| class | const_iterator |
| A const_iterator for iterating across on values. More... | |
Public Types | |
| typedef bool | value_type |
| A bitSet acts like a packed boolList. | |
| typedef unsigned int | const_reference |
| Public Types inherited from PackedList< 1 > | |
| typedef unsigned int | block_type |
| The storage block type for bit elements. | |
| typedef unsigned int | const_reference |
Public Member Functions | |
| ClassName ("bitSet") | |
| Declare type-name (with debug switch). | |
| constexpr | bitSet () noexcept |
| Default construct an empty, zero-sized bitSet. | |
| bitSet (Istream &is) | |
| Construct from Istream. | |
| bitSet (const label n) | |
| Construct with given size, with all bits set to 0. | |
| bitSet (const label n, const bool val) | |
| Construct with given size and value for all elements. | |
| bitSet (const bitSet &bitset) | |
| Copy construct. | |
| bitSet (bitSet &&bitset) | |
| Move construct. | |
| bitSet (const bitSet &bitset, const labelUList &addr) | |
| Construct a new bitSet by extracting the specified (unique) locations of an existing bitSet. | |
| template<class Addr> | |
| bitSet (const bitSet &bitset, const IndirectListBase< label, Addr > &addr) | |
| Construct a new set by extracting the specified (unique) locations of an existing bitSet. | |
| bitSet (const bitSet &bitset, const labelRange &range) | |
| Construct a new bitSet by extracting the specified range locations of an existing bitSet. | |
| bitSet (const UList< bool > &bools) | |
| Construct from a list of bools. | |
| bitSet (const label n, const labelRange &range) | |
| Construct with given pre-size (filled with 0), subsequently add specified locations as 1, auto-vivify entries if needed. | |
| bitSet (const label n, const labelUList &locations) | |
| Construct with given pre-size (filled with 0), subsequently add specified locations as 1, auto-vivify entries if needed. | |
| template<class Addr> | |
| bitSet (const label n, const IndirectListBase< label, Addr > &locations) | |
| Construct with given pre-size (filled with 0), subsequently add specified locations as 1, auto-vivify entries if needed. | |
| template<unsigned N> | |
| bitSet (const label n, const FixedList< label, N > &locations) | |
| Construct with given pre-size (filled with 0), subsequently add specified locations as 1, auto-vivify entries if needed. | |
| bitSet (const label n, std::initializer_list< label > locations) | |
| Construct with given pre-size (filled with 0), subsequently add specified locations as 1, auto-vivify entries if needed. | |
| bitSet (const labelRange &range) | |
| Construct with automatic sizing (filled with 0), and set the specified locations as 1. | |
| bitSet (const labelUList &locations) | |
| Construct with automatic sizing (filled with 0), and set the specified locations as 1. | |
| template<class Addr> | |
| bitSet (const IndirectListBase< label, Addr > &locations) | |
| Construct with automatic sizing (filled with 0), and set the specified locations as 1. | |
| template<unsigned N> | |
| bitSet (const FixedList< label, N > &locations) | |
| Construct with automatic sizing (filled with 0), and set the specified locations as 1. | |
| autoPtr< bitSet > | clone () const |
| Clone. | |
| bool | all () const |
| True if all bits in this bitset are set or if the set is empty. | |
| bool | any () const |
| True if any bits in this bitset are set. | |
| bool | none () const |
| True if no bits in this bitset are set. | |
| unsigned int | count (const bool on=true) const |
| Count number of bits set. | |
| bool | intersects (const bitSet &other) const |
| True if any bits in the other bitset intersect (are the same). | |
| bool | test (const label pos) const |
| Test for True value at specified position, never auto-vivify entries. | |
| bool | contains (const label pos) const |
| Test for True value at specified position, never auto-vivify entries. | |
| label | find_first () const |
| Locate the first bit that is set. | |
| label | find_first_not () const |
| Locate the first bit that is unset. | |
| label | find_last () const |
| Locate the last bit set. | |
| label | find_next (label pos) const |
| Locate the next bit set, starting one beyond the specified position. | |
| labelList | toc () const |
| The indices of the on bits as a sorted labelList. | |
| labelList | sortedToc () const |
| The indices of the on bits as a sorted labelList. | |
| List< bool > | values () const |
| Return the bitset values as a boolList. | |
| void | fill (const bool val) |
| Assign all entries to the given value. | |
| void | assign (const UList< bool > &bools) |
| Copy assign all entries from a list of bools. | |
| void | set (const bitSet &bitset) |
| Set specified bits from another bitset. | |
| void | set (const labelRange &range) |
| Set the specified range of bits. | |
| bool | test_set (const label i, const bool val=true) |
| Test for True value at specified position and change the value at that position. | |
| bitSet & | unset (const bitSet &other) |
| Unset (subtract) the bits specified in the other bitset, which is a set difference corresponds to the logical operation. | |
| void | unset (const labelRange &range) |
| Unset the specified range of bits specified, never auto-vivifies. | |
| void | flip () |
| Invert all bits in the addressable region. | |
| void | flip (const label pos) |
| Invert bit at the specified position. | |
| void | resize_last () |
| Resize to include the last on bit only. | |
| void | swap (bitSet &bitset) |
| Swap contents. | |
| void | transfer (bitSet &bitset) |
| Transfer the contents of the argument list into this list and annul the argument list. | |
| bitSet & | bound (const label maxSize) |
| Ensure the addressable range does not exceed maxSize. | |
| bitSet & | bound (const bitSet &other) |
| Ensure the addressable range does not exceed that of other. | |
| bitSet & | extend (const label minSize) |
| Ensure that minSize is covered by the bitSet. | |
| bitSet & | extend (const bitSet &other) |
| Ensure the bitset is addressable throughout the range of other. | |
| template<class InputIter> | |
| label | setMany (InputIter first, InputIter last) |
| Set the locations listed by the iterator range, auto-vivify entries if needed. | |
| label | set (const labelUList &locations) |
| Set the listed locations to 1. | |
| template<class Addr> | |
| label | set (const IndirectListBase< label, Addr > &locations) |
| Set the listed locations to 1. | |
| template<unsigned N> | |
| label | set (const FixedList< label, N > &locations) |
| Set the listed locations to 1. | |
| template<class InputIter> | |
| label | unset (InputIter first, InputIter last) |
| Unset the locations listed by the iterator range, never auto-vivify entries. | |
| label | unset (const labelUList &locations) |
| Unset the listed locations, never auto-vivifies. | |
| template<class Addr> | |
| label | unset (const IndirectListBase< label, Addr > &locations) |
| Unset the listed locations, never auto-vivifies. | |
| template<unsigned N> | |
| label | unset (const FixedList< label, N > &locations) |
| Unset the listed locations, never auto-vivifies. | |
| const_iterator | begin () const |
| Iterator set to the position of the first on bit. | |
| const_iterator | cbegin () const |
| Iterator set to the position of the first on bit. | |
| const_iterator | begin (label pos) const |
| Iterator set to the position of the first on bit that occurs at or beyond the given position. | |
| const_iterator | cbegin (label pos) const |
| Iterator set to the position of the first on bit that occurs at or beyond the given position. | |
| const_iterator | end () const noexcept |
| Iterator beyond the end of the bitSet. | |
| const_iterator | cend () const noexcept |
| Iterator beyond the end of the bitSet. | |
| bool | operator() (const label pos) const |
| Test value at specified position, same as test(). | |
| unsigned int | operator[] (const label i) const |
| Identical to get() - get value at index. | |
| reference | operator[] (const label i) |
| Non-const access to value at index. | |
| bitSet & | operator= (const bitSet &bitset) |
| Copy assignment. | |
| bitSet & | operator= (bitSet &&bitset) |
| Move assignment. | |
| bitSet & | operator= (const bool val) |
| Assign all entries to the given value. fill(). | |
| bitSet & | operator&= (const bitSet &other) |
| Bitwise-AND all the bits in other with the bits in this bitset. | |
| bitSet & | operator|= (const bitSet &other) |
| Bitwise-OR operator - similar to the set() method. | |
| bitSet & | operator^= (const bitSet &other) |
| Bitwise-XOR operator - retains unique entries. | |
| bitSet & | operator-= (const bitSet &other) |
| Remove entries from this list - identical to the unset() method. | |
| Istream & | readListToc (Istream &is) |
| Read contents in "compact" format, which is the listing of the 'on' bits (toc). | |
| Ostream & | writeListToc (Ostream &os, label shortLen=0) const |
| Write contents in "compact" format, which is the listing of the 'on' bits (toc), with line-breaks in ASCII guided by shortLen parameter ('0' suppresses line-breaks entirely). | |
| InfoProxy< bitSet > | info () const noexcept |
| Return info proxy, used to print information to a stream. | |
| void | broadcast (int communicator=-1, bool syncSizes=true) |
| Broadcast the contents. | |
| void | broadcast (std::pair< int, int > communicator_root, bool syncSizes=true) |
| Broadcast the contents using the specified communicator/root. | |
| void | reduceAnd (int communicator=-1, bool syncSizes=true) |
Inplace bit_and parallel reduction. | |
| void | reduceOr (int communicator=-1, bool syncSizes=true) |
Inplace bit_or parallel reduction. | |
| bool | found (const label pos) const |
| Same as contains(). | |
| void | assign (const unsigned int val) |
| Deprecated(2020-11) use fill(). | |
| template<class Addr> | |
| Foam::label | set (const IndirectListBase< label, Addr > &locations) |
| template<class Addr> | |
| Foam::label | unset (const IndirectListBase< label, Addr > &locations) |
| Public Member Functions inherited from PackedList< 1 > | |
| Foam::List< IntType > | unpack () const |
| Foam::List< IntType > | unpack (const labelRange &range) const |
| Foam::List< IntType > | unpack (const labelUList &locations) const |
| constexpr | PackedList () noexcept |
| Default construct, zero-sized and no allocation. | |
| autoPtr< PackedList< Width > > | clone () const |
| Clone. | |
| void | checkIndex (const label i) const |
| Check index is within valid range [0,size). | |
| bool | empty () const noexcept |
| True if the list is empty (ie, size() is zero). | |
| label | size () const noexcept |
| Number of entries. | |
| label | capacity () const noexcept |
| Number of elements that can be stored without reallocating. | |
| bool | uniform () const |
| True if all entries have identical values (and list is non-empty). | |
| bool | equal (const PackedList< Width > &other) const |
| Test for equality of sizes and the bits set. | |
| unsigned int | get (const label i) const |
| Get value at index i or 0 for out-of-range. | |
| bool | set (const label i, unsigned int val=~0u) |
| Set value at index i, default value set is the max_value. | |
| bool | unset (const label i) |
| Unset the entry at index i. | |
| labelList | values () const |
| Return the values as a list of labels. | |
| void | fill (const unsigned int val) |
| Assign all entries to the given value. | |
| bool | trim (label minpos=-1) |
| Trim any trailing zero elements, optionally specifying a a minimum position, below which trimming will not occur. | |
| void | reset () |
| Clear all bits but do not adjust the addressable size. | |
| void | setCapacity (const label numElem) |
| Alter the size of the underlying storage. | |
| void | resize (const label numElem, const unsigned int val=0u) |
| Reset addressable list size, does not shrink the allocated size. | |
| void | resize_nocopy (const label numElem) |
| Currently identical to resize. Subject to future change (Oct-2021). | |
| void | reserve (const label numElem) |
| Reserve allocation space for at least this size (uses a size doubling strategy). | |
| void | reserve_exact (const label numElem) |
| Reserve allocation space for at least this size (uses the specified size without any other resizing strategy). | |
| void | clear () |
| Clear the list, i.e. set addressable size to zero. | |
| void | clearStorage () |
| Clear the list and delete storage. | |
| void | shrink_to_fit () |
| Shrink the allocated space to what is actually used. | |
| void | shrink () |
| Alias for shrink_to_fit(). | |
| void | swap (PackedList< Width > &rhs) |
| Swap contents with argument. | |
| void | transfer (PackedList< Width > &rhs) |
| Transfer the contents of the argument list into this list and annul the argument list. | |
| const List< block_type > & | storage () const noexcept |
| Return the underlying storage blocks. | |
| const block_type * | cdata () const noexcept |
| A const pointer to the raw storage. | |
| block_type * | data () noexcept |
| A pointer to the raw storage. | |
| const char * | cdata_bytes () const noexcept |
| A const pointer to the raw storage, reinterpreted as byte data. | |
| char * | data_bytes () noexcept |
| A pointer to the raw storage, reinterpreted as byte data. | |
| std::streamsize | size_data () const noexcept |
| The number of integer blocks addressed in the raw storage. Same as num_blocks(). | |
| std::streamsize | size_bytes () const noexcept |
| The number of bytes addressed in the raw storage including any padding. | |
| std::streamsize | byteSize () const noexcept |
| Same as size_bytes(). | |
| Ostream & | printBits (Ostream &os, bool debugOutput=false) const |
| Print bit patterns, optionally with extra debug. | |
| Istream & | readList (Istream &is) |
| Clear list and read from stream. | |
| Ostream & | writeList (Ostream &os, label shortLen=0) const |
| Write List, with line-breaks in ASCII when length exceeds shortLen. | |
| void | push_back (const unsigned int val) |
| Append a value at the end of the list. | |
| void | pop_back (label n=1) |
| Reduce size by 1 or more elements. Can be called on an empty list. | |
| unsigned int | remove () |
| Remove and return the last element. | |
| unsigned int | operator[] (const label i) const |
| Identical to get() - get value at index. | |
| void | operator= (const PackedList< Width > &list) |
| Copy assignment. | |
| InfoProxy< PackedList< Width > > | info () const noexcept |
| Return info proxy, used to print information to a stream. | |
| void | assign (const unsigned int val) |
| Deprecated(2020-11) use fill(). | |
| void | setSize (const label n, unsigned int val=0u) |
| Alias for resize(). | |
| PackedList< Width > & | append (const unsigned int val) |
| Append a value at the end of the list. | |
| Public Member Functions inherited from PackedListCore | |
| ClassNameNoDebug ("PackedList") | |
| Define template name. | |
Static Public Member Functions | |
| static const bitSet & | null () noexcept |
| Return a null bitSet (reference to a nullObject). | |
| static bitSet | gatherValues (bool localValue, int communicator=-1) |
| Gather individual values into bitSet locations. | |
| static bitSet | allGather (bool localValue, int communicator=-1) |
| Allgather individual values into bitSet locations. | |
| Static Public Member Functions inherited from PackedList< 1 > | |
| static constexpr label | num_blocks (label numElem) noexcept |
| Calculate the number of blocks required to _address_ the requested number of elements. | |
| static constexpr block_type | mask_lower (unsigned elementOffset) |
| Masking for all bits below the element offset. | |
Protected Member Functions | |
| bitSet & | minusEq (const bitSet &other) |
| The set difference. | |
| bitSet & | andEq (const bitSet &other) |
| The set logical AND. | |
| bitSet & | orEq (const bitSet &other) |
| The set logical OR. | |
| bitSet & | xorEq (const bitSet &other) |
| The set logical XOR. | |
| Protected Member Functions inherited from PackedList< 1 > | |
| unsigned int | repeated_value (unsigned val) |
| unsigned int | readValue (Istream &is) |
| void | setPair (Istream &is) |
| void | writeEntry (Ostream &os) const |
| Write as a dictionary entry. | |
| void | clear_trailing_bits () |
| Clear any partial rubbish in the last addressable block. | |
| void | copyAssign (const PackedList< Width > &rhs) |
| Copy assignment. | |
| label | first_block () const |
| Find the first block with a '1' bit. | |
| label | first_not_block () const |
| Find the first block with a '0' bit. | |
Additional Inherited Members | |
| Static Public Attributes inherited from PackedList< 1 > | |
| static constexpr unsigned | bits_per_block |
| The number of bits in a single block. | |
| static constexpr unsigned | element_width |
| The width of an individual element (in bits). | |
| static constexpr unsigned | elem_per_block |
| The number of elements stored per data block. | |
| static constexpr block_type | max_value |
| The max value for an element which is also the bit-mask of the individual element. | |
| Protected Types inherited from PackedList< 1 > | |
| typedef List< block_type > | block_container |
| The internal container for storing the blocks. | |
| Protected Attributes inherited from PackedList< 1 > | |
| block_container | blocks_ |
| The blocks of raw data. | |
| label | size_ |
| Number of entries used. | |
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety of bit-set operations. Its behaviour is largely list-like, with some HashSet features.
| typedef bool value_type |
| typedef unsigned int const_reference |
|
inlineconstexprnoexcept |
Default construct an empty, zero-sized bitSet.
Definition at line 23 of file bitSetI.H.
References Foam::noexcept, and PackedList< 1 >::PackedList().
Referenced by allGather(), andEq(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), bound(), ClassName(), extend(), gatherValues(), info(), intersects(), minusEq(), null(), operator&=(), operator-=(), operator=(), operator=(), operator^=(), operator|=(), orEq(), readListToc(), set(), swap(), transfer(), unset(), writeListToc(), and xorEq().


|
explicit |
Construct from Istream.
Definition at line 219 of file bitSet.C.
References PackedList< 1 >::PackedList().

|
inlineexplicit |
Construct with given size, with all bits set to 0.
Definition at line 29 of file bitSetI.H.
References n, and PackedList< 1 >::PackedList().

|
inline |
|
inline |
Copy construct.
Definition at line 43 of file bitSetI.H.
References bitSet(), and PackedList< 1 >::PackedList().

|
inline |
Move construct.
Definition at line 49 of file bitSetI.H.
References bitSet(), and PackedList< 1 >::PackedList().

| bitSet | ( | const bitSet & | bitset, |
| const labelUList & | addr ) |
Construct a new bitSet by extracting the specified (unique) locations of an existing bitSet.
Definition at line 227 of file bitSet.C.
References bitSet(), PackedList< Width >::get(), set(), PackedList< 1 >::size(), and UList< T >::size().

| bitSet | ( | const bitSet & | bitset, |
| const IndirectListBase< label, Addr > & | addr ) |
| bitSet | ( | const bitSet & | bitset, |
| const labelRange & | range ) |
Construct a new bitSet by extracting the specified range locations of an existing bitSet.
Definition at line 240 of file bitSet.C.
References bitSet(), PackedList< Width >::get(), Foam::pos(), range, set(), and PackedList< 1 >::size().

|
inlineexplicit |
|
explicit |
|
inline |
Construct with given pre-size (filled with 0), subsequently add specified locations as 1, auto-vivify entries if needed.
Definition at line 63 of file bitSetI.H.
References UList< T >::begin(), bitSet(), UList< T >::end(), n, and setMany().

|
inline |
Construct with given pre-size (filled with 0), subsequently add specified locations as 1, auto-vivify entries if needed.
Definition at line 72 of file bitSetI.H.
References IndirectListBase< T, Addr >::begin(), bitSet(), IndirectListBase< T, Addr >::end(), n, and setMany().

|
inline |
|
explicit |
|
inlineexplicit |
Construct with automatic sizing (filled with 0), and set the specified locations as 1.
Definition at line 96 of file bitSetI.H.
References UList< T >::begin(), bitSet(), UList< T >::end(), and setMany().

|
inlineexplicit |
Construct with automatic sizing (filled with 0), and set the specified locations as 1.
Definition at line 105 of file bitSetI.H.
References IndirectListBase< T, Addr >::begin(), bitSet(), IndirectListBase< T, Addr >::end(), and setMany().

|
protected |
The set difference.
A and B can have different sizes. Never changes the original set size. Non-overlapping parts are considered off.
Definition at line 39 of file bitSet.C.
References bitSet(), PackedList< Width >::blocks_, PackedList< 1 >::blocks_, InfoInFunction, Foam::nl, none(), PackedList< 1 >::num_blocks(), PackedList< 1 >::reset(), Foam::rhs(), PackedList< Width >::size(), and PackedList< 1 >::size().
Referenced by operator-=(), and unset().


|
protected |
The set logical AND.
A and B can have different sizes. Never changes the original set size. Non-overlapping parts are considered off.
Definition at line 74 of file bitSet.C.
References bitSet(), PackedList< Width >::blocks_, PackedList< 1 >::blocks_, FOAM_UNLIKELY, InfoInFunction, Foam::nl, none(), none, PackedList< 1 >::num_blocks(), reset(), resize(), Foam::rhs(), PackedList< Width >::size(), and PackedList< 1 >::size().
Referenced by operator&=().


|
protected |
The set logical OR.
A and B can have different sizes
The size grows to accommodate new on bits.
Definition at line 126 of file bitSet.C.
References bitSet(), PackedList< Width >::blocks_, PackedList< 1 >::blocks_, find_last(), InfoInFunction, Foam::nl, none(), PackedList< 1 >::num_blocks(), resize(), Foam::rhs(), PackedList< Width >::size(), and PackedList< 1 >::size().
Referenced by operator|=(), and set().


|
protected |
The set logical XOR.
A and B can have different sizes.
The size grows to accommodate new on bits.
Definition at line 171 of file bitSet.C.
References bitSet(), PackedList< Width >::blocks_, PackedList< 1 >::blocks_, find_last(), InfoInFunction, Foam::nl, none(), PackedList< 1 >::num_blocks(), reset(), resize(), Foam::rhs(), PackedList< Width >::size(), and PackedList< 1 >::size().
Referenced by operator^=().


|
inlinestaticnoexcept |
Return a null bitSet (reference to a nullObject).
Definition at line 138 of file bitSet.H.
References bitSet(), Foam::noexcept, and Foam::NullObjectRef().
Referenced by PatchTools::edgeNormals(), PatchTools::edgeNormals(), addPatchCellLayer::globalEdgeFaces(), PatchTools::pointNormals(), and PatchTools::pointNormals().


| ClassName | ( | "bitSet" | ) |
Declare type-name (with debug switch).
References bitSet(), n, and Foam::noexcept.

|
inline |
Clone.
Definition at line 116 of file bitSetI.H.
References autoPtr< T >::New().
Referenced by bitSet().


|
inline |
True if all bits in this bitset are set or if the set is empty.
Returning true for an empty set may not seem intuitive, but conforms with boost definitions and std::all_of behaviour.
Definition at line 401 of file bitSetI.H.
References PackedList< 1 >::empty(), and PackedList< 1 >::first_not_block().
Referenced by bitSet(), triSurface::checkTriangles(), ensightCase::printTimeset(), NASedgeFormat::read(), and STARCDedgeFormat::read().


|
inline |
True if any bits in this bitset are set.
Definition at line 408 of file bitSetI.H.
References PackedList< 1 >::first_block().
Referenced by bitSet(), ensightMesh::correct(), toc(), cellCellStencil::walkFront(), writeObjects::write(), and writeListToc().


|
inline |
True if no bits in this bitset are set.
Definition at line 414 of file bitSetI.H.
References PackedList< 1 >::first_block().
Referenced by andEq(), bitSet(), ensightMesh::correct(), distanceSurface::createGeometry(), distanceSurface::filterRegionProximity(), minusEq(), orEq(), and xorEq().


|
inline |
Count number of bits set.
| on | can be set to false to count the number of unset bits instead. |
Definition at line 420 of file bitSetI.H.
References Foam::BitOps::bit_count(), PackedList< 1 >::blocks_, PackedList< 1 >::num_blocks(), and PackedList< 1 >::size().
Referenced by AABBTree< Type >::AABBTree(), bitSet(), cellMapper::cellMapper(), Foam::BitOps::count(), mapDistributeBase::countUnmapped(), faceMapper::faceMapper(), polyMeshFilter::filterEdges(), addPatchCellLayer::findDuplicatedPoints(), isoSurfaceCell::isoSurfaceCell(), isoSurfaceTopo::isoSurfaceTopo(), dynamicRefineFvMesh::mapFields(), Foam::operator<<(), pointMapper::pointMapper(), meshRefinement::printMeshInfo(), ensightCase::printTimeset(), dynamicRefineFvMesh::selectRefineCells(), dynamicRefineFvMesh::selectUnrefinePoints(), faceAreaWeightAMI::setNextFaces(), addPatchCellLayer::setRefinement(), toc(), meshRefinement::updateIntersections(), ConeInjection< CloudType >::updateMesh(), FieldActivatedInjection< CloudType >::updateMesh(), KinematicLookupTableInjection< CloudType >::updateMesh(), ReactingLookupTableInjection< CloudType >::updateMesh(), ReactingMultiphaseLookupTableInjection< CloudType >::updateMesh(), ThermoLookupTableInjection< CloudType >::updateMesh(), cellCellStencil::walkFront(), writeListToc(), and triSurface::writeStats().


| bool intersects | ( | const bitSet & | other | ) | const |
True if any bits in the other bitset intersect (are the same).
Definition at line 296 of file bitSet.C.
References bitSet(), PackedList< Width >::blocks_, PackedList< 1 >::blocks_, PackedList< 1 >::num_blocks(), Foam::rhs(), PackedList< Width >::size(), and PackedList< 1 >::size().
Referenced by bitSet().


|
inline |
Test for True value at specified position, never auto-vivify entries.
Definition at line 334 of file bitSet.H.
References PackedList< 1 >::get(), Foam::pos(), and test().
Referenced by polyMeshTetDecomposition::adjustTetBasePtIs(), extendedEdgeMesh::autoMap(), Foam::calcElementMasks(), polyDualMesh::calcFeatures(), Foam::calcNormalDistance_filtered(), dynamicRefineFvMesh::calculateProtectedCells(), primitiveMeshTools::cellDeterminant(), ensightFaces::classify(), edgeCollapser::consistentCollapse(), hexRef8::consistentSlowRefinement2(), hexRef8::consistentUnrefinement(), ensightMesh::correct(), meshRefinement::countHits(), snappyLayerDriver::doLayers(), dynamicRefineFvMesh::extendMarkedCells(), distanceSurface::filterKeepLargestRegion(), distanceSurface::filterKeepNearestRegions(), distanceSurface::filterPrepareRegionSplit(), meshRefinement::findRegions(), meshRefinement::gAverage(), dynamicRefineFvMesh::init(), isoSurfaceTopo::isoSurfaceTopo(), edgeMesh::mergeEdges(), operator()(), cell::opposingFace(), plicRDF::reconstruct(), distanceSurface::refineBlockedCells(), snappySnapDriver::repatchToSurface(), fvMeshSubset::reset(), dynamicRefineFvMesh::selectRefineCells(), dynamicRefineFvMesh::selectUnrefinePoints(), motionSmootherAlgo::setDisplacement(), faceAreaWeightAMI::setNextFaces(), edgeCollapser::setRefinement(), hexRef8::setRefinement(), fieldSmoother::smoothLambdaMuDisplacement(), fieldSmoother::smoothNormals(), extendedEdgeMesh::sortPointsAndEdges(), triSurface::subsetMesh(), test(), test_set(), meshRefinement::updateIntersections(), cellCellStencil::walkFront(), meshRefinement::weightedSum(), and meshRefinement::zonify().


|
inline |
Test for True value at specified position, never auto-vivify entries.
Definition at line 343 of file bitSet.H.
References PackedList< 1 >::get(), and Foam::pos().
Referenced by found().


|
inline |
Locate the first bit that is set.
Definition at line 260 of file bitSetI.H.
References PackedList< 1 >::blocks_, PackedList< 1 >::elem_per_block, PackedList< 1 >::first_block(), and Foam::pos().
Referenced by Foam::reorder(), Foam::ListOps::setValue(), and writeListToc().


|
inline |
Locate the first bit that is unset.
Definition at line 289 of file bitSetI.H.
References PackedList< 1 >::blocks_, PackedList< 1 >::elem_per_block, PackedList< 1 >::first_not_block(), and Foam::pos().
Referenced by fileOperation::nProcs().


|
inline |
Locate the last bit set.
Definition at line 321 of file bitSetI.H.
References PackedList< 1 >::blocks_, PackedList< 1 >::elem_per_block, PackedList< 1 >::num_blocks(), Foam::pos(), and PackedList< 1 >::size().
Referenced by topoBitSet::check(), orEq(), resize_last(), topoBitSet::updateLabels(), and xorEq().


|
inline |
Locate the next bit set, starting one beyond the specified position.
Definition at line 347 of file bitSetI.H.
References PackedList< 1 >::blocks_, PackedList< 1 >::elem_per_block, PackedList< 1 >::num_blocks(), Foam::pos(), and PackedList< 1 >::size().
Referenced by Foam::reorder(), faceAreaWeightAMI::setNextFaces(), Foam::ListOps::setValue(), and writeListToc().


| Foam::labelList toc | ( | ) | const |
The indices of the on bits as a sorted labelList.
Definition at line 476 of file bitSet.C.
References any(), PackedList< 1 >::blocks_, count(), PackedList< 1 >::elem_per_block, PackedList< 1 >::num_blocks(), Foam::pos(), and PackedList< 1 >::size().
Referenced by snappySnapDriver::calcNearestSurface(), snappySnapDriver::detectNearSurfaces(), sortedToc(), Foam::BitOps::toc(), and solidBodyFvGeometryScheme::updateGeom().


|
inline |
The indices of the on bits as a sorted labelList.
This is identical to toc(), which is always sorted.
Definition at line 441 of file bitSetI.H.
References toc().
Referenced by meshRefinement::blockLeakFaces(), faMesh::boundaryPoints(), snappyRefineDriver::doRefine(), dynamicMultiMotionSolverFvMesh::init(), faMesh::internalPoints(), meshRefinement::intersectedPoints(), multiSolidBodyMotionSolver::multiSolidBodyMotionSolver(), noiseModel::octaves(), fvMeshSubset::reset(), cellSetOption::setCellSelection(), Foam::BitOps::sortedToc(), PatchTools::subsetMap(), and reconstructionSchemes::surface().


| Foam::List< bool > values | ( | ) | const |
Return the bitset values as a boolList.
When the output is a bool, this is more efficient than unpack()
Definition at line 515 of file bitSet.C.
References PackedList< 1 >::blocks_, PackedList< 1 >::elem_per_block, PackedList< 1 >::num_blocks(), Foam::pos(), and PackedList< 1 >::size().
Referenced by faceBitSet::distribute(), and pointBitSet::distribute().


|
inline |
Assign all entries to the given value.
Definition at line 474 of file bitSetI.H.
References PackedList< 1 >::blocks_, PackedList< 1 >::clear_trailing_bits(), PackedList< 1 >::empty(), and PackedList< 1 >::num_blocks().
Referenced by assign(), assign(), bitSet(), operator=(), and readListToc().


| void assign | ( | const UList< bool > & | bools | ) |
Copy assign all entries from a list of bools.
Definition at line 271 of file bitSet.C.
References b, PackedList< 1 >::blocks_, PackedList< Width >::elem_per_block, fill(), resize(), and UList< T >::size().
Referenced by bitSet(), faceBitSet::distribute(), pointBitSet::distribute(), and gatherValues().


|
inline |
Set specified bits from another bitset.
The current set size may grow to accommodate any new bits (auto-vivifies).
Definition at line 502 of file bitSetI.H.
References bitSet(), and orEq().
Referenced by AABBTree< Type >::AABBTree(), geometric::add(), polyMeshTetDecomposition::adjustTetBasePtIs(), Foam::apply(), cellToFaceZone::applyToSet(), extendedEdgeMesh::autoMap(), bitSet(), bitSet(), bitSet(), bitSet(), meshRefinement::blockLeakFaces(), PatchTools::calcBounds(), Foam::calcElementMasks(), polyDualMesh::calcFeatures(), createShellMesh::calcPointRegions(), dynamicRefineFvMesh::calculateProtectedCells(), oversetFvMeshBase::cellAverage(), cuttingSurfaceBase::cellSelection(), edgeCollapser::checkMeshQuality(), ABAQUSCore::readHelper::compact_nodes(), edgeCollapser::consistentCollapse(), hexRef8::consistentSlowRefinement2(), hexRef8::consistentUnrefinement(), ensightMesh::correct(), Foam::BitSetOps::create(), Foam::BitSetOps::create(), Foam::BitSetOps::create(), AABBTree< Type >::createBoxes(), inverseDistance::createStencil(), snappyLayerDriver::doLayers(), snappyRefineDriver::doRefine(), dynamicRefineFvMesh::extendMarkedCells(), distanceSurface::filterFaceProximity(), distanceSurface::filterKeepLargestRegion(), distanceSurface::filterKeepNearestRegions(), distanceSurface::filterPrepareRegionSplit(), distanceSurface::filterRegionProximity(), addPatchCellLayer::findDuplicatedPoints(), meshRefinement::findRegions(), PstreamBuffers::finishedSends(), gatherValues(), meshRefinement::getMasterEdges(), syncTools::getMasterEdges(), meshRefinement::getMasterPoints(), syncTools::getMasterPoints(), dynamicMultiMotionSolverFvMesh::init(), dynamicRefineFvMesh::init(), meshRefinement::intersectedPoints(), isoSurfaceCell::isoSurfaceCell(), isoSurfacePoint::isoSurfacePoint(), isoSurfaceTopo::isoSurfaceTopo(), dynamicRefineFvMesh::mapFields(), displacementPointSmoothingMotionSolver::markAffectedFaces(), displacementSmartPointSmoothingMotionSolver::markAffectedFaces(), meshRefinement::markOutsideFaces(), Foam::markupBoundaryPoints(), PatchTools::matchEdges(), edgeMesh::mergeEdges(), multiSolidBodyMotionSolver::multiSolidBodyMotionSolver(), oversetFvMeshBase::normalisation(), fileOperation::nProcs(), noiseModel::octaves(), bitSet::reference::operator=(), bitSet::reference::operator=(), cell::opposingFace(), cuttingSurfaceBase::performCut(), pointSmoother::pointsToMove(), NASedgeFormat::read(), STARCDedgeFormat::read(), readListToc(), plicRDF::reconstruct(), dynamicRefineFvMesh::refine(), distanceSurface::refineBlockedCells(), displacementPointSmoothingMotionSolver::relax(), displacementSmartPointSmoothingMotionSolver::relax(), Foam::reorder(), snappySnapDriver::repatchToSurface(), sampledFaceZone::sampleOnPoints(), sampledPatch::sampleOnPoints(), sampledSurface::sampleOnPoints(), cellCellStencil::seedCell(), ZoneMesh< ZoneType, MeshType >::selection(), dynamicRefineFvMesh::selectRefineCandidates(), dynamicRefineFvMesh::selectUnrefinePoints(), Foam::BitOps::set(), refinementSurfaces::setCurvatureMinLevelFields(), addPatchCellLayer::setRefinement(), edgeCollapser::setRefinement(), hexRef8::setRefinement(), cellCellStencil::setUpFront(), cellCellStencil::setUpFrontOnOversetPatch(), Foam::simpleGeometricFilter(), fieldSmoother::smoothNormals(), topoBitSet::subset(), PatchTools::subsetMap(), MeshedSurface< Face >::subsetMesh(), triSurface::subsetMesh(), reconstructionSchemes::surface(), Foam::fvc::surfaceSum(), dynamicRefineFvMesh::unrefine(), rawTopoChangerFvMesh::update(), topoBitSet::updateLabels(), ConeInjection< CloudType >::updateMesh(), FieldActivatedInjection< CloudType >::updateMesh(), KinematicLookupTableInjection< CloudType >::updateMesh(), ReactingLookupTableInjection< CloudType >::updateMesh(), ReactingMultiphaseLookupTableInjection< CloudType >::updateMesh(), ThermoLookupTableInjection< CloudType >::updateMesh(), dynamicRefineFvMesh::updateTopology(), cellCellStencil::walkFront(), writeObjects::write(), AMICache::writeData(), and triSurface::writeStats().

| void set | ( | const labelRange & | range | ) |
Set the specified range of bits.
The current set size may grow to accommodate any new bits (auto-vivifies).
Definition at line 316 of file bitSet.C.
References labelRange::adjust(), IntRange< IntType >::begin_value(), PackedList< 1 >::blocks_, PackedList< 1 >::elem_per_block, IntRange< IntType >::empty(), IntRange< IntType >::end_value(), PackedList< 1 >::mask_lower(), range, reserve(), resize(), and PackedList< 1 >::size().

|
inline |
Test for True value at specified position and change the value at that position.
Does auto-vivify for non-existent, non-zero entries.
Definition at line 494 of file bitSetI.H.
References PackedList< Width >::set(), and test().

|
inline |
Unset (subtract) the bits specified in the other bitset, which is a set difference corresponds to the logical operation.
The result is comparable to 'operator-='
A and B can have different sizes. Does not change the original set size.
Definition at line 540 of file bitSetI.H.
References bitSet(), and minusEq().
Referenced by Foam::apply(), faceAreaWeightAMI::calcAddressing(), cellMapper::cellMapper(), triSurface::checkTriangles(), edgeCollapser::consistentCollapse(), hexRef8::consistentUnrefinement(), cellDistFuncs::correctBoundaryCells(), cellDistFuncs::correctBoundaryPointCells(), mapDistributeBase::countUnmapped(), faceMapper::faceMapper(), syncTools::getInternalOrCoupledFaces(), syncTools::getInternalOrMasterFaces(), syncTools::getMasterEdges(), syncTools::getMasterFaces(), syncTools::getMasterPoints(), globalMeshData::mergePoints(), pointMapper::pointMapper(), addPatchCellLayer::setRefinement(), hexRef8::setRefinement(), Foam::simpleGeometricFilter(), Foam::BitOps::unset(), unset(), unset(), InjectedParticleInjection< CloudType >::updateMesh(), and ManualInjection< CloudType >::updateMesh().


| void unset | ( | const labelRange & | range | ) |
Unset the specified range of bits specified, never auto-vivifies.
Definition at line 395 of file bitSet.C.
References IntRange< IntType >::begin_value(), PackedList< 1 >::blocks_, PackedList< 1 >::elem_per_block, IntRange< IntType >::empty(), IntRange< IntType >::end_value(), PackedList< 1 >::mask_lower(), range, resize(), and PackedList< 1 >::size().

|
inline |
Invert all bits in the addressable region.
Definition at line 546 of file bitSetI.H.
References PackedList< 1 >::blocks_, PackedList< 1 >::clear_trailing_bits(), PackedList< 1 >::num_blocks(), and PackedList< 1 >::size().
Referenced by ensightMesh::correct(), faMesh::internalPoints(), Foam::invertCellSelection(), noiseModel::octaves(), Foam::operator~(), ConeInjection< CloudType >::updateMesh(), FieldActivatedInjection< CloudType >::updateMesh(), KinematicLookupTableInjection< CloudType >::updateMesh(), ReactingLookupTableInjection< CloudType >::updateMesh(), ReactingMultiphaseLookupTableInjection< CloudType >::updateMesh(), and ThermoLookupTableInjection< CloudType >::updateMesh().


|
inline |
Invert bit at the specified position.
A no-op if the position is out-of-range
Definition at line 561 of file bitSetI.H.
References bitSet::reference::flip(), and PackedList< 1 >::size().

|
inline |
Resize to include the last on bit only.
Functionally identical to resize(find_last()+1)
Definition at line 447 of file bitSetI.H.
References PackedList< 1 >::clear(), find_last(), Foam::pos(), and PackedList< 1 >::resize().
Referenced by Foam::operator&(), Foam::operator-(), Foam::operator^(), and Foam::operator|().


|
inline |
Swap contents.
Definition at line 462 of file bitSetI.H.
References bitSet(), and PackedList< Width >::swap().

|
inline |
Transfer the contents of the argument list into this list and annul the argument list.
Definition at line 468 of file bitSetI.H.
References bitSet(), and PackedList< Width >::transfer().
Referenced by operator=(), topoBitSet::updateLabels(), and cellCellStencil::walkFront().


|
inline |
Ensure the addressable range does not exceed maxSize.
Either decreases the size of the bitSet or is a no-op.
Definition at line 570 of file bitSetI.H.
References PackedList< 1 >::resize(), and PackedList< 1 >::size().
Referenced by bound().


|
inline |
|
inline |
Ensure that minSize is covered by the bitSet.
Either increases the size of the bitSet or is a no-op.
Definition at line 587 of file bitSetI.H.
References PackedList< 1 >::resize(), and PackedList< 1 >::size().
Referenced by extend(), and reduceOr().


|
inline |
| label setMany | ( | InputIter | first, |
| InputIter | last ) |
Set the locations listed by the iterator range, auto-vivify entries if needed.
Referenced by cellToFaceZone::applyToSet(), holeToFace::applyToSet(), bitSet(), bitSet(), bitSet(), bitSet(), bitSet(), Foam::HashSetOps::bitset(), set(), and set().

|
inline |
Set the listed locations to 1.
Does auto-vivify for non-existent entries.
Definition at line 508 of file bitSetI.H.
References UList< T >::begin(), UList< T >::end(), and setMany().

|
inline |
Set the listed locations to 1.
Does auto-vivify for non-existent entries.
Set the listed locations to 1.
Does auto-vivify for non-existent entries.
| label unset | ( | InputIter | first, |
| InputIter | last ) |
Unset the locations listed by the iterator range, never auto-vivify entries.
|
inline |
Unset the listed locations, never auto-vivifies.
Definition at line 524 of file bitSetI.H.
References UList< T >::begin(), UList< T >::end(), and unset().

|
inline |
Unset the listed locations, never auto-vivifies.
Unset the listed locations, never auto-vivifies.
|
inline |
Iterator set to the position of the first on bit.
Definition at line 224 of file bitSetI.H.
Referenced by bitSet::const_iterator::bitSet.

|
inline |
Iterator set to the position of the first on bit.
Definition at line 230 of file bitSetI.H.
Referenced by bitSet::const_iterator::bitSet.

|
inline |
Iterator set to the position of the first on bit that occurs at or beyond the given position.
Definition at line 236 of file bitSetI.H.
References Foam::pos().

|
inline |
Iterator set to the position of the first on bit that occurs at or beyond the given position.
Definition at line 242 of file bitSetI.H.
References Foam::pos().

|
inlinenoexcept |
Iterator beyond the end of the bitSet.
Definition at line 248 of file bitSetI.H.
References Foam::noexcept.
Referenced by bitSet::const_iterator::bitSet.

|
inlinenoexcept |
Iterator beyond the end of the bitSet.
Definition at line 254 of file bitSetI.H.
References Foam::noexcept.
Referenced by bitSet::const_iterator::bitSet.

|
inline |
Test value at specified position, same as test().
Enables use as a predicate
Definition at line 606 of file bitSetI.H.
References Foam::pos(), and test().

|
inline |
Identical to get() - get value at index.
Never auto-vivify entries.
Definition at line 612 of file bitSetI.H.
References PackedList< 1 >::get().

|
inline |
Non-const access to value at index.
Fatal for out-of-range indices
Definition at line 618 of file bitSetI.H.
References PackedList< 1 >::checkIndex().

|
inline |
Copy assignment.
Definition at line 627 of file bitSetI.H.
References bitSet(), and PackedList< Width >::operator=().

|
inline |
Move assignment.
Definition at line 634 of file bitSetI.H.
References bitSet(), and transfer().

|
inline |
|
inline |
Bitwise-AND all the bits in other with the bits in this bitset.
The operands may have dissimilar sizes, never changes the original set size. Non-overlapping elements are considered off.
Definition at line 648 of file bitSetI.H.
References andEq(), and bitSet().

|
inline |
|
inline |
|
inline |
| Foam::Istream & readListToc | ( | Istream & | is | ) |
Read contents in "compact" format, which is the listing of the 'on' bits (toc).
This function mostly useful for relatively sparse sets.
Definition at line 132 of file bitSetIO.C.
References token::BEGIN_LIST, bitSet(), PackedList< Width >::clear(), Foam::exit(), IOstream::fatalCheck(), Foam::FatalIOError, FatalIOErrorInFunction, fill(), FUNCTION_NAME, token::info(), token::isLabel(), token::labelToken(), Foam::nl, token::read(), Istream::readBeginList(), Istream::readEndList(), PackedList< Width >::resize(), and set().
Referenced by bitSet::const_iterator::bitSet.


| Foam::Ostream & writeListToc | ( | Ostream & | os, |
| label | shortLen = 0 ) const |
Write contents in "compact" format, which is the listing of the 'on' bits (toc), with line-breaks in ASCII guided by shortLen parameter ('0' suppresses line-breaks entirely).
This function mostly useful for relatively sparse sets.
Definition at line 35 of file bitSetIO.C.
References any(), token::BEGIN_BLOCK, token::BEGIN_LIST, bitSet(), count(), token::END_BLOCK, token::END_LIST, Switch::FALSE, find_first(), find_next(), Switch::INVALID, Foam::nl, os(), PackedList< Width >::size(), token::SPACE, and Switch::TRUE.
Referenced by bitSet::const_iterator::bitSet.


| void broadcast | ( | int | communicator = -1, |
| bool | syncSizes = true ) |
Broadcast the contents.
| communicator | The UPstream communicator (default is worldComm) |
| syncSizes | False: sizes already consistent. True: adjust sizes. |
Definition at line 642 of file bitSet.C.
References UPstream::is_parallel(), UPstream::masterNo(), and UPstream::worldComm.
Referenced by allGather().


| void broadcast | ( | std::pair< int, int > | communicator_root, |
| bool | syncSizes = true ) |
Broadcast the contents using the specified communicator/root.
| communicator_root | UPstream communicator and broadcast root |
| syncSizes | False: sizes already consistent. True: adjust sizes. |
Definition at line 626 of file bitSet.C.
References UList< T >::first(), and UPstream::is_parallel().

| void reduceAnd | ( | int | communicator = -1, |
| bool | syncSizes = true ) |
Inplace bit_and parallel reduction.
| communicator | The UPstream communicator (default is worldComm) |
| syncSizes | False: sizes already consistent. True: adjust (shrink) sizes. |
Definition at line 656 of file bitSet.C.
References PackedList< 1 >::clear_trailing_bits(), PackedList< 1 >::data(), PackedList< 1 >::empty(), UPstream::is_parallel(), UPstream::mpiAllReduce(), PackedList< 1 >::num_blocks(), resize(), PackedList< 1 >::size(), and UPstream::worldComm.

| void reduceOr | ( | int | communicator = -1, |
| bool | syncSizes = true ) |
Inplace bit_or parallel reduction.
| communicator | The UPstream communicator (default is worldComm) |
| syncSizes | False: sizes already consistent. True: adjust (extend) sizes. |
Definition at line 705 of file bitSet.C.
References PackedList< 1 >::clear_trailing_bits(), PackedList< 1 >::data(), PackedList< 1 >::empty(), extend(), UPstream::is_parallel(), UPstream::mpiAllReduce(), PackedList< 1 >::num_blocks(), PackedList< 1 >::size(), and UPstream::worldComm.

|
static |
Gather individual values into bitSet locations.
On master, the resulting bitSet has size == nProcs, otherwise zero length.
For non-parallel : the length of the returned set is 1 with localValue.
| localValue | The processor-local value |
| communicator | The UPstream communicator (default is worldComm) |
Definition at line 755 of file bitSet.C.
References assign(), bitSet(), UList< T >::data(), UPstream::is_parallel(), UPstream::master(), UPstream::mpiGather(), UPstream::nProcs(), List< T >::resize(), PackedList< Width >::resize(), set(), and UPstream::worldComm.
Referenced by allGather().


|
static |
Allgather individual values into bitSet locations.
The resulting bitSet has size nProcs, identical on all ranks. Behaves like Pstream::allGatherValues() but returning a bitSet.
| localValue | The processor-local value |
| communicator | The UPstream communicator (default is worldComm) |
Definition at line 800 of file bitSet.C.
References bitSet(), broadcast(), gatherValues(), UPstream::is_parallel(), UPstream::nProcs(), PackedList< Width >::resize(), and UPstream::worldComm.

|
inline |
Same as contains().
Definition at line 960 of file bitSet.H.
References contains(), and Foam::pos().

|
inline |
|
inline |
Definition at line 515 of file bitSetI.H.
References IndirectListBase< T, Addr >::begin(), IndirectListBase< T, Addr >::end(), and setMany().

|
inline |
Definition at line 531 of file bitSetI.H.
References IndirectListBase< T, Addr >::begin(), IndirectListBase< T, Addr >::end(), and unset().
