Go to the documentation of this file.
30 template<
class T,
class Addr>
31 template<
class ListType>
43 const label len = addr_.size();
45 if (len != rhs.size())
48 <<
"Addressing and list of addressed elements "
49 "have different sizes: " << len <<
" " << rhs.size()
54 for (label i = 0; i < len; ++i)
56 values_[addr_[i]] = rhs[i];
63 template<
class T,
class Addr>
77 template<
class T,
class Addr>
80 const label len = this->size();
87 const T& val = (*this)[0];
89 for (label i=1; i<len; ++i)
91 if (val != (*
this)[i])
101 template<
class T,
class Addr>
108 return (this->
find(val,
pos) >= 0);
114 template<
class T,
class Addr>
118 const label len = addr_.size();
123 for (label i = 0; i < len; ++i)
125 result[i] = values_[addr_[i]];
132 template<
class T,
class Addr>
135 return values_[addr_[i]];
139 template<
class T,
class Addr>
143 return values_[addr_[i]];
147 template<
class T,
class Addr>
151 for (
const label idx : addr_)
158 template<
class T,
class Addr>
162 for (
const label idx : addr_)
169 template<
class T,
class Addr>
179 template<
class T,
class Addr>
189 template<
class T,
class Addr>
190 template<
class AnyAddr>
List< T > operator()() const
Return the addressed elements as a List.
void copyList(const ListType &rhs)
Deep copy values from the list.
static constexpr const zero Zero
Global zero (0)
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
T & operator[](const label i)
Non-const access to an element in the list.
IndirectListBase()=delete
No default construct.
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Find index of the first occurrence that satisfies the predicate.
errorManip< error > abort(error &err)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool uniform() const
True if all entries have identical values, and list is non-empty.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void operator=(const T &val)
Assign all addressed elements to the given value.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
bool found(const T &val, label pos=0) const
True if the value if found in the list.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
dimensionedScalar pos(const dimensionedScalar &ds)