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>
109 return (this->
find(val,
pos, len) >= 0);
113 template<
class T,
class Addr>
116 return (i == addr_.size()-1 ? 0 : i+1);
120 template<
class T,
class Addr>
123 return (i ? i-1 : addr_.size()-1);
127 template<
class T,
class Addr>
130 return values_[addr_.front()];
133 template<
class T,
class Addr>
136 return values_[addr_.front()];
140 template<
class T,
class Addr>
143 return values_[addr_.back()];
146 template<
class T,
class Addr>
149 return values_[addr_.back()];
153 template<
class T,
class Addr>
156 return values_[this->fcIndex(i)];
160 template<
class T,
class Addr>
163 return values_[this->fcIndex(i)];
167 template<
class T,
class Addr>
170 return values_[this->rcIndex(i)];
174 template<
class T,
class Addr>
177 return values_[this->rcIndex(i)];
180 template<
class T,
class Addr>
183 const label len = addr_.size();
188 for (label i = 0; i < len; ++i)
190 result[i] = values_[addr_[i]];
199 template<
class T,
class Addr>
202 return values_[addr_[i]];
206 template<
class T,
class Addr>
210 return values_[addr_[i]];
214 template<
class T,
class Addr>
218 for (
const label idx : addr_)
225 template<
class T,
class Addr>
229 for (
const label idx : addr_)
236 template<
class T,
class Addr>
246 template<
class T,
class Addr>
256 template<
class T,
class Addr>
257 template<
class AnyAddr>
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)
bool contains(const T &val, label pos=0, label len=-1) const
Is the value contained in the 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 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)