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];
label size() const
Return the number of elements in the list.
#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.
BiIndirectList(const UList< T > &posList, const UList< T > &negList, const labelUList &)
Construct given the complete lists and the addressing array.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static label negIndex(const label)
T & operator[](const label)
Return non-const access to an element.
static label posIndex(const label)
Calculate index given whether index is into posList or negList.
bool empty() const
Return true if the list is empty (ie, size() is zero).
void operator=(List< T > &&)
Move assignment to List of addressed elements.
void resetAddressing(const labelUList &)
Reset addressing.
List< T > operator()() const
Return the addressed elements as a List.
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...
const UList< T > & negList() const
const UList< T > & posList() const
const List< label > & addressing() const
Return the list addressing.
label size() const
Return the number of elements in the UList.