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())
182 <<
"Addressing and list of addressed elements " 183 "have different sizes: " 184 << addressing_.size() <<
" " << ae.
size()
190 operator[](i) = ae[i];
label size() const
Return the number of elements in the list.
A simple container for copying or transferring objects of type <T>.
#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 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
void operator=(const UList< T > &)
Assignment to UList of addressed elements.
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.