35 const UPtrList<T>& list
47 const UPtrList<T>& list,
55 template<
class T,
class ListComparePredicate>
58 const UPtrList<T>& list,
60 const ListComparePredicate& comp
68 std::stable_sort(order.begin(), order.end(), comp);
80 list.sortOrder(order,
false);
85 template<
class ReturnType,
class T,
class AccessOp>
88 const UPtrList<T>& list,
92 const label len = list.size();
94 List<ReturnType>
output(len);
97 for (label i = 0; i < len; ++i)
99 const T* ptr = list.get(i);
113 template<
class T,
class UnaryMatchPredicate>
116 const UPtrList<T>& list,
117 const UnaryMatchPredicate& matcher
122 const label len = list.
size();
127 for (label i = 0; i < len; ++i)
129 const T* ptr = list.get(i);
131 if (
bool(ptr) && matcher(ptr->name()))
146 const UPtrList<T>& list
153 template<
class T,
class UnaryMatchPredicate>
156 const UPtrList<T>& list,
157 const UnaryMatchPredicate& matcher
160 const label len = list.size();
162 for (label i = 0; i < len; ++i)
164 const T* ptr = list.get(i);
166 if (
bool(ptr) && matcher(ptr->name()))
176 template<
class T,
class UnaryMatchPredicate>
179 const UPtrList<T>& list,
180 const UnaryMatchPredicate& matcher
183 const label len = list.
size();
188 for (label i = 0; i < len; ++i)
190 const T* ptr = list.get(i);
192 if (
bool(ptr) && matcher(ptr->name()))
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
void size(const label n)
Older name for setAddressableSize.
labelList findMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Extract list indices for all items with 'name()' that matches.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
Functions to operate on Pointer Lists.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
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...
static Ostream & output(Ostream &os, const IntRange< T > &range)
List< label > labelList
A List of labels.
void shuffle(UList< T > &list)
Randomise the list order.
label firstMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Find first list item with 'name()' that matches, -1 on failure.
A UPtrList compare binary predicate for normal sort order. Null entries (if any) sort to the end...