Foam::HashSetOps Namespace Reference

Various operations for HashSet. More...

Classes

struct  plusEqOp
 Combine HashSet operation. Equivalent to 'a |= b'. More...
 

Functions

labelHashSet used (const bitSet &select)
 Convert a bitset to a labelHashSet of the indices used. More...
 
labelHashSet used (const UList< bool > &select)
 Convert a list of bools to a labelHashSet of the indices used. More...
 
bitSet bitset (const labelHashSet &locations)
 Transform the on locations to a bitSet. More...
 
List< boolbools (const labelHashSet &locations)
 

Detailed Description

Various operations for HashSet.

Function Documentation

◆ used() [1/2]

Foam::labelHashSet used ( const bitSet select)

Convert a bitset to a labelHashSet of the indices used.

Parameters
selectthe bitset for which an on entry corresponds to an index in the output labelHashSet
Returns
a labelHashSet of the selected indices

This is equivalent of the following code, but more efficiently implemented.

bitSet select = ...;
return labelHashSet(select.toc());

Definition at line 35 of file HashOps.C.

References bitSet::any(), bitSet::count(), bitSet::find_first(), bitSet::find_next(), and Foam::output().

Referenced by mappedPatchBase::calcMapping(), polyTopoChange::changeMesh(), dynamicRefineFvMesh::init(), polyTopoChange::makeMesh(), Foam::polyMeshZipUpCells(), and HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::printInfo().

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

◆ used() [2/2]

Foam::labelHashSet used ( const UList< bool > &  select)

Convert a list of bools to a labelHashSet of the indices used.

Parameters
selectthe boolList for which a true entry corresponds to an index in the output labelHashSet
Returns
a labelHashSet of the selected indices

Definition at line 53 of file HashOps.C.

References Foam::output(), and UList< T >::size().

Here is the call graph for this function:

◆ bitset()

Foam::bitSet bitset ( const labelHashSet locations)

Transform the on locations to a bitSet.

Ignored any negative values (invalid positions in a bitset).

Parameters
locationsthe list of positions corresponding to an on bit.
Returns
a bitset
See also
BitSetOps::create for other possibilities

Definition at line 72 of file HashOps.C.

References HashSet< Key, Hash >::begin(), HashSet< Key, Hash >::end(), and Foam::output().

Referenced by bitSet::bitSet(), Foam::operator<<(), bitSet::operator=(), Foam::operator~(), ZoneMesh< cellZone, polyMesh >::selection(), Foam::BitOps::set(), bitSet::set(), bitSet::swap(), bitSet::transfer(), and Foam::BitOps::unset().

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

◆ bools()

Foam::List< bool > bools ( const labelHashSet locations)

Transform the on locations to a boolList, with true for each non-negative location and false for all others.

Parameters
locationsthe list of positions corresponding to an on bit.
Returns
a boolList
Note
The operation necessarily discards any negative values since these are invalid positions in a boolList.

Definition at line 81 of file HashOps.C.

References HashSet< Key, Hash >::begin(), HashSet< Key, Hash >::end(), Foam::max(), and Foam::output().

Referenced by bitSet::assign(), bitSet::bitSet(), Foam::BitOps::set(), parseDriver::setInternalFieldResult(), topoBoolSet::topoBoolSet(), and Foam::BitOps::unset().

Here is the call graph for this function:
Here is the caller graph for this function:
Foam::labelHashSet
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition: HashSet.H:85