36 posList_(const_cast<
UList<
T>&>(posList)),
37 negList_(const_cast<
UList<
T>&>(negList)),
50 posList_(const_cast<
UList<
T>&>(posList)),
51 negList_(const_cast<
UList<
T>&>(negList)),
52 addressing_(move(addr))
61 return addressing_.size();
68 return addressing_.empty();
127 result[i] = operator[](i);
137 label index = addressing_[i];
141 return posList_[index];
145 return negList_[-index-1];
153 label index = addressing_[i];
157 return posList_[index];
161 return negList_[-index-1];
169 if (addressing_.size() != ae.size())
172 <<
"Addressing and list of addressed elements "
173 "have different sizes: "
174 << addressing_.size() <<
" " << ae.size()
178 addressing_ = move(ae);
185 if (addressing_.size() != ae.
size())
188 <<
"Addressing and list of addressed elements "
189 "have different sizes: "
190 << addressing_.size() <<
" " << ae.
size()
196 operator[](i) = ae[i];
#define forAll(list, i)
Loop across all elements in list.
label size() const
Return the number of elements in the list.
const UList< T > & posList() const
bool empty() const
Return true if the list is empty (ie, size() is zero).
const UList< T > & negList() const
T & operator[](const label)
Return non-const access to an element.
BiIndirectList(const UList< T > &posList, const UList< T > &negList, const labelUList &)
Construct given the complete lists and the addressing array.
void operator=(List< T > &&)
Move assignment to List of addressed elements.
void resetAddressing(const labelUList &)
Reset addressing.
static label negIndex(const label)
List< T > operator()() const
Return the addressed elements as a List.
static label posIndex(const label)
Calculate index given whether index is into posList or negList.
const List< label > & addressing() const
Return the list addressing.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)