Go to the documentation of this file.
46 this->checkStart(
range.start());
87 Foam::Swap(this->
operator[](0), this->
operator[](i));
97 const label
upper = size()-1;
101 Foam::Swap(this->
operator[](i), this->
operator[](upper));
109 const label len = this->size_;
111 if (len != list.size_)
114 <<
"Lists have different sizes: "
115 << len <<
" != " << list.
size() <<
nl
125 static_cast<void*
>(this->v_), list.v_, this->size_bytes()
133 for (label i = 0; i < len; ++i)
146 const label len = this->size_;
148 if (len != list.
size())
151 <<
"Lists have different sizes: "
152 << len <<
" != " << list.
size() <<
nl
158 for (label i = 0; i < len; ++i)
171 const label len = this->size();
175 for (label i=0; i < len; ++i)
185 const label len = this->size();
189 for (label i=0; i < len; ++i)
204 <<
"Invalid for non-contiguous data types"
207 return this->size_bytes();
214 const label len = this->size();
222 if (list[
pos] == val)
239 if (pos < 0 || pos >= this->size())
241 pos = this->size()-1;
248 if (list[
pos] == val)
267 template<
class T,
class Compare>
277 std::stable_sort(a.
begin(), a.
end());
281 template<
class T,
class Compare>
284 std::stable_sort(a.
begin(), a.
end(), comp);
300 const label len = this->size_;
301 if (len != list.size_)
311 for (label i = 0; i < len; ++i)
313 equal = (lhs[i] == rhs[i]);
333 const_iterator lhs =
begin(), rhs = list.
begin();
334 lhs <
end() && rhs < list.
end();
342 else if (*rhs < *lhs)
349 return (this->size_ < list.size_);
356 return list.operator<(*this);
363 return !list.operator<(*this);
bool operator<(const UList< T > &list) const
Compare two ULists lexicographically. Takes linear time.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
labelRange validateRange(const labelRange &requestedRange) const
iterator end() noexcept
Return an iterator to end traversing the UList.
bool operator>=(const UList< T > &a) const
Return true if !(a < b). Takes linear time.
static constexpr const zero Zero
Global zero (0)
bool operator==(const UList< T > &a) const
Equality operation on ULists of the same type.
bool operator<=(const UList< T > &a) const
Return true if !(a > b). Takes linear time.
void deepCopy(const UList< T > &list)
Copy elements of the given UList. Sizes must match!
void swapFirst(const label i)
Swap element with the first element. Fatal on an empty list.
void stableSort(UList< T > &a)
label rfind(const T &val, label pos=-1) const
Find index of the last occurrence of the value.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
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.
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.
label size() const noexcept
The number of elements in the list.
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)
void shuffle(UList< T > &a)
UList< T > & operator=(const UList< T > &)=delete
No copy assignment (default: shallow copy)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
labelRange subset0(const label size) const
Calculate the intersection with the given 0/size range.
std::streamsize byteSize() const
bool operator<(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A older than B.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
void size(const label n)
Older name for setAddressableSize.
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
void moveLast(const label i)
Move element to the last position.
#define List_ACCESS(type, f, fp)
label find(const T &val, label pos=0) 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.
Macros for accessing List elements.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
dimensionedScalar pos(const dimensionedScalar &ds)