An indirect list with addressing based on sorting. The list is sorted upon construction or when explicitly requested. More...
#include <SortList.H>


Public Member Functions | |
| SortList (const UList< T > &values) | |
| Shallow copy values list reference, sort immediately. | |
| template<class Compare> | |
| SortList (const UList< T > &values, const Compare &comp) | |
| Shallow copy values list reference, sort with given value comparator. | |
| const labelUList & | indices () const noexcept |
| Return the list of sorted indices (updated every sort). | |
| labelList & | indices () noexcept |
| Return the list of indices (updated every sort). | |
| void | reverse () |
| Reverse the indices. | |
| void | reset () |
| Reset list indices to identity. | |
| template<class Compare> | |
| void | sort (const Compare &comp) |
| Sort the list using the given value comparator. | |
| void | sort () |
| Forward (stable) sort the list. Functionally identical to sort with std::less<T>(). | |
| void | reverseSort () |
| Reverse (stable) sort the list. Functionally identical to sort with std::greater<T>(). | |
| void | uniqueSort () |
| Sort the list, only retaining unique entries. | |
| Public Member Functions inherited from IndirectList< T > | |
| IndirectList (const UList< T > &values, const labelUList &addr) | |
| Copy construct addressing, shallow copy values reference. | |
| IndirectList (const UList< T > &values, labelList &&addr) | |
| Move construct addressing, shallow copy values reference. | |
| IndirectList (const UList< T > &values, Foam::zero) | |
| Zero-sized addressing, shallow copy values reference. | |
| IndirectList (const IndirectList< T > &list) | |
| Copy construct addressing, shallow copy values reference. | |
| IndirectList (IndirectList< T > &&list) | |
| Move construct addressing, shallow copy values reference. | |
| IndirectList (const UIndirectList< T > &list) | |
| Copy construct addressing, shallow copy values reference. | |
| void | operator= (const IndirectList< T > &rhs) |
| Deep copy values, Fatal if list sizes are not identical. | |
| template<class UnaryCondition> | |
| Foam::IndirectList< T > | subset (const UList< T > &values, const UnaryCondition &select, const bool invert) |
| template<class UnaryPredicate> | |
| Foam::IndirectList< T > | subset_if (const UList< T > &values, const UnaryPredicate &pred, const bool invert) |
| const Addr & | addressing () const noexcept |
| The list addressing. | |
| Addr & | addressing () noexcept |
| The list addressing. | |
| Public Member Functions inherited from UIndirectList< T > | |
| UIndirectList (const UList< T > &values, const labelUList &addr) | |
| Shallow copy values and addressing. | |
| UIndirectList (const UIndirectList< T > &list) | |
| Copy construct (shallow copy values and addressing). | |
| void | operator= (const UIndirectList< T > &rhs) |
| Deep copy values, Fatal if list sizes are not identical. | |
| Public Member Functions inherited from IndirectListBase< T, labelUList > | |
| IndirectListBase ()=delete | |
| No default construct. | |
| bool | empty () const noexcept |
| True if the list is empty (ie, size() is zero). | |
| label | size () const noexcept |
| The number of elements in the list. | |
| const UList< T > & | values () const noexcept |
| The list of values (without addressing). | |
| const labelUList & | addressing () const noexcept |
| The addressing used for the list. | |
| bool | uniform () const |
| True if all entries have identical values, and list is non-empty. | |
| const T & | front () const |
| The first element of the list. | |
| const T & | back () const |
| The last element of the list. | |
| label | fcIndex (const label i) const |
| The forward circular index. The next index in the list which returns to the first at the end of the list. | |
| label | rcIndex (const label i) const |
| The reverse circular index. The previous index in the list which returns to the last at the beginning of the list. | |
| const T & | fcValue (const label i) const |
| Return forward circular value (ie, next value in the list). | |
| const T & | rcValue (const label i) const |
| Return reverse circular value (ie, previous value in the list). | |
| List< T > | list () const |
| Return the addressed elements as a List. | |
| bool | contains (const T &val, label pos=0, label len=-1) const |
| Is the value contained in the list? | |
| label | find (const T &val, label pos=0, label len=-1) const |
| Find index of the first occurrence of the value. | |
| label | rfind (const T &val, label pos=-1) const |
| Find index of the last occurrence of the value. | |
| List< T > | operator() () const |
| Return the addressed elements as a List. | |
| T & | operator[] (const label i) |
| Non-const access to an element in the list. | |
| void | operator= (const T &val) |
| Assign all addressed elements to the given value. | |
| iterator | begin () |
| Return an iterator at begin of list. | |
| iterator | end () |
| Return an iterator at end of list. | |
| const_iterator | cbegin () const |
| Return a const_iterator at begin of list. | |
| const_iterator | cend () const |
| Return a const_iterator at end of list. | |
| Ostream & | writeList (Ostream &os, const label shortLen=0) const |
| Write List, with line-breaks in ASCII when length exceeds shortLen. | |
| T & | first () |
| Access first element of the list, position [0]. | |
| T & | last () |
| Access last element of the list, position [size()-1]. | |
| bool | found (const T &val, label pos=0) const |
| Same as contains(). | |
Additional Inherited Members | |
| Public Types inherited from IndirectListBase< T, labelUList > | |
| typedef T | value_type |
| Type of values the list contains. | |
| typedef T * | pointer |
| The pointer type for non-const access to value_type items. | |
| typedef const T * | const_pointer |
| The pointer type for const access to value_type items. | |
| typedef T & | reference |
| The type used for storing into value_type objects. | |
| typedef const T & | const_reference |
| The type used for reading from constant value_type objects. | |
| typedef label | size_type |
| The type to represent the size of a UList. | |
| typedef label | difference_type |
| The difference between iterator objects. | |
| typedef labelUList | addressing_type |
| The addressing type (non-stl definition). | |
| Static Public Member Functions inherited from IndirectList< T > | |
| template<class UnaryCondition> | |
| 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. | |
| template<class UnaryPredicate> | |
| 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. | |
| static IndirectList< T > | uniq (const UList< T > &values, const bool sorted=false) |
| Return an IndirectList with duplicate entries filtered out. | |
| Protected Member Functions inherited from IndirectListBase< T, labelUList > | |
| void | copyList (const ListType &rhs) |
| Deep copy values from the list. | |
An indirect list with addressing based on sorting. The list is sorted upon construction or when explicitly requested.
Uses the std::stable_sort() algorithm.
Definition at line 50 of file SortList.H.
Shallow copy values list reference, sort immediately.
Definition at line 26 of file SortListI.H.
References IndirectList< T >::IndirectList(), sort(), Foam::T(), and IndirectListBase< T, labelUList >::values().

|
inline |
Shallow copy values list reference, sort with given value comparator.
Definition at line 36 of file SortListI.H.
References IndirectList< T >::IndirectList(), sort(), Foam::T(), and IndirectListBase< T, labelUList >::values().

|
inlinenoexcept |
Return the list of sorted indices (updated every sort).
Same as addressing()
Definition at line 47 of file SortListI.H.
References IndirectList< T >::addressing(), and Foam::noexcept.
Referenced by SprayCloud< CloudType >::penetration(), reset(), reverse(), reverseSort(), sort(), sort(), and uniqueSort().


|
inlinenoexcept |
Return the list of indices (updated every sort).
Same as addressing()
Definition at line 54 of file SortListI.H.
References IndirectList< T >::addressing(), and Foam::noexcept.

|
inline |
Reverse the indices.
Definition at line 61 of file SortListI.H.
References indices(), and Foam::reverse().

|
inline |
Reset list indices to identity.
Definition at line 68 of file SortListI.H.
References Foam::identity(), indices(), IndirectListBase< T, labelUList >::size(), and IndirectListBase< T, labelUList >::values().

Sort the list using the given value comparator.
Definition at line 79 of file SortListI.H.
References b, Foam::identity(), indices(), and IndirectListBase< T, labelUList >::values().

|
inline |
Forward (stable) sort the list. Functionally identical to sort with std::less<T>().
Definition at line 97 of file SortListI.H.
References indices(), Foam::sortedOrder(), and IndirectListBase< T, labelUList >::values().
Referenced by SortList(), and SortList().


|
inline |
Reverse (stable) sort the list. Functionally identical to sort with std::greater<T>().
Definition at line 111 of file SortListI.H.
References indices(), Foam::sortedOrder(), and IndirectListBase< T, labelUList >::values().

|
inline |
Sort the list, only retaining unique entries.
Definition at line 104 of file SortListI.H.
References indices(), Foam::uniqueOrder(), and IndirectListBase< T, labelUList >::values().
