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];
Indexes into negList (negative index) or posList (zero or positive index).
const UList< T > & negList() const noexcept
const labelList & addressing() const noexcept
Return the list addressing.
static label posIndex(const label i)
Calculate index given whether index is into posList or negList.
static label negIndex(const label i)
bool empty() const noexcept
True if the list is empty (ie, size() is zero).
const UList< T > & posList() const noexcept
label size() const noexcept
The number of elements in the list.
void operator=(const UList< T > &ae)
Assignment to UList of addressed elements.
void resetAddressing(const labelUList &addr)
Copy reset addressing.
List< T > operator()() const
Return the addressed elements as a List.
T & operator[](const label i)
Return non-const access to an element.
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)
Older name for setAddressableSize.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManip< error > abort(error &err)
#define forAll(list, i)
Loop across all elements in list.