Go to the documentation of this file.
55 posList_(
const_cast<UList<T>&
>(posList)),
56 negList_(
const_cast<UList<T>&
>(negList)),
69 posList_(
const_cast<UList<T>&
>(posList)),
70 negList_(
const_cast<UList<T>&
>(negList)),
71 addressing_(std::move(addr))
80 return addressing_.size();
87 return addressing_.empty();
129 addressing_.transfer(addr);
142 result[i] = operator[](i);
152 const label index = addressing_[i];
156 return posList_[index];
160 return negList_[-index-1];
168 const label index = addressing_[i];
172 return posList_[index];
176 return negList_[-index-1];
184 if (addressing_.size() != ae.
size())
187 <<
"Addressing and list of addressed elements "
188 "have different sizes: "
189 << addressing_.size() <<
" " << ae.
size()
195 operator[](i) = ae[i];
bool empty() const noexcept
True if the list is empty (ie, size() is zero).
BiIndirectList(const UList< T > &posList, const UList< T > &negList, const labelUList &addr)
Construct given the complete lists and the addressing array.
static label posIndex(const label i)
Calculate index given whether index is into posList or negList.
#define forAll(list, i)
Loop across all elements in list.
static label negIndex(const label i)
void operator=(const UList< T > &ae)
Assignment to UList of addressed elements.
T & operator[](const label i)
Return non-const access to an element.
List< T > operator()() const
Return the addressed elements as a List.
const UList< T > & posList() const
label size() const noexcept
The number of elements in the list.
errorManip< error > abort(error &err)
void resetAddressing(const labelUList &addr)
Copy reset addressing.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
const List< label > & addressing() const
Return the list addressing.
const UList< T > & negList() const