121 template<
class UnaryCondition>
125 const UnaryCondition&
select,
129 const label len =
values.size();
134 addr.resize_nocopy(len);
137 for (label i=0; i < len; ++i)
153 template<
class UnaryPredicate>
157 const UnaryPredicate& pred,
161 const label len =
values.size();
166 addr.resize_nocopy(len);
169 for (label i=0; i < len; ++i)
191 const label len =
values.size();
202 for (label i = 1; i < len; ++i)
208 order[
count] = order[i];
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
List< bool > select(const label n, const labelUList &locations)
Construct a selection list of bools (all false) with the given pre-size, subsequently add specified l...
IndirectList(const UList< T > &values, const labelUList &addr)
Copy construct addressing, shallow copy values reference.
static IndirectList< T > subset(const UList< T > &values, const UnaryCondition &select, const bool invert=false)
Return an IndirectList comprising entries with positions that satisfy the condition predicate...
static IndirectList< T > subset_if(const UList< T > &values, const UnaryPredicate &pred, const bool invert=false)
Return an IndirectList comprising entries with values that satisfy the predicate. ...
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
void sort(UList< T > &list)
Sort 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 T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
A class for storing list addressing (labels, slices etc), which are normally to used by IndirectList...
A List with indirect addressing. Like IndirectList but does not store addressing. ...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
static IndirectList< T > uniq(const UList< T > &values, const bool sorted=false)
Return an IndirectList with duplicate entries filtered out.
List< label > labelList
A List of labels.
A List with indirect addressing.