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];
205 std::iota(map.
begin(), map.
end(), start);
209 void Foam::ListOps::unionEqOp::operator()
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
static Ostream & output(Ostream &os, const IntRange< T > &range)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void resize(const label len)
Adjust allocated size of list.
iterator end() noexcept
Return an iterator to end traversing the UList.
static constexpr const zero Zero
Global zero (0)
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
ListType reorder(const labelUList &oldToNew, const ListType &input, const bool prune=false)
Reorder the elements of a list.
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.
static Istream & input(Istream &is, IntRange< T > &range)
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
Various functions to operate on Lists.
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
dimensionedScalar pos(const dimensionedScalar &ds)