42 template<
class Compare>
56 return this->addressing();
63 return this->addressing();
77 auto& addr = this->indices();
79 addr.resize_nocopy(this->
values().size());
85 template<
class Compare>
88 auto& vals = this->
values();
89 auto& addr = this->indices();
91 addr.resize_nocopy(vals.size());
98 [&](label a, label
b) ->
bool {
return comp(vals[a], vals[
b]); }
void sort()
Forward (stable) sort the list. Functionally identical to sort with std::less<T>() ...
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
A list compare binary predicate for reverse sort.
SortList(const UList< T > &values)
Shallow copy values list reference, sort immediately.
Various functions to operate on Lists.
void reverseSort()
Reverse (stable) sort the list. Functionally identical to sort with std::greater<T>() ...
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
void sort(UList< T > &list)
Sort the list.
void uniqueSort()
Sort the list, only retaining unique entries.
void reset()
Reset list indices to identity.
void reverse(UList< T > &list, const label n)
Reverse the first n elements of the list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void reverse()
Reverse the indices.
labelList uniqueOrder(const UList< T > &input)
Return (sorted) indices corresponding to unique list values.
A List with indirect addressing.
const labelUList & indices() const noexcept
Return the list of sorted indices (updated every sort).