46 label newPos = map[i];
50 if (inverse[newPos] >= 0)
53 <<
"Map is not one-to-one. At index " << i
54 <<
" element " << newPos <<
" has already occurred before"
55 <<
nl <<
"Please use invertOneToMany instead"
96 inverse[newI][nElems[newI]++] = i;
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
void setSize(const label)
Reset size of List.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
errorManip< error > abort(error &err)
const labelList emptyLabelList
labelListList invertOneToMany(const label len, const labelUList &)
Invert one-to-many map. Unmapped elements will be size 0.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.