BitOps.H File Reference
Include dependency graph for BitOps.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  List< T >
 A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bounds checking, etc. More...
 
struct  bitInfo< UIntType >
 An (unsigned) integral type adapter, for output of bit values. More...
 

Namespaces

 Foam::BitOps
 Various bit-wise operations, etc.
 
 Foam::BitSetOps
 Factory and other methods for bitSet. Adaptor methods for other containers that are somewhat similar to bitSet (eg, boolList, labelHashSet).
 
 Foam
 Namespace for OpenFOAM.
 

Functions

unsigned int count (const UList< bool > &bools, const bool val=true)
 Count number of 'true' entries. More...
 
bool all (const UList< bool > &bools)
 True if all entries are 'true' or if the set is empty. More...
 
bool any (const UList< bool > &bools)
 True if any entries are 'true'. More...
 
bool none (const UList< bool > &bools)
 True if no entries are 'true'. More...
 
void set (List< bool > &bools, const labelRange &range)
 Set the specified range 'on' in a boolList. More...
 
void set (labelHashSet &hashset, const labelRange &range)
 Set the specified range in a labelHashSet. More...
 
void set (bitSet &bitset, const labelRange &range)
 Forward to bitSet::set(labelRange) More...
 
void unset (List< bool > &bools, const labelRange &range)
 Unset the specified range 'on' in a boolList. More...
 
void unset (labelHashSet &hashset, const labelRange &range)
 Unset the specified range in a labelHashSet. More...
 
void unset (bitSet &bitset, const labelRange &range)
 Forward to bitSet::unset(labelRange) More...
 
template<class UIntType >
unsigned int bit_count (UIntType x)
 Count arbitrary number of bits (of an integral type) More...
 
template<>
unsigned int bit_count (uint32_t x)
 Count bits in a 32-bit value (Hamming weight method) More...
 
template<>
unsigned int bit_count (uint64_t x)
 Count bits in a 64-bit value (Hamming weight method) More...
 
template<class UIntType , unsigned BitWidth>
UIntType repeat_value (unsigned val)
 Repeat a value of the given BitWidth into the destination output type. More...
 
template<class UIntType >
Ostream & print (Ostream &os, UIntType value, char off='0', char on='1')
 Print 0/1 bits in the (unsigned) integral type. More...
 
bitSet create (const label n, const labelHashSet &locations, const bool on=true)
 Create a bitSet with length n with the specified on locations. More...
 
bitSet create (const label n, const labelUList &locations, const bool on=true)
 Create a bitSet with length n with the specified on locations. More...
 
bitSet create (const label n, const label select, const labelUList &values, const bool on=true)
 
template<class UIntType >
Ostream & operator<< (Ostream &os, const BitOps::bitInfo< UIntType > &info)
 Print 0/1 bits of an (unsigned) integral type via an adapter. More...
 

Detailed Description

Original source file BitOps.H

Definition in file BitOps.H.