33 template<
class T,
unsigned N>
39 <<
"Invalid for non-contiguous data types" 48 template<
class T,
unsigned N>
52 return (iter != this->
cend() ? label(iter - this->
cbegin()) : label(-1));
56 template<
class T,
unsigned N>
69 if (len > 0) len +=
pos;
70 if (len < 0 || len > label(
N))
82 if (iter != (this->
cbegin() + len))
84 return label(iter - this->
cbegin());
92 template<
class T,
unsigned N>
97 if (pos < 0 || pos >= label(
N))
104 if (this->v_[
pos] == val)
116 template<
class T,
unsigned N>
128 template<
class T,
unsigned N>
140 template<
class T,
unsigned N>
152 template<
class T,
unsigned N>
157 const label
upper = label(
N-1);
168 template<
class T,
unsigned N>
182 template<
class T,
unsigned N>
190 return std::lexicographical_compare
198 template<
class T,
unsigned N>
205 template<
class T,
unsigned N>
208 return list.operator<(*this);
212 template<
class T,
unsigned N>
215 return !list.operator<(*this);
219 template<
class T,
unsigned N>
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as ListOps::find_if.
bool operator!=(const FixedList< T, N > &list) const
The opposite of the equality operation. Takes linear time.
A 1D vector of objects of type <T> with a fixed length <N>.
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.
void moveLast(const label i)
Move element to the last position.
bool operator==(const FixedList< T, N > &list) const
Equality operation on FixedLists of the same type.
static std::streamsize byteSize()
Number of contiguous bytes for the list data, runtime FatalError if type is not contiguous.
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
bool operator<(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A older than B.
dimensionedScalar pos(const dimensionedScalar &ds)
bool operator>(const FixedList< T, N > &list) const
Compare two FixedLists lexicographically. Takes linear time.
void swapFirst(const label i)
Swap element with the first element.
constexpr auto cend(const C &c) -> decltype(c.end())
Return const_iterator to the end of the container c.
errorManip< error > abort(error &err)
constexpr auto cbegin(const C &c) -> decltype(c.begin())
Return const_iterator to the beginning of the container c.
bool operator<(const FixedList< T, N > &list) const
Compare two FixedLists lexicographically. Takes linear time.
const_iterator cbegin() const noexcept
Return const_iterator to begin traversing the constant FixedList.
const Vector< label > N(dict.get< Vector< label >>("N"))
label rfind(const T &val, label pos=-1) const
Find index of the last occurrence of the value.
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
label find(const T &val) const
Find index of the first occurrence of the value.
A template class to specify that a data type can be considered as being contiguous in memory...
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
Exchange contents of lists - see DynamicList::swap().
void moveFirst(const label i)
Move element to the first position.
void swapLast(const label i)
Swap element with the last element.
const_iterator cend() const noexcept
Return const_iterator to end traversing the constant FixedList.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
bool operator>=(const FixedList< T, N > &list) const
Return true if !(a < b). Takes linear time.
bool operator<=(const FixedList< T, N > &list) const
Return true if !(a > b). Takes linear time.