Go to the documentation of this file.
43 for (
const label newIdx : map)
51 <<
"Inverse location " << newIdx
52 <<
" is out of range. List has size " << len
57 if (inverse[newIdx] >= 0)
60 <<
"Map is not one-to-one. At index " << i
61 <<
" element " << newIdx <<
" has already occurred\n"
62 <<
"Please use invertOneToMany instead"
85 for (
const label newIdx : map)
91 <<
"Inverse location " << newIdx
92 <<
" is out of range. List has size " << len
120 for (
const label newIdx : map)
130 for (
label i=0; i < len; ++i)
132 inverse[i].
resize(sizes[i]);
137 for (
const label newIdx : map)
141 inverse[newIdx][sizes[newIdx]++] = i;
198 input =
reorder(oldToNew, input, prune);
label find_first() const
Locate the first bit that is set.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static constexpr const zero Zero
Global zero.
void set(const bitSet &bitset)
Set specified bits from another bitset.
iterator begin()
Return an iterator to begin traversing the UList.
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
ListType reorder(const labelUList &oldToNew, const ListType &input, const bool prune=false)
Reorder the elements of a list.
void resize(const label newSize)
Adjust allocated size of list.
label find_next(label pos) const
Locate the next bit set, starting one beyond the specified position.
errorManip< error > abort(error &err)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void identity(labelUList &map, label start=0)
Set identity map with (map[i] == i)
label ListType::const_reference const label start
label size() const noexcept
Number of entries.
void reserve(const label nElem)
Reserve allocation space for at least this size.
bool trim(label minpos=-1)
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
Various functions to operate on Lists.
iterator end()
Return an iterator to end traversing the UList.
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
dimensionedScalar pos(const dimensionedScalar &ds)