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);
112 template<
class T,
class Addr>
115 return (i == addr_.size()-1 ? 0 : i+1);
119 template<
class T,
class Addr>
122 return (i ? i-1 : addr_.size()-1);
126 template<
class T,
class Addr>
129 return values_[addr_.front()];
132 template<
class T,
class Addr>
135 return values_[addr_.front()];
139 template<
class T,
class Addr>
142 return values_[addr_.back()];
145 template<
class T,
class Addr>
148 return values_[addr_.back()];
152 template<
class T,
class Addr>
155 return values_[this->fcIndex(i)];
159 template<
class T,
class Addr>
162 return values_[this->fcIndex(i)];
166 template<
class T,
class Addr>
169 return values_[this->rcIndex(i)];
173 template<
class T,
class Addr>
176 return values_[this->rcIndex(i)];
179 template<
class T,
class Addr>
182 const label len = addr_.size();
187 for (label i = 0; i < len; ++i)
189 result[i] = values_[addr_[i]];
198 template<
class T,
class Addr>
201 return values_[addr_[i]];
205 template<
class T,
class Addr>
209 return values_[addr_[i]];
213 template<
class T,
class Addr>
217 for (
const label idx : addr_)
224 template<
class T,
class Addr>
228 for (
const label idx : addr_)
235 template<
class T,
class Addr>
245 template<
class T,
class Addr>
255 template<
class T,
class Addr>
256 template<
class AnyAddr>
bool found(const T &val, label pos=0) const
True if the value if found in the list.
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as ListOps::find_if.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const T & back() const
The last element of the list.
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...
IndirectListBase()=delete
No default construct.
bool uniform() const
True if all entries have identical values, and list is non-empty.
T & operator[](const label i)
Non-const access to an element in the list.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
dimensionedScalar pos(const dimensionedScalar &ds)
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 T & front() const
The first element of the list.
label rcIndex(const label i) const
The reverse circular index. The previous index in the list which returns to the last at the beginning...
label fcIndex(const label i) const
The forward circular index. The next index in the list which returns to the first at the end of the l...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
void copyList(const ListType &rhs)
Deep copy values from the list.
const T & fcValue(const label i) const
Return forward circular value (ie, next value in the list)
List< T > list() const
Return the addressed elements as a List.
const T & rcValue(const label i) const
Return reverse circular value (ie, previous value in the list)
static constexpr const zero Zero
Global zero (0)