31 bool Foam::PackedBoolList::bitorPrepare
33 const PackedList<1>& lst,
41 const label packLen2 = lst.packedLength();
45 bool needTrim =
false;
46 maxPackLen = packLen1;
48 if (packLen1 == packLen2)
53 this->
size() != lst.size()
55 && rhs[maxPackLen-1] > lhs[maxPackLen-1]
64 else if (packLen2 < packLen1)
67 maxPackLen = packLen2;
72 for (
label storeI = packLen1; storeI < packLen2; ++storeI)
76 maxPackLen = storeI+1;
81 if (maxPackLen > packLen1)
92 template<
class LabelListType>
93 Foam::label Foam::PackedBoolList::setIndices(
const LabelListType& indices)
96 reserve(indices.size());
101 if (set(indices[elemI]))
111 template<
class LabelListType>
112 Foam::label Foam::PackedBoolList::unsetIndices(
const LabelListType& indices)
117 if (unset(indices[elemI]))
127 template<
class LabelListType>
128 Foam::label Foam::PackedBoolList::subsetIndices(
const LabelListType& indices)
131 if (empty() || indices.empty())
144 const label& index = indices[elemI];
145 if (
operator[](index))
173 const bool needTrim = bitorPrepare(lst, len);
179 for (
label i=0; i < len; ++i)
193 return setIndices(indices);
199 return setIndices(indices);
212 for (
label i=0; i < len; ++i)
221 return unsetIndices(indices);
227 return unsetIndices(indices);
234 if (this->size() > lst.
size())
243 const label len = this->packedLength();
245 for (
label i=0; i < len; ++i)
254 return subsetIndices(indices);
260 return subsetIndices(indices);
276 lst[nElem++] = elemI;
296 set(elemI, lst[elemI]);
306 const bool needTrim = bitorPrepare(lst, len);
312 for (
label i=0; i < len; ++i)
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
#define forAll(list, i)
Loop across all elements in list.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
void set(const PackedList< 1 > &)
Set specified bits.
labelList used() const
Return indices of the used (true) elements as a list of labels.
PackedBoolList()
Construct null.
void operator=(const bool val)
Assignment of all entries to the given value.
void subset(const PackedList< 1 > &)
Subset with the specified list.
PackedBoolList & operator^=(const PackedList< 1 > &)
Xor operator (lists may be dissimilar sizes)
void unset(const PackedList< 1 > &)
Unset specified bits.
A dynamically allocatable list of packed unsigned integers.
List< unsigned int > & storage()
Return the underlying packed storage.
void resize(const label, const unsigned int &val=0u)
Reset addressable list size, does not shrink the allocated size.
static label packedLength(const label)
Calculate the list length when packed.
label size() const
Number of entries.
bool trim()
Trim any trailing zero elements.
label packedLength() const
The list length when packed.
static unsigned int packing()
The number of entries per packed storage element.
List< StorageType > StorageList
void reserve(const label)
Reserve allocation space for at least this size.
A List with indirect addressing.
label size() const
Return the number of elements in the UList.
string trim(const string &)
Return string trimmed of leading and trailing whitespace.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
points setSize(newPointi)
triSurfaceToAgglom resize(surfacesMesh.size())