Go to the documentation of this file.
63 template<
class T>
class List;
86 return std::all_of(
bools.begin(),
bools.end(), [](
bool b){return b;});
93 return std::any_of(
bools.begin(),
bools.end(), [](
bool b){return b;});
100 return std::none_of(
bools.begin(),
bools.end(), [](
bool b){return b;});
129 template<
class UIntType>
134 for (;
x; ++
n) {
x &= (
x-1); }
144 x -= (
x >> 1) & 0x55555555;
145 x = (
x & 0x33333333) + ((
x >> 2) & 0x33333333);
147 return ((((
x + (
x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24);
155 x -= (
x >> 1) & 0x5555555555555555;
156 x = (
x & 0x3333333333333333) + ((
x >> 2) & 0x3333333333333333);
159 ((((
x + (
x >> 4)) & 0x0F0F0F0F0F0F0F0F) * 0x0101010101010101) >> 56);
169 template<
class UIntType,
unsigned BitW
idth>
174 BitWidth && std::numeric_limits<UIntType>::digits >= BitWidth,
175 "BitWidth too large for target output"
179 const unsigned nrepeat = (std::numeric_limits<UIntType>::digits / BitWidth);
182 const unsigned mask = ((1u << BitWidth) - 1);
185 UIntType fillval = ((val >= mask) ? mask : val);
188 for (
unsigned i = 1; i < nrepeat; ++i)
190 fillval |= (fillval << BitWidth);
198 template<
class UIntType>
199 inline Ostream&
print(Ostream&
os, UIntType value,
char off=
'0',
char on=
'1')
211 unsigned test = (1u << (std::numeric_limits<UIntType>::digits-1));
216 os << ((value & test) ? on : off);
225 template<
class UIntType>
238 operator UIntType ()
const {
return value; }
241 operator UIntType& () {
return value; }
317 template<
class UIntType>
bitSet create(const label n, const labelHashSet &locations, const bool on=true)
void set(List< bool > &bools, const labelRange &range)
List< bool > bools(const labelHashSet &locations)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
unsigned int bit_count(UIntType x)
constexpr bitInfo() noexcept
void unset(List< bool > &bools, const labelRange &range)
bitSet bitset(const labelHashSet &locations)
A HashTable with keys but without contents that is similar to std::unordered_set.
bool all(const UList< bool > &bools)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
const dimensionedScalar b
UIntType repeat_value(unsigned val)
A range or interval of labels defined by a start and a size.
bool any(const UList< bool > &bools)
OBJstream os(runTime.globalPath()/outputName)
bool none(const UList< bool > &bools)
unsigned int count(const UList< bool > &bools, const bool val=true)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Ostream & print(Ostream &os, UIntType value, char off='0', char on='1')
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
UList< label > labelUList
A UList of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys and label hasher.