A List with indirect addressing. More...
Public Member Functions | |
IndirectList (const UList< T > &values, const labelUList &addr) | |
Copy construct addressing, shallow copy values reference. More... | |
IndirectList (const UList< T > &values, labelList &&addr) | |
Move construct addressing, shallow copy values reference. More... | |
IndirectList (const UList< T > &values, const Foam::zero) | |
Zero-sized addressing, shallow copy values reference. More... | |
IndirectList (const IndirectList< T > &list) | |
Copy construct addressing, shallow copy values reference. More... | |
IndirectList (IndirectList< T > &&list) | |
Move construct addressing, shallow copy values reference. More... | |
IndirectList (const UIndirectList< T > &list) | |
Copy construct addressing, shallow copy values reference. More... | |
void | operator= (const IndirectList< T > &rhs) |
Deep copy values, Fatal if list sizes are not identical. More... | |
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. More... | |
Addr & | addressing () noexcept |
The list addressing. More... | |
Public Member Functions inherited from UIndirectList< T > | |
UIndirectList (const UList< T > &values, const labelUList &addr) | |
Shallow copy values and addressing. More... | |
UIndirectList (const UIndirectList< T > &list) | |
Copy construct (shallow copy values and addressing) More... | |
void | operator= (const UIndirectList< T > &rhs) |
Deep copy values, Fatal if list sizes are not identical. More... | |
Public Member Functions inherited from IndirectListBase< T, labelUList > | |
IndirectListBase ()=delete | |
No default construct. More... | |
IndirectListBase (const UList< T > &values, const labelUList &addr) | |
Store references to the values list and the addressing array. More... | |
bool | empty () const noexcept |
True if the list is empty (ie, size() is zero). More... | |
label | size () const noexcept |
The number of elements in the list. More... | |
const UList< T > & | values () const noexcept |
The list of values (without addressing) More... | |
UList< T > & | values () noexcept |
The list of values (without addressing) More... | |
const labelUList & | addressing () const noexcept |
The addressing used for the list. More... | |
bool | uniform () const |
True if all entries have identical values, and list is non-empty. More... | |
const T & | front () const |
The first element of the list. More... | |
T & | front () |
The first element of the list. More... | |
const T & | back () const |
The last element of the list. More... | |
T & | back () |
The last element of the list. More... | |
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. More... | |
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. More... | |
const T & | fcValue (const label i) const |
Return forward circular value (ie, next value in the list) More... | |
T & | fcValue (const label i) |
Return forward circular value (ie, next value in the list) More... | |
const T & | rcValue (const label i) const |
Return reverse circular value (ie, previous value in the list) More... | |
T & | rcValue (const label i) |
Return reverse circular value (ie, previous value in the list) More... | |
List< T > | list () const |
Return the addressed elements as a List. More... | |
bool | contains (const T &val, label pos=0, label len=-1) const |
Is the value contained in the list? More... | |
label | find (const T &val, label pos=0, label len=-1) const |
Find index of the first occurrence of the value. More... | |
label | rfind (const T &val, label pos=-1) const |
Find index of the last occurrence of the value. More... | |
List< T > | operator() () const |
Return the addressed elements as a List. More... | |
T & | operator[] (const label i) |
Non-const access to an element in the list. More... | |
const T & | operator[] (const label i) const |
Const access to an element in the list. More... | |
void | operator= (const T &val) |
Assign all addressed elements to the given value. More... | |
void | operator= (const Foam::zero) |
Assignment of all entries to zero. More... | |
void | operator= (const UList< T > &rhs) |
Deep copy values from a list of the addressed elements. More... | |
void | operator= (const IndirectListBase< T, labelUList > &rhs) |
Deep copy values from a list of the addressed elements. More... | |
void | operator= (const IndirectListBase< T, AnyAddr > &rhs) |
Deep copy values from a list of the addressed elements. More... | |
iterator | begin () |
Return an iterator at begin of list. More... | |
const_iterator | begin () const |
Return a const_iterator at begin of list. More... | |
iterator | end () |
Return an iterator at end of list. More... | |
const_iterator | end () const |
Return a const_iterator at end of list. More... | |
const_iterator | cbegin () const |
Return a const_iterator at begin of list. More... | |
const_iterator | cend () const |
Return a const_iterator at end of list. More... | |
Ostream & | writeList (Ostream &os, const label shortLen=0) const |
Write List, with line-breaks in ASCII when length exceeds shortLen. More... | |
T & | first () |
Access first element of the list, position [0]. More... | |
const T & | first () const |
Access first element of the list. More... | |
T & | last () |
Access last element of the list, position [size()-1]. More... | |
const T & | last () const |
Access last element of the list, position [size()-1]. More... | |
bool | found (const T &val, label pos=0) const |
Same as contains() More... | |
Static Public Member Functions | |
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. More... | |
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. More... | |
static IndirectList< T > | uniq (const UList< T > &values, const bool sorted=false) |
Return an IndirectList with duplicate entries filtered out. More... | |
Additional Inherited Members | |
Public Types inherited from IndirectListBase< T, labelUList > | |
typedef T | value_type |
Type of values the list contains. More... | |
typedef T * | pointer |
The pointer type for non-const access to value_type items. More... | |
typedef const T * | const_pointer |
The pointer type for const access to value_type items. More... | |
typedef T & | reference |
The type used for storing into value_type objects. More... | |
typedef const T & | const_reference |
The type used for reading from constant value_type objects. More... | |
typedef label | size_type |
The type to represent the size of a UList. More... | |
typedef label | difference_type |
The difference between iterator objects. More... | |
typedef labelUList | addressing_type |
The addressing type (non-stl definition) More... | |
Protected Member Functions inherited from IndirectListBase< T, labelUList > | |
void | copyList (const ListType &rhs) |
Deep copy values from the list. More... | |
A List with indirect addressing.
Definition at line 60 of file IndirectList.H.
|
inline |
Copy construct addressing, shallow copy values reference.
Definition at line 26 of file IndirectListI.H.
|
inline |
Move construct addressing, shallow copy values reference.
Definition at line 42 of file IndirectListI.H.
|
inline |
Zero-sized addressing, shallow copy values reference.
Definition at line 58 of file IndirectListI.H.
|
inline |
Copy construct addressing, shallow copy values reference.
Definition at line 73 of file IndirectListI.H.
|
inline |
Move construct addressing, shallow copy values reference.
Definition at line 86 of file IndirectListI.H.
|
inlineexplicit |
Copy construct addressing, shallow copy values reference.
Definition at line 99 of file IndirectListI.H.
|
static |
Return an IndirectList comprising entries with positions that satisfy the condition predicate.
The condition predicate can be considered a type of mask for any given position. A boolList, bitSet, labelRange or labelHashSet all satisfy the requirements for use as position condition predicates.
values | The source list values |
select | Accept/reject predicate based on position. |
invert | Invert (negate) the selection logic |
|
static |
Return an IndirectList comprising entries with values that satisfy the predicate.
values | The source list values |
pred | Predicate used to test the value |
invert | Invert (negate) the selection logic |
|
static |
Return an IndirectList with duplicate entries filtered out.
Preserves the original input order, unless sorted = true
values | The source list values |
sorted | Retain sorted order instead of original order |
Definition at line 179 of file IndirectListI.H.
References Foam::BitOps::count(), Foam::sort(), Foam::sortedOrder(), and Foam::HashTableOps::values().
|
inline |
Deep copy values, Fatal if list sizes are not identical.
Definition at line 234 of file IndirectList.H.
References IndirectListBase< T, labelUList >::copyList().
Foam::IndirectList<T> subset | ( | const UList< T > & | values, |
const UnaryCondition & | select, | ||
const bool | invert | ||
) |
Definition at line 116 of file IndirectListI.H.
References Foam::BitOps::count(), Foam::invert(), Foam::BitOps::select(), and Foam::HashTableOps::values().
Foam::IndirectList<T> subset_if | ( | const UList< T > & | values, |
const UnaryPredicate & | pred, | ||
const bool | invert | ||
) |
Definition at line 148 of file IndirectListI.H.
References Foam::BitOps::count(), Foam::invert(), and Foam::HashTableOps::values().
|
inlinenoexcept |
The list addressing.
Definition at line 80 of file IndirectListAddressing.H.
Referenced by sampledFaceZone::update(), and sampledPatch::update().
|
inlinenoexcept |
The list addressing.
Definition at line 88 of file IndirectListAddressing.H.