Go to the documentation of this file.
31 template<
class T,
class Addr>
32 template<
class ListType>
35 const label len = addr_.size();
37 if (len != rhs.size())
40 <<
"Addressing and list of addressed elements "
41 "have different sizes: " << len <<
" " << rhs.size()
46 for (
label i = 0; i < len; ++i)
48 values_[addr_[i]] = rhs[i];
55 template<
class T,
class Addr>
69 template<
class T,
class Addr>
72 const label len = this->size();
79 const T&
val = (*this)[0];
81 for (
label i=1; i<len; ++i)
83 if (
val != (*
this)[i])
93 template<
class T,
class Addr>
100 return this->
find(val,
pos) != -1;
106 template<
class T,
class Addr>
110 const label len = addr_.size();
115 for (
label i = 0; i < len; ++i)
117 result[i] = values_[addr_[i]];
124 template<
class T,
class Addr>
127 return values_[addr_[i]];
131 template<
class T,
class Addr>
135 return values_[addr_[i]];
139 template<
class T,
class Addr>
143 for (
const label idx : addr_)
150 template<
class T,
class Addr>
154 for (
const label idx : addr_)
161 template<
class T,
class Addr>
171 template<
class T,
class Addr>
181 template<
class T,
class Addr>
182 template<
class AnyAddr>
label ListType::const_reference val
List< T > operator()() const
Return the addressed elements as a List.
bool found(const T &val, const label start=0) const
True if the value if found in the list. Linear search.
void copyList(const ListType &rhs)
Copy values The number of elements in the list.
static constexpr const zero Zero
Global zero.
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
IndirectListBase()=delete
No null 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....
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
dimensionedScalar pos(const dimensionedScalar &ds)