37 if (a.size_ != this->size_)
40 <<
"ULists have different sizes: " 41 << this->size_ <<
" " << a.size_
50 memcpy(this->v_, a.v_, this->byteSize());
102 if (!contiguous<T>())
105 <<
"Cannot return the binary size of a list of " 106 "non-primitive elements" 110 return this->size_*
sizeof(
T);
121 template<
class T,
class Cmp>
131 std::stable_sort(a.
begin(), a.
end());
135 template<
class T,
class Cmp>
138 std::stable_sort(a.
begin(), a.
end(), cmp);
145 std::random_shuffle(a.
begin(), a.
end());
154 if (this->size_ != a.size_)
185 vi < end() && ai < a.
end();
199 if (this->size_ < a.size_)
void shuffle(UList< T > &)
bool operator!=(const UList< T > &) const
The opposite of the equality operation. Takes linear time.
#define List_CONST_ACCESS(type, f, fp)
friend Ostream & operator(Ostream &, const UList< T > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool operator<(const instant &, const instant &)
Template function to specify if the data of a type are contiguous.
iterator end()
Return an iterator to end traversing the UList.
bool operator<=(const UList< T > &) const
Return true if !(a > b). Takes linear time.
void deepCopy(const UList< T > &)
Copy elements of the given UList.
bool operator==(const UList< T > &) const
Equality operation on ULists of the same type.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
bool operator>(const UList< T > &) const
Compare two ULists lexicographically. Takes linear time.
iterator begin()
Return an iterator to begin traversing the UList.
errorManip< error > abort(error &err)
A wordRe is a word, but can also have a regular expression for matching words.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void swap(UList< T > &)
Swap two ULists of the same type in constant time.
bool operator>=(const UList< T > &) const
Return true if !(a < b). Takes linear time.
bool operator>(const instant &, const instant &)
List<T> is a 1D vector of objects of type T, where the size of the vector is known and used for subsc...
bool operator<(const UList< T > &) const
Compare two ULists lexicographically. Takes linear time.
#define List_ELEM(f, fp, i)
#define List_ACCESS(type, f, fp)
#define List_FOR_ALL(f, i)
bool equal(const T &s1, const T &s2)
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
void stableSort(UList< T > &)