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;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
labelListList invertOneToMany(const label len, const labelUList &)
Invert one-to-many map. Unmapped elements will be size 0.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Various functions to operate on Lists.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void setSize(const label)
Reset size of List.