68template<
class IntListType>
73template<
class IntListType>
78template<
class IntListType>
87template<
class ListType>
91 const ListType& input,
92 const bool prune =
false
100template<
class ListType>
105 const bool prune =
false
112template<
unsigned W
idth>
117 const bool prune =
false
123template<
unsigned W
idth>
128 const bool prune =
false
138 const bool prune =
false
147 const bool prune =
false
153template<
class Container>
158template<
class Container>
187template<
class Container>
201template<
class T,
class ListComparePredicate>
206 const ListComparePredicate& comp
220template<
class T,
class ListComparePredicate>
225 const ListComparePredicate& comp
235template<
class ListType>
240template<
class ListType,
class ListComparePredicate>
244 const ListComparePredicate& comp
263template<
class BoolListType,
class T>
266 const BoolListType& select,
295template<
class BoolListType,
class ListType>
298 const BoolListType& select,
311template<
class ListType>
327template<
class T,
class UnaryPredicate>
331 const UnaryPredicate& pred,
342template<
class ListType,
class UnaryPredicate>
346 const UnaryPredicate& pred,
395template<
class InputIntListType,
class OutputIntListType>
403template<
class InputIntListType,
class OutputIntListType>
419template<
class ListType>
423 const ListType& input,
424 typename ListType::const_reference val,
428 return input.
find(val, start);
433template<
class ListType>
436 const ListType& input,
437 typename ListType::const_reference val,
451template<
class ListType>
452label
findMin(
const ListType& input, label start=0);
463template<
class ListType>
464label
findMax(
const ListType& input, label start=0);
477template<
class ListType>
494template<
class ListType>
497 const ListType& input,
498 typename ListType::const_reference val,
521template<
class ListType,
class T,
class ComparePredicate>
524 const ListType& input,
527 const ComparePredicate& comp
545template<
class ListType,
class T>
548 const ListType& input,
555template<
class ListType>
560template<
class ListType>
567template<
class ListType>
568ListType
rotateList(
const ListType& list,
const label
n);
572template<
template<
typename>
class ListType,
class DataType>
606template<
class Type1,
class Type2>
610template<
class Type1,
class Type2,
class BinaryPredicate>
617template<
class ListType>
622 less(
const ListType& list)
627 bool operator()(
const label a,
const label
b)
const
635template<
class ListType>
645 bool operator()(
const label a,
const label
b)
const
664template<
class ListType>
667 const ListType& input,
668 typename ListType::const_reference val,
677template<
class ListType,
class UnaryPredicate>
680 const ListType& input,
681 const UnaryPredicate& pred,
691template<
class ListType,
class UnaryPredicate>
694 const ListType& input,
695 const UnaryPredicate& pred,
701template<
class ListType,
class UnaryPredicate>
704 const ListType& input,
705 const UnaryPredicate& pred,
717template<
class ListType,
class UnaryPredicate>
720 const ListType& input,
721 const UnaryPredicate& pred,
727template<
class ListType,
class UnaryPredicate>
730 const ListType& input,
731 const UnaryPredicate& pred,
740template<
class ListType,
class UnaryPredicate>
743 const ListType& input,
744 const UnaryPredicate& pred,
836template<
class T,
class T2,
class UnaryOperation>
840 const UnaryOperation& op
851template<
class T,
class InputIterator,
class UnaryOperation>
856 const UnaryOperation& op
A packed storage of objects of type <T> using an offset table for access.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A HashTable to objects of type <T> with a label key.
A dynamic list of packed unsigned integers, with the number of bits per item specified by the <Width>...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label find(const T &val) const
Find index of the first occurrence of the value.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Various utility functions to work on Lists.
labelList findIndices(const ListType &input, const UnaryPredicate &pred, label start=0)
Linear search to find all occurences of given element.
label count_if(const ListType &input, const UnaryPredicate &pred, const label start=0)
Count the number of matching entries.
void identity(labelUList &map, label start=0)
Fill an identity map with (map[i] == i).
label find_if(const ListType &input, const UnaryPredicate &pred, const label start=0)
Find index of the first occurrence that satisfies the predicate.
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as ListOps::find_if.
label count(const ListType &input, typename ListType::const_reference val, const label start=0)
Count the occurrences of the given element.
void setValue(UList< T > &list, const labelUList &locations, const T &val)
Set various locations of the list with a specified value.
List< T > create(const UList< T2 > &input, const UnaryOperation &op)
Create a List from a List of a dissimilar type, using the entire list.
bool equal(const UList< Type1 > &a, const UList< Type2 > &b)
Test for list equality with different but compatible data types. Eg, int32 and int64.
List< T > createWithValue(const label len, const labelUList &locations, const T &val, const T &deflt=T())
Create a List filled with default values and various locations with another specified value.
bool found_if(const ListType &input, const UnaryPredicate &pred, const label start=0)
True if there is a value in the list that satisfies the predicate.
CompactListList< label > invertOneToManyCompact(const label len, const labelUList &map)
Invert one-to-many compact map. Unmapped elements will be size 0.
void invertManyToMany(const label len, const UList< InputIntListType > &input, List< OutputIntListType > &output)
Invert many-to-many.
List< T > uniqueSort(const UList< T > &input)
Return sorted list with removal of duplicates.
Pair< label > labelPair
A pair of labels.
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
label findIndex(const ListType &input, typename ListType::const_reference val, const label start=0)
Deprecated(2017-10) search for first occurrence of the given element.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values within a list.
List< labelList > labelListList
List of labelList.
Map< label > invertToMap(const labelUList &values)
Create inverse mapping, which is a lookup table into the given list.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
label findMin(const ListType &input, label start=0)
Linear search for the index of the min element, similar to std::min_element but for lists and returns...
ListType rotateList(const ListType &list, const label n)
Rotate a list by n places.
IntListType renumber(const labelUList &oldToNew, const IntListType &input)
Renumber the values within a list.
void inplaceRotateList(ListType< DataType > &list, label n)
Inplace reversal of a list using the Reversal Block Swapping algorithm.
List< T > subset(const BoolListType &select, const UList< T > &input, const bool invert=false)
Extract elements of the input list when select is true.
labelList duplicateOrder(const UList< T > &input)
Return (sorted) indices corresponding to duplicate list values.
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
Binary search to find the index of the last element in a sorted list that is less than value.
void inplaceReverseList(ListType &input)
Inplace reversal of a list using Swap.
List< T > subsetList(const UList< T > &input, const UnaryPredicate &pred, const bool invert=false)
Copy a subset of the input list when predicate is true.
labelPair findMinMax(const ListType &input, label start=0)
Linear search for the index of the min/max element, similar to std::minmax_element but for lists and ...
void inplaceSubsetList(ListType &input, const UnaryPredicate &pred, const bool invert=false)
Inplace subset of the list when predicate is true.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
label inplaceMapValue(const labelUList &oldToNew, Container &input)
Map values. Ignore negative values.
static bool less(const vector &x, const vector &y)
To compare normals.
void inplaceMapKey(const labelUList &oldToNew, Container &input)
Rewrite with mapped keys. Ignore elements with negative key.
void inplaceUniqueSort(ListType &input)
Inplace sorting and removal of duplicates.
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...
ListType reverseList(const ListType &input)
Reverse a list. First element becomes last element etc.
labelList uniqueOrder(const UList< T > &input)
Return (sorted) indices corresponding to unique list values.
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
label findSortedIndex(const ListType &input, typename ListType::const_reference val, const label start=0)
Binary search to find the index of the last element in a sorted list that is less than value.
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
label findMax(const ListType &input, label start=0)
Linear search for the index of the max element, similar to std::max_element but for lists and returns...
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
UList< label > labelUList
A UList of labels.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
ListType reorder(const labelUList &oldToNew, const ListType &input, const bool prune=false)
Reorder the elements of a list.
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
#define FOAM_DEPRECATED_FOR(since, replacement)
#define FOAM_DEPRECATED_STRICT(since, replacement)
List helper to append y elements onto the end of x.
void operator()(List< T > &x, const UList< T > &y) const
bool operator()(const label a, const label b) const
greater(const ListType &list)
less(const ListType &list)
bool operator()(const label a, const label b) const
List helper to add y unique elements to x.
void operator()(labelList &x, const labelUList &y) const
List helper to append y unique elements onto the end of x.
void operator()(List< T > &x, const UList< T > &y) const