33 template<
class T,
unsigned N>
36 if constexpr (!is_contiguous_v<T>)
39 <<
"Invalid for non-contiguous data types" 48 template<
class T,
unsigned N>
51 const auto iter =
std::find(this->cbegin(), this->cend(), val);
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))
77 (this->cbegin() +
pos),
78 (this->cbegin() + len),
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>
177 std::equal(this->cbegin(), this->cend(), list.cbegin())
182 template<
class T,
unsigned N>
190 return std::lexicographical_compare
192 this->cbegin(), this->cend(),
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.
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.
errorManip< error > abort(error &err)
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
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.
label find(const T &val) const
Find index of the first occurrence of the value.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
Exchange contents of lists - see DynamicList::swap().
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
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.
bool equal(const UList< Type1 > &a, const UList< Type2 > &b)
Test for list equality with different but compatible data types. Eg, int32 and int64.