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)),
61 return addressing_.size();
68 return addressing_.empty();
110 addressing_.transfer(addr());
137 result[i] = operator[](i);
147 label index = addressing_[i];
151 return posList_[index];
155 return negList_[-index-1];
163 label index = addressing_[i];
167 return posList_[index];
171 return negList_[-index-1];
179 if (addressing_.size() != ae.
size())
181 FatalErrorIn(
"BiIndirectList<T>::operator=(const UList<T>&)")
182 <<
"Addressing and list of addressed elements " 183 "have different sizes: " 184 << addressing_.size() <<
" " << ae.
size()
190 operator[](i) = ae[i];
const UList< T > & posList() const
BiIndirectList(const UList< T > &posList, const UList< T > &negList, const labelUList &)
Construct given the complete lists and the addressing array.
A simple container for copying or transferring objects of type <T>.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
void operator=(const UList< T > &)
Assignment from UList of addressed elements.
const UList< T > & negList() const
static label negIndex(const label)
bool empty() const
Return true if the list is empty (ie, size() is zero).
label size() const
Return the number of elements in the UList.
void resetAddressing(const labelUList &)
Reset addressing.
errorManip< error > abort(error &err)
T & operator[](const label)
Return non-const access to an element.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
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 list.