Foam::BitSetOps Namespace Reference

Factory and other methods for bitSet. More...

Functions

bitSet create (const label n, const labelHashSet &locations, const bool on=true)
 Create a bitSet with length n with the specifed on locations. More...
 
bitSet create (const label n, const labelUList &locations, const bool on=true)
 Create a bitSet with length n with the specifed on locations. More...
 
bitSet create (const label n, const label select, const labelUList &values, const bool on=true)
 

Detailed Description

Factory and other methods for bitSet.

Function Documentation

◆ create() [1/3]

Foam::bitSet create ( const label  n,
const labelHashSet locations,
const bool  on = true 
)

Create a bitSet with length n with the specifed on locations.

The resulting bitSet is guaranteed to have exactly the specified length, any values or positions larger than n-1 are silently ignored.

Parameters
nthe size of the output bitSet
locationsthe list of positions corresponding to an on bit.
onthe value for on. Set as false to invert the logic.
Returns
a bitset

Definition at line 35 of file BitOps.C.

References n, and bitSet::set().

Referenced by codeStream::getFunction(), profiling::profiling(), and fvMeshSubset::setCellSubset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [2/3]

Foam::bitSet create ( const label  n,
const labelUList locations,
const bool  on = true 
)

Create a bitSet with length n with the specifed on locations.

The resulting bitSet is guaranteed to have exactly the specified length, any values or positions larger than n-1 are silently ignored.

Parameters
nthe size of the output bitSet
locationsthe list of positions corresponding to an on bit.
onthe value for on. Set as false to invert the logic.
Returns
a bitset

Definition at line 57 of file BitOps.C.

References n, and bitSet::set().

Here is the call graph for this function:

◆ create() [3/3]

Foam::bitSet create ( const label  n,
const label  select,
const labelUList values,
const bool  on = true 
)

Create a bitSet with length n with the specifed on locations when the list values are equal to the select value.

The resulting bitSet is guaranteed to have exactly the specified length, any values or positions larger than n-1 are silently ignored.

Parameters
nthe size of the output bitSet
selectthe value to select as 'on'
valuesthe values to scan for 'select'
onthe value for on. Set as false to invert the logic.
Returns
a bitset

Definition at line 79 of file BitOps.C.

References Foam::min(), n, bitSet::set(), and Foam::HashTableOps::values().

Here is the call graph for this function: