Go to the documentation of this file.
44 this->checkStart(slice.
start());
45 this->checkSize(slice.
start() + slice.
size());
85 Foam::Swap(this->
operator[](0), this->
operator[](i));
99 Foam::Swap(this->
operator[](i), this->
operator[](upper));
107 const label len = this->size_;
109 if (len != list.size_)
112 <<
"ULists have different sizes: "
113 << len <<
" " << list.size_
123 static_cast<void*
>(this->v_), list.v_, this->byteSize()
131 for (
label i = 0; i < len; ++i)
190 <<
"Cannot return binary size of a list with non-primitive elements"
194 return this->size_*
sizeof(
T);
201 const label len = this->size();
203 if (
start >= 0 && len)
225 const label len1 = (this->size()-1);
228 for (
label i = ((
pos >= 0 &&
pos < len1) ?
pos : len1); i >= 0; --i)
247 template<
class T,
class Compare>
257 std::stable_sort(a.
begin(), a.
end());
261 template<
class T,
class Compare>
264 std::stable_sort(a.
begin(), a.
end(), comp);
271 std::random_shuffle(a.
begin(), a.
end());
280 const label len = this->size_;
281 if (len != list.size_)
291 for (
label i = 0; i < len; ++i)
293 equal = (lhs[i] == rhs[i]);
313 const_iterator lhs =
begin(), rhs = list.
begin();
314 lhs <
end() && rhs < list.
end();
322 else if (*rhs < *lhs)
329 return (this->size_ < list.size_);
336 return list.operator<(*this);
343 return !list.operator<(*this);
bool operator<(const UList< T > &list) const
Compare two ULists lexicographically. Takes linear time.
label ListType::const_reference val
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
labelRange validateRange(const labelRange &range) const
bool operator>=(const UList< T > &a) const
Return true if !(a < b). Takes linear time.
static constexpr const zero Zero
Global zero.
bool operator==(const UList< T > &a) const
Equality operation on ULists of the same type.
#define List_FOR_ALL(f, i)
bool operator<=(const UList< T > &a) const
Return true if !(a > b). Takes linear time.
string lower(const std::string &str)
Return string transformed with std::tolower on each character.
label size() const noexcept
The effective size of the range.
label find(const T &val, const label start=0) const
Find index of the first occurrence of the value.
void deepCopy(const UList< T > &list)
Copy elements of the given UList.
void Swap(DynamicList< T, SizeMin1 > &a, DynamicList< T, SizeMin2 > &b)
void swapFirst(const label i)
Swap element with the first element. Fatal on an empty list.
iterator begin()
Return an iterator to begin traversing the UList.
void stableSort(UList< T > &a)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
label rfind(const T &val, const label pos=-1) const
Find index of the last occurrence of the value.
void swapLast(const label i)
Swap element with the last element. Fatal on an empty list.
void moveFirst(const label i)
Move element to the first position.
bool operator!=(const UList< T > &a) const
The opposite of the equality operation. Takes linear time.
string upper(const std::string &str)
Return string transformed with std::toupper on each character.
A range or interval of labels defined by a start and a size.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
errorManip< error > abort(error &err)
bool operator>(const UList< T > &a) const
Compare two ULists lexicographically. Takes linear time.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define List_CONST_ACCESS(type, f, fp)
bool operator<(const Instant< T1 > &a, const Instant< T2 > &b)
Compare instant values for less-than.
void shuffle(UList< T > &a)
T & operator[](const label i)
Return element of UList.
UList< T > & operator=(const UList< T > &)=delete
No copy assignment (default: shallow copy)
label ListType::const_reference const label start
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label start() const noexcept
The (inclusive) lower value of the range.
std::streamsize byteSize() const
iterator end()
Return an iterator to end traversing the UList.
void moveLast(const label i)
Move element to the last position.
#define List_ACCESS(type, f, fp)
A template class to specify that a data type can be considered as being contiguous in memory.
Macros for accessing List elements.
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
dimensionedScalar pos(const dimensionedScalar &ds)