Go to the documentation of this file.
44 for (
const label newIdx : map)
52 <<
"Inverse location " << newIdx
53 <<
" is out of range. List has size " << len
58 if (inverse[newIdx] >= 0)
61 <<
"Map is not one-to-one. At index " << i
62 <<
" element " << newIdx <<
" has already occurred\n"
63 <<
"Please use invertOneToMany instead"
86 for (
const label newIdx : map)
92 <<
"Inverse location " << newIdx
93 <<
" is out of range. List has size " << len
121 for (
const label newIdx : map)
131 for (label i=0; i < len; ++i)
133 inverse[i].
resize(sizes[i]);
138 for (
const label newIdx : map)
142 inverse[newIdx][sizes[newIdx]++] = i;
159 const label len = input.
size();
171 const label newIdx = oldToNew[
pos];
199 input =
reorder(oldToNew, input, prune);
205 std::iota(map.
begin(), map.
end(), start);
209 void Foam::ListOps::unionEqOp::operator()
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...
List< Key > toc() const
The table of contents (the keys) in unsorted order.
static constexpr const zero Zero
Global zero (0)
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.
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 size() const noexcept
Number of entries.
void reserve(const label nElem)
Reserve allocation space for at least this size.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
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)