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...
Classes | |
class | const_iterator |
A const_iterator for iterating across on values. More... | |
class | reference |
A reference supporting read/write access to an entry. More... | |
Public Types | |
typedef unsigned int | const_reference |
![]() | |
typedef unsigned int | block_type |
The storage block type for bit elements. More... | |
typedef unsigned int | const_reference |
Public Member Functions | |
ClassName ("bitSet") | |
Declare type-name (with debug switch) More... | |
bitSet () noexcept | |
Default construct an empty, zero-sized set. More... | |
bitSet (Istream &is) | |
Construct from Istream. More... | |
bitSet (const label n) | |
Construct with given size, with all bits set to 0. More... | |
bitSet (const label n, const bool val) | |
Construct with given size and value for all elements. More... | |
bitSet (const bitSet &bitset) | |
Copy construct. More... | |
bitSet (bitSet &&bitset) | |
Move construct. More... | |
bitSet (const bitSet &bitset, const labelUList &addr) | |
Copy construct a subset. More... | |
template<class Addr > | |
bitSet (const bitSet &bitset, const IndirectListBase< label, Addr > &addr) | |
Copy construct a subset. More... | |
bitSet (const bitSet &bitset, const labelRange &range) | |
Copy construct a subset range. More... | |
bitSet (const UList< bool > &bools) | |
Construct from a list of bools. More... | |
bitSet (const label n, const labelUList &locations) | |
template<class Addr > | |
bitSet (const label n, const IndirectListBase< label, Addr > &locations) | |
template<unsigned N> | |
bitSet (const label n, const FixedList< label, N > &locations) | |
bitSet (const label n, std::initializer_list< label > locations) | |
bitSet (const labelUList &locations) | |
template<class Addr > | |
bitSet (const IndirectListBase< label, Addr > &locations) | |
template<unsigned N> | |
bitSet (const FixedList< label, N > &locations) | |
autoPtr< bitSet > | clone () const |
Clone. More... | |
bool | all () const |
True if all bits in this bitset are set or if the set is empty. More... | |
bool | any () const |
True if any bits in this bitset are set. More... | |
bool | none () const |
True if no bits in this bitset are set. More... | |
bool | uniform () const |
True if all entries have identical values, and the set is non-empty. More... | |
unsigned int | count (const bool on=true) const |
Count number of bits set. More... | |
bool | intersects (const bitSet &other) const |
True if any bits in the other bitset intersect (are the same). More... | |
bool | test (const label pos) const |
Test value at specified position, never auto-vivify entries. More... | |
bool | found (const label pos) const |
Test value at specified position, never auto-vivify entries. More... | |
label | find_first () const |
Locate the first bit that is set. More... | |
label | find_first_not () const |
Locate the first bit that is unset. More... | |
label | find_last () const |
Locate the last bit set. More... | |
label | find_next (label pos) const |
Locate the next bit set, starting one beyond the specified position. More... | |
labelList | toc () const |
The indices of the on bits as a sorted labelList. More... | |
labelList | sortedToc () const |
The indices of the on bits as a sorted labelList. More... | |
List< bool > | values () const |
Return the bitset values as a boolList. More... | |
void | fill (const bool val) |
Assign all entries to the given value. More... | |
void | assign (const UList< bool > &bools) |
Copy assign all entries from a list of bools. More... | |
void | set (const bitSet &bitset) |
Set specified bits from another bitset. More... | |
void | set (const labelRange &range) |
Set the specified range of bits. More... | |
bitSet & | unset (const bitSet &other) |
void | unset (const labelRange &range) |
Unset the specified range of bits specified, never auto-vivifies. More... | |
void | flip () |
Invert all bits in the addressable region. More... | |
void | flip (const label pos) |
Invert bits at the specified position. More... | |
void | swap (bitSet &bitset) |
Swap contents. More... | |
void | transfer (bitSet &bitset) |
bitSet & | bound (const label maxSize) |
Ensure the addressable range does not exceed maxSize. More... | |
bitSet & | bound (const bitSet &other) |
Ensure the addressable range does not exceed that of other. More... | |
bitSet & | extend (const label minSize) |
Ensure that minSize is covered by the bitSet. More... | |
bitSet & | extend (const bitSet &other) |
Ensure the bitset is addressable throughout the range of other. More... | |
template<class InputIter > | |
label | setMany (InputIter first, InputIter last) |
Set the locations listed by the iterator range,. More... | |
label | set (const labelUList &locations) |
Set the listed locations to true. More... | |
template<class Addr > | |
label | set (const IndirectListBase< label, Addr > &locations) |
Set the listed locations to true. More... | |
template<unsigned N> | |
label | set (const FixedList< label, N > &locations) |
Set the listed locations to true. More... | |
template<class InputIter > | |
label | unset (InputIter first, InputIter last) |
label | unset (const labelUList &locations) |
Unset the listed locations, never auto-vivifies. More... | |
template<class Addr > | |
label | unset (const IndirectListBase< label, Addr > &locations) |
Unset the listed locations, never auto-vivifies. More... | |
template<unsigned N> | |
label | unset (const FixedList< label, N > &locations) |
Unset the listed locations, never auto-vivifies. More... | |
const_iterator | begin () const |
Iterator set to the position of the first on bit. More... | |
const_iterator | cbegin () const |
Iterator set to the position of the first on bit. More... | |
const_iterator | begin (label pos) const |
const_iterator | cbegin (label pos) const |
const_iterator | end () const noexcept |
Iterator beyond the end of the bitSet. More... | |
const_iterator | cend () const noexcept |
Iterator beyond the end of the bitSet. More... | |
bool | operator() (const label pos) const |
Test value at specified position, same as test() More... | |
unsigned int | operator[] (const label i) const |
Identical to get() - get value at index. More... | |
reference | operator[] (const label i) |
Non-const access to value at index. More... | |
bitSet & | operator= (const bitSet &bitset) |
Copy assignment. More... | |
bitSet & | operator= (bitSet &&bitset) |
Move assignment. More... | |
bitSet & | operator= (const bool val) |
Assign all entries to the given value. fill() More... | |
bitSet & | operator&= (const bitSet &other) |
Bitwise-AND all the bits in other with the bits in this bitset. More... | |
bitSet & | operator|= (const bitSet &other) |
Bitwise-OR operator - similar to the set() method. More... | |
bitSet & | operator^= (const bitSet &other) |
Bitwise-XOR operator - retains unique entries. More... | |
bitSet & | operator-= (const bitSet &other) |
Remove entries from this list - identical to the unset() method. More... | |
InfoProxy< bitSet > | info () const |
Return info proxy. More... | |
void | assign (const unsigned int val) |
Deprecated(2020-11) use fill() More... | |
template<class Addr> | |
Foam::label | set (const IndirectListBase< label, Addr > &locations) |
template<class Addr> | |
Foam::label | unset (const IndirectListBase< label, Addr > &locations) |
template<class InputIter > | |
Foam::label | setMany (InputIter first, InputIter last) |
template<class InputIter> | |
Foam::label | unset (InputIter first, InputIter last) |
template<unsigned N> | |
Foam::label | set (const FixedList< label, N > &locations) |
template<unsigned N> | |
Foam::label | unset (const FixedList< label, N > &locations) |
![]() | |
void | writeEntry (const word &keyword, Ostream &os) const |
Write as a dictionary entry with keyword. More... | |
constexpr | PackedList () noexcept |
Default construct, zero-sized and no allocation. More... | |
PackedList (const label numElem) | |
Construct for given number of elements, initializes values to 0. More... | |
PackedList (const label numElem, const unsigned int val) | |
PackedList (Istream &is) | |
Construct from Istream. More... | |
PackedList (const PackedList< Width > &list) | |
Copy construct. More... | |
PackedList (PackedList< Width > &&list) | |
Move construct. More... | |
PackedList (const PackedList< Width > &list, const labelUList &addr) | |
Copy construct a subset. More... | |
PackedList (const PackedList< Width > &list, const IndirectListBase< label, Addr > &addr) | |
Copy construct a subset. More... | |
PackedList (const PackedList< Width > &list, const labelRange &range) | |
Copy construct a subset range. More... | |
PackedList (const labelUList &values) | |
Construct from a list of values. More... | |
PackedList (const IndirectListBase< label, Addr > &values) | |
Construct from a indirect list of values. More... | |
autoPtr< PackedList< Width > > | clone () const |
Clone. More... | |
void | checkIndex (const label i) const |
Check index is within valid range [0,size) More... | |
label | size () const noexcept |
Number of entries. More... | |
bool | empty () const noexcept |
True if the list is empty (ie, size() is zero). More... | |
label | capacity () const noexcept |
The number of elements that can be stored with reallocating. More... | |
bool | uniform () const |
True if all entries have identical values, and list is non-empty. More... | |
bool | equal (const PackedList< Width > &other) const |
Test for equality of sizes and the bits set. More... | |
unsigned int | get (const label i) const |
Get value at index i or 0 for out-of-range. More... | |
bool | set (const label i, unsigned int val=~0u) |
Set value at index i, default value set is the max_value. More... | |
bool | unset (const label i) |
Unset the entry at index i. More... | |
labelList | values () const |
Return the values as a list of labels. More... | |
List< IntType > | unpack () const |
Return the values as a list of integral type. More... | |
List< IntType > | unpack (const labelRange &range) const |
Return the range of values as a list of integral type. More... | |
List< IntType > | unpack (const labelUList &locations) const |
Foam::List< IntType > | unpack () const |
Foam::List< IntType > | unpack (const labelRange &range) const |
Foam::List< IntType > | unpack (const labelUList &locations) const |
void | fill (const unsigned int val) |
Assign all entries to the given value. More... | |
bool | trim (label minpos=-1) |
void | reset () |
Clear all bits but do not adjust the addressable size. More... | |
void | setCapacity (const label numElem) |
Alter the size of the underlying storage. More... | |
void | resize (const label numElem, const unsigned int val=0u) |
Reset addressable list size, does not shrink the allocated size. More... | |
void | resize_nocopy (const label numElem) |
Currently identical to resize. Subject to future change (Oct-2021) More... | |
void | reserve (const label numElem) |
Reserve allocation space for at least this size. More... | |
void | clear () |
Clear the list, i.e. set addressable size to zero. More... | |
void | clearStorage () |
Clear the list and delete storage. More... | |
void | shrink () |
Shrink the allocated space to what is actually used. More... | |
void | swap (PackedList< Width > &rhs) |
Swap contents with argument. More... | |
void | transfer (PackedList< Width > &rhs) |
label | nBlocks () const |
The number of internal storage blocks. More... | |
const List< unsigned int > & | storage () const |
Return the underlying storage blocks. More... | |
List< unsigned int > & | storage () |
Return the underlying storage blocks. More... | |
const unsigned int * | cdata () const noexcept |
A const pointer to the raw storage. More... | |
unsigned int * | data () noexcept |
A pointer to the raw storage. More... | |
const char * | cdata_bytes () const noexcept |
A const pointer to the raw storage, reinterpreted as byte data. More... | |
char * | data_bytes () noexcept |
A pointer to the raw storage, reinterpreted as byte data. More... | |
std::streamsize | size_bytes () const noexcept |
std::streamsize | byteSize () const noexcept |
Ostream & | printBits (Ostream &os, bool debugOutput=false) const |
Print bit patterns, optionally with extra debug. More... | |
Istream & | readList (Istream &is) |
Clear list and read from stream. More... | |
Ostream & | writeList (Ostream &os, const label shortLen=0) const |
Write List, with line-breaks in ASCII when length exceeds shortLen. More... | |
PackedList< Width > & | append (const unsigned int val) |
Append a value at the end of the list. More... | |
unsigned int | remove () |
Remove and return the last element. More... | |
unsigned int | operator[] (const label i) const |
Identical to get() - get value at index. More... | |
reference | operator[] (const label i) |
Non-const access to value at index. More... | |
void | operator= (const PackedList< Width > &lst) |
Copy assignment. More... | |
void | operator= (PackedList< Width > &&lst) |
Move assignment. More... | |
void | operator= (const unsigned int val) |
Assign all entries to the given value. fill() More... | |
InfoProxy< PackedList< Width > > | info () const |
Return info proxy. More... | |
void | assign (const unsigned int val) |
Deprecated(2020-11) use fill() More... | |
void | assign (const PackedList< Width > &rhs) |
Deprecated(2020-11) use operator=. More... | |
void | setSize (const label n, unsigned int val=0u) |
Alias for resize() More... | |
Static Public Member Functions | |
static const bitSet & | null () |
Return a null bitSet reference. More... | |
![]() | |
static constexpr label | num_blocks (label numElem) noexcept |
static constexpr block_type | mask_lower (unsigned elementOffset) |
Masking for all bits below the element offset. More... | |
Protected Member Functions | |
bitSet & | minusEq (const bitSet &other) |
The set difference. More... | |
bitSet & | andEq (const bitSet &other) |
The set logical AND. More... | |
bitSet & | orEq (const bitSet &other, const bool strict=true) |
The set logical OR. More... | |
bitSet & | xorEq (const bitSet &other, const bool strict=true) |
The set logical XOR. More... | |
![]() | |
unsigned int | repeated_value (unsigned val) |
unsigned int | readValue (Istream &is) |
void | setPair (Istream &is) |
Read an index/value pair and set accordingly. More... | |
void | setPair (Istream &is) |
void | writeEntry (Ostream &os) const |
Write as a dictionary entry. More... | |
void | clear_trailing_bits () |
Clear any partial rubbish in the last addressable block. More... | |
void | copyAssign (const PackedList< Width > &rhs) |
Copy assignment. More... | |
Additional Inherited Members | |
![]() | |
static constexpr unsigned | bits_per_block |
The number of bits in a single block. More... | |
static constexpr unsigned | element_width |
The width of an individual element (in bits). More... | |
static constexpr unsigned | elem_per_block |
The number of elements stored per data block. More... | |
static constexpr block_type | max_value |
![]() | |
typedef List< block_type > | block_container |
The internal container for storing the blocks. More... | |
![]() | |
static unsigned int | repeated_value (unsigned val) |
A fill value for complete blocks. More... | |
static unsigned int | readValue (Istream &is) |
Read a list entry (allows for specialization) More... | |
![]() | |
block_container | blocks_ |
The blocks of raw data. More... | |
label | size_ |
Number of entries used. More... | |
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 unsigned int const_reference |
|
inlinenoexcept |
|
inlineexplicit |
Construct with given size and value for all elements.
Definition at line 89 of file bitSetI.H.
References bitSet::fill().
bitSet | ( | const bitSet & | bitset, |
const labelUList & | addr | ||
) |
Copy construct a subset.
Definition at line 298 of file bitSet.C.
References Foam::HashSetOps::bitset(), PackedList< Width >::get(), bitSet::set(), and UList< T >::size().
bitSet | ( | const bitSet & | bitset, |
const IndirectListBase< label, Addr > & | addr | ||
) |
Copy construct a subset.
Definition at line 55 of file bitSetTemplates.C.
References Foam::HashSetOps::bitset(), PackedList< Width >::get(), Foam::BitOps::set(), and IndirectListBase< T, Addr >::size().
bitSet | ( | const bitSet & | bitset, |
const labelRange & | range | ||
) |
Copy construct a subset range.
Definition at line 311 of file bitSet.C.
References Foam::HashSetOps::bitset(), PackedList< Width >::get(), Foam::pos(), range, and bitSet::set().
Construct from a list of bools.
Definition at line 109 of file bitSetI.H.
References bitSet::assign(), and Foam::HashSetOps::bools().
|
inline |
Construct with given size with all bits set to 0, subsequently add specified locations as 1.
Definition at line 117 of file bitSetI.H.
References UList< T >::begin(), UList< T >::end(), and bitSet::setMany().
|
inline |
Construct with given size with all bits set to 0, subsequently add specified locations as 1.
Definition at line 127 of file bitSetI.H.
References IndirectListBase< T, Addr >::begin(), and IndirectListBase< T, Addr >::end().
Construct with given size with all bits set to 0, subsequently add specified locations as 1.
Definition at line 34 of file bitSetTemplates.C.
References FixedList< T, N >::begin(), FixedList< T, N >::end(), and bitSet::setMany().
|
inline |
|
inlineexplicit |
Construct with automatic sizing (filled with 0), and populate with specified locations as 1.
Definition at line 150 of file bitSetI.H.
References UList< T >::begin(), UList< T >::end(), and bitSet::setMany().
|
inlineexplicit |
Construct with automatic sizing (filled with 0), and populate with specified locations as 1.
Definition at line 160 of file bitSetI.H.
References IndirectListBase< T, Addr >::begin(), and IndirectListBase< T, Addr >::end().
Construct with automatic sizing (filled with 0), and populate with specified locations as 1.
Definition at line 44 of file bitSetTemplates.C.
References FixedList< T, N >::begin(), FixedList< T, N >::end(), and bitSet::setMany().
|
protected |
The set difference.
A and B can have different sizes. Does not change the original set size.
Definition at line 42 of file bitSet.C.
References PackedList< Width >::blocks_, PackedList< 1 >::blocks_, Foam::expressions::patchExpr::debug, PackedList< 1 >::empty(), PackedList< Width >::empty(), InfoInFunction, Foam::min(), Foam::nl, PackedList< 1 >::num_blocks(), PackedList< 1 >::reset(), PackedList< Width >::size(), and PackedList< 1 >::size().
Referenced by bitSet::operator-=(), and bitSet::unset().
|
protected |
The set logical AND.
A and B can have different sizes.. Does not change the original set size.
Definition at line 77 of file bitSet.C.
References PackedList< Width >::blocks_, Foam::expressions::patchExpr::debug, PackedList< Width >::empty(), InfoInFunction, Foam::min(), Foam::nl, reset(), and PackedList< Width >::size().
Referenced by bitSet::operator&=().
|
protected |
The set logical OR.
A and B can have different sizes
Definition at line 118 of file bitSet.C.
References PackedList< Width >::blocks_, Foam::expressions::patchExpr::debug, PackedList< Width >::empty(), InfoInFunction, Foam::min(), Foam::nl, resize(), PackedList< Width >::size(), and Foam::stringOps::trim().
Referenced by bitSet::operator|=(), and bitSet::set().
|
protected |
The set logical XOR.
A and B can have different sizes. Sizing behaviour as per orEq.
Definition at line 205 of file bitSet.C.
References PackedList< Width >::blocks_, Foam::expressions::patchExpr::debug, PackedList< Width >::empty(), InfoInFunction, Foam::min(), Foam::nl, reset(), resize(), PackedList< Width >::size(), and Foam::stringOps::trim().
Referenced by bitSet::operator^=().
|
inlinestatic |
ClassName | ( | "bitSet" | ) |
Declare type-name (with debug switch)
|
inline |
Clone.
Definition at line 170 of file bitSetI.H.
References autoPtr< T >::New().
|
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 to how boost has defined things.
Definition at line 460 of file bitSetI.H.
References PackedList< 1 >::empty().
Referenced by triSurface::checkTriangles(), NASedgeFormat::read(), STARCDedgeFormat::read(), and bitSet::uniform().
|
inline |
True if any bits in this bitset are set.
Definition at line 468 of file bitSetI.H.
References PackedList< 1 >::blocks_, PackedList< 1 >::num_blocks(), and PackedList< 1 >::size().
Referenced by ensightMesh::correct(), bitSet::none(), Foam::HashSetOps::used(), and inverseDistance::walkFront().
|
inline |
True if no bits in this bitset are set.
Definition at line 487 of file bitSetI.H.
References bitSet::any().
Referenced by ensightMesh::correct(), distanceSurface::createGeometry(), and bitSet::uniform().
True if all entries have identical values, and the set is non-empty.
Definition at line 493 of file bitSetI.H.
References bitSet::all(), bitSet::none(), PackedList< 1 >::size(), and bitSet::test().
|
inline |
Count number of bits set.
on | can be set to false to count the number of unset bits instead. |
Definition at line 499 of file bitSetI.H.
References Foam::BitOps::bit_count(), PackedList< 1 >::blocks_, PackedList< 1 >::num_blocks(), and PackedList< 1 >::size().
Referenced by Foam::inplaceSubset(), isoSurfaceCell::isoSurfaceCell(), isoSurfaceTopo::isoSurfaceTopo(), dynamicRefineFvMesh::mapFields(), Foam::operator<<(), meshRefinement::printMeshInfo(), dynamicRefineFvMesh::selectRefineCells(), dynamicRefineFvMesh::selectUnrefinePoints(), faceAreaWeightAMI::setNextFaces(), meshRefinement::updateIntersections(), Foam::HashSetOps::used(), and triSurface::writeStats().
True if any bits in the other bitset intersect (are the same).
Definition at line 348 of file bitSet.C.
References PackedList< Width >::blocks_, Foam::min(), and PackedList< Width >::size().
|
inline |
Test value at specified position, never auto-vivify entries.
Definition at line 520 of file bitSetI.H.
References PackedList< 1 >::get(), and Foam::pos().
Referenced by extendedEdgeMesh::autoMap(), Foam::calcNormalDistance_filtered(), dynamicRefineFvMesh::calculateProtectedCells(), primitiveMeshTools::cellDeterminant(), dynamicRefineFvMesh::checkEightAnchorPoints(), ensightFaces::classify(), ensightMesh::correct(), meshRefinement::countHits(), snappyLayerDriver::doLayers(), dynamicRefineFvMesh::extendMarkedCells(), distanceSurface::filterKeepLargestRegion(), distanceSurface::filterKeepNearestRegions(), distanceSurface::filterPrepareRegionSplit(), meshRefinement::gAverage(), dynamicRefineFvMesh::init(), isoSurfaceTopo::isoSurfaceTopo(), bitSet::operator()(), distanceSurface::refineBlockedCells(), dynamicRefineFvMesh::selectRefineCells(), dynamicRefineFvMesh::selectUnrefinePoints(), fvMeshSubset::setCellSubset(), lumpedPointMovement::setInterpolator(), faceAreaWeightAMI::setNextFaces(), fieldSmoother::smoothLambdaMuDisplacement(), extendedEdgeMesh::sortPointsAndEdges(), triSurface::subsetMesh(), bitSet::uniform(), meshRefinement::updateIntersections(), inverseDistance::walkFront(), meshRefinement::weightedSum(), and meshRefinement::zonify().
|
inline |
Test value at specified position, never auto-vivify entries.
Definition at line 526 of file bitSetI.H.
References PackedList< 1 >::get(), and Foam::pos().
|
inline |
Locate the first bit that is set.
Definition at line 314 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::ListOps::setValue(), and Foam::HashSetOps::used().
|
inline |
Locate the first bit that is unset.
Definition at line 342 of file bitSetI.H.
References PackedList< 1 >::blocks_, PackedList< 1 >::elem_per_block, and Foam::pos().
|
inline |
Locate the last bit set.
Definition at line 374 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(), writerCaching::latestGeomIndex(), and topoBitSet::updateLabels().
|
inline |
Locate the next bit set, starting one beyond the specified position.
Definition at line 400 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 faceAreaWeightAMI::setNextFaces(), Foam::ListOps::setValue(), and Foam::HashSetOps::used().
Foam::labelList toc | ( | ) | const |
The indices of the on bits as a sorted labelList.
Definition at line 527 of file bitSet.C.
References Foam::BitOps::any(), Foam::BitOps::count(), Foam::output(), and Foam::pos().
Referenced by snappySnapDriver::calcNearestSurface(), snappySnapDriver::detectNearSurfaces(), and bitSet::sortedToc().
|
inline |
The indices of the on bits as a sorted labelList.
This is identical to toc(), which is always sorted.
Definition at line 532 of file bitSetI.H.
References bitSet::toc().
Referenced by faMesh::boundaryPoints(), dynamicMultiMotionSolverFvMesh::init(), faMesh::internalPoints(), and fvMeshSubset::setCellSubset().
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 566 of file bitSet.C.
References Foam::output(), and Foam::pos().
Referenced by faceBitSet::distribute(), and pointBitSet::distribute().
|
inline |
Assign all entries to the given value.
Definition at line 550 of file bitSetI.H.
References PackedList< 1 >::blocks_, PackedList< 1 >::clear_trailing_bits(), PackedList< 1 >::empty(), PackedList< 1 >::num_blocks(), and PackedList< 1 >::size().
Referenced by bitSet::bitSet(), and bitSet::operator=().
Copy assign all entries from a list of bools.
Definition at line 328 of file bitSet.C.
References Foam::HashSetOps::bools(), clear(), resize(), and Foam::BitOps::set().
Referenced by bitSet::bitSet(), pointBitSet::distribute(), and faceBitSet::distribute().
|
inline |
Set specified bits from another bitset.
The current set size may grow to accommodate any new bits (auto-vivifies).
Definition at line 574 of file bitSetI.H.
References Foam::HashSetOps::bitset(), and bitSet::orEq().
Referenced by AABBTree< Type >::AABBTree(), geometric::add(), Foam::apply(), extendedEdgeMesh::autoMap(), bitSet::bitSet(), dynamicRefineFvMesh::calculateProtectedCells(), dynamicOversetFvMesh::cellAverage(), cuttingSurfaceBase::cellSelection(), dynamicRefineFvMesh::checkEightAnchorPoints(), edgeCollapser::checkMeshQuality(), ABAQUSCore::readHelper::compact_nodes(), fvMeshSubsetProxy::correct(), ensightMesh::correct(), dynamicRefineFvMesh::extendMarkedCells(), distanceSurface::filterKeepLargestRegion(), distanceSurface::filterKeepNearestRegions(), meshRefinement::getMasterEdges(), isoSurfaceBase::ignoreCyclics(), dynamicMultiMotionSolverFvMesh::init(), dynamicRefineFvMesh::init(), isoSurfaceCell::isoSurfaceCell(), isoSurfaceTopo::isoSurfaceTopo(), dynamicRefineFvMesh::mapFields(), meshRefinement::markOutsideFaces(), Foam::markupBoundaryPoints(), PatchTools::matchEdges(), dynamicOversetFvMesh::normalisation(), bitSet::reference::operator=(), cuttingSurfaceBase::performCut(), NASedgeFormat::read(), STARCDedgeFormat::read(), dynamicRefineFvMesh::refine(), distanceSurface::refineBlockedCells(), sampledPatch::sampleOnPoints(), sampledFaceZone::sampleOnPoints(), inverseDistance::seedCell(), ZoneMesh< cellZone, polyMesh >::selection(), dynamicRefineFvMesh::selectRefineCandidates(), dynamicRefineFvMesh::selectUnrefinePoints(), Foam::BitOps::set(), lumpedPointMovement::setInterpolator(), Foam::simpleGeometricFilter(), triSurface::subsetMesh(), MeshedSurface< Foam::face >::subsetMesh(), dynamicRefineFvMesh::unrefine(), rawTopoChangerFvMesh::update(), topoBitSet::updateLabels(), inverseDistance::walkFront(), writeObjects::write(), 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 368 of file bitSet.C.
References labelRange::adjust(), labelRange::after(), IntRange< IntType >::empty(), IntRange< IntType >::first(), range, resize(), and IntRange< IntType >::start().
|
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 612 of file bitSetI.H.
References bitSet::minusEq().
Referenced by Foam::apply(), faceAreaWeightAMI::calcAddressing(), triSurface::checkTriangles(), Foam::BitOps::unset(), and bitSet::unset().
void unset | ( | const labelRange & | range | ) |
Unset the specified range of bits specified, never auto-vivifies.
Definition at line 446 of file bitSet.C.
References labelRange::after(), IntRange< IntType >::empty(), IntRange< IntType >::first(), range, resize(), and IntRange< IntType >::start().
|
inline |
Invert all bits in the addressable region.
Definition at line 618 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::operator~(), and Foam::simpleGeometricFilter().
|
inline |
Invert bits at the specified position.
A no-op if the position is out-of-range
Definition at line 633 of file bitSetI.H.
References bitSet::reference::flip(), and PackedList< 1 >::size().
|
inline |
Swap contents.
Definition at line 538 of file bitSetI.H.
References Foam::HashSetOps::bitset(), and PackedList< Width >::swap().
|
inline |
Transfer the contents of the argument list into this list and annul the argument list.
Definition at line 544 of file bitSetI.H.
References Foam::HashSetOps::bitset(), and PackedList< Width >::transfer().
Referenced by fvMeshSubsetProxy::correct(), bitSet::operator=(), and inverseDistance::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 642 of file bitSetI.H.
References PackedList< 1 >::resize(), and PackedList< 1 >::size().
Referenced by bitSet::bound().
|
inline |
Ensure the addressable range does not exceed that of other.
Either decreases the size of the bitSet or is a no-op.
Definition at line 653 of file bitSetI.H.
References bitSet::bound(), and PackedList< Width >::size().
|
inline |
Ensure that minSize is covered by the bitSet.
Either increases the size of the bitSet or is a no-op.
Definition at line 659 of file bitSetI.H.
References PackedList< 1 >::resize(), and PackedList< 1 >::size().
Referenced by bitSet::extend().
|
inline |
Ensure the bitset is addressable throughout the range of other.
Either increases the size of the bitSet or is a no-op.
Definition at line 670 of file bitSetI.H.
References bitSet::extend(), and PackedList< Width >::size().
label setMany | ( | InputIter | first, |
InputIter | last | ||
) |
Set the locations listed by the iterator range,.
auto-vivify entries if needed.
Referenced by bitSet::bitSet(), and bitSet::set().
|
inline |
Set the listed locations to true.
Does auto-vivify for non-existent entries.
Definition at line 580 of file bitSetI.H.
References UList< T >::begin(), UList< T >::end(), and bitSet::setMany().
|
inline |
Set the listed locations to true.
Does auto-vivify for non-existent entries.
Set the listed locations to true.
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 596 of file bitSetI.H.
References UList< T >::begin(), UList< T >::end(), and bitSet::unset().
|
inline |
Unset the listed locations, never auto-vivifies.
Unset the listed locations, never auto-vivifies.
|
inline |
|
inline |
|
inline |
Iterator set to the position of the first on bit that occurs at or beyond the given position
Definition at line 290 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 296 of file bitSetI.H.
References Foam::pos().
|
inlinenoexcept |
|
inlinenoexcept |
Test value at specified position, same as test()
Enables use as a predicate
Definition at line 678 of file bitSetI.H.
References Foam::pos(), and bitSet::test().
|
inline |
Identical to get() - get value at index.
Never auto-vivify entries.
Definition at line 684 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 690 of file bitSetI.H.
References PackedList< 1 >::checkIndex().
|
inline |
Copy assignment.
Definition at line 699 of file bitSetI.H.
References Foam::HashSetOps::bitset(), and PackedList< Width >::operator=().
|
inline |
Move assignment.
Definition at line 706 of file bitSetI.H.
References Foam::HashSetOps::bitset(), and bitSet::transfer().
|
inline |
Assign all entries to the given value. fill()
Definition at line 713 of file bitSetI.H.
References bitSet::fill().
|
inline |
Bitwise-AND all the bits in other with the bits in this bitset.
The operands may have dissimilar sizes without affecting the size of the set.
Definition at line 720 of file bitSetI.H.
References bitSet::andEq().
|
inline |
Bitwise-OR operator - similar to the set() method.
The operands may have dissimilar sizes without affecting the size of the set.
Definition at line 726 of file bitSetI.H.
References bitSet::orEq().
|
inline |
Bitwise-XOR operator - retains unique entries.
The operands may have dissimilar sizes without affecting the size of the set.
Definition at line 732 of file bitSetI.H.
References bitSet::xorEq().
|
inline |
Remove entries from this list - identical to the unset() method.
The operands may have dissimilar sizes without affecting the size of the set.
Definition at line 738 of file bitSetI.H.
References bitSet::minusEq().
|
inline |
Deprecated(2020-11) use fill()
|
inline |
Definition at line 588 of file bitSetI.H.
References IndirectListBase< T, Addr >::begin(), IndirectListBase< T, Addr >::end(), and bitSet::setMany().
|
inline |
Definition at line 604 of file bitSetI.H.
References IndirectListBase< T, Addr >::begin(), IndirectListBase< T, Addr >::end(), and bitSet::unset().
Foam::label setMany | ( | InputIter | first, |
InputIter | last | ||
) |
Definition at line 75 of file bitSetTemplates.C.
References Foam::max(), and Foam::BitOps::set().
Foam::label unset | ( | InputIter | first, |
InputIter | last | ||
) |
Definition at line 101 of file bitSetTemplates.C.
References Foam::BitOps::unset().
Definition at line 118 of file bitSetTemplates.C.
References FixedList< T, N >::begin(), and FixedList< T, N >::end().
Definition at line 125 of file bitSetTemplates.C.
References FixedList< T, N >::begin(), FixedList< T, N >::end(), and Foam::BitOps::unset().