BiIndirectList< T > Class Template Reference

Indexes into negList (negative index) or posList (zero or positive index). More...

Public Member Functions

 BiIndirectList (const UList< T > &posList, const UList< T > &negList, const labelUList &addr)
 Construct given the complete lists and the addressing array. More...
 
 BiIndirectList (const UList< T > &posList, const UList< T > &negList, labelList &&addr)
 Construct given the complete list and by transferring addressing. 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 > & posList () const noexcept
 The list of positive values (without addressing) More...
 
const UList< T > & negList () const noexcept
 The list of negative values (without addressing) More...
 
const labelListaddressing () const noexcept
 The addressing used for the list. More...
 
void resetAddressing (const labelUList &addr)
 Copy reset addressing. More...
 
void resetAddressing (labelList &&addr)
 Move reset addressing. More...
 
void extract (UList< T > &result) const
 Extract the addressed elements. Sizes must match! More...
 
List< Tlist () const
 Extract and return the addressed elements as a List. More...
 
List< Toperator() () const
 Extract and return the addressed elements as a List. More...
 
Toperator[] (const label i)
 Return non-const access to an element. More...
 
const Toperator[] (const label i) const
 Return const access to an element. More...
 
void operator= (const T &val)
 Assignment of all entries to the given value. More...
 
void operator= (Foam::zero)
 Assignment of all entries to zero. More...
 
void operator= (const UList< T > &vals)
 Deep copy values from a list of the addressed elements. More...
 

Static Public Member Functions

static label posIndex (const label i) noexcept
 Calculate index given whether index is into posList or negList. More...
 
static label negIndex (const label i) noexcept
 

Detailed Description

template<class T>
class Foam::BiIndirectList< T >

Indexes into negList (negative index) or posList (zero or positive index).

Source files

Definition at line 49 of file BiIndirectList.H.

Constructor & Destructor Documentation

◆ BiIndirectList() [1/2]

BiIndirectList ( const UList< T > &  posList,
const UList< T > &  negList,
const labelUList addr 
)
inline

Construct given the complete lists and the addressing array.

Definition at line 27 of file BiIndirectListI.H.

◆ BiIndirectList() [2/2]

BiIndirectList ( const UList< T > &  posList,
const UList< T > &  negList,
labelList &&  addr 
)
inline

Construct given the complete list and by transferring addressing.

Definition at line 41 of file BiIndirectListI.H.

Member Function Documentation

◆ empty()

bool empty ( ) const
inlinenoexcept

True if the list is empty (ie, size() is zero).

Definition at line 90 of file BiIndirectList.H.

References UList< T >::empty().

Here is the call graph for this function:

◆ size()

label size ( ) const
inlinenoexcept

The number of elements in the list.

Definition at line 95 of file BiIndirectList.H.

References UList< T >::size().

Here is the call graph for this function:

◆ posList()

const UList<T>& posList ( ) const
inlinenoexcept

The list of positive values (without addressing)

Definition at line 100 of file BiIndirectList.H.

◆ negList()

const UList<T>& negList ( ) const
inlinenoexcept

The list of negative values (without addressing)

Definition at line 105 of file BiIndirectList.H.

◆ addressing()

const labelList& addressing ( ) const
inlinenoexcept

The addressing used for the list.

Definition at line 110 of file BiIndirectList.H.

◆ posIndex()

static label posIndex ( const label  i)
inlinestaticnoexcept

Calculate index given whether index is into posList or negList.

Definition at line 115 of file BiIndirectList.H.

◆ negIndex()

static label negIndex ( const label  i)
inlinestaticnoexcept

Definition at line 116 of file BiIndirectList.H.

◆ resetAddressing() [1/2]

void resetAddressing ( const labelUList addr)
inline

Copy reset addressing.

Definition at line 56 of file BiIndirectListI.H.

◆ resetAddressing() [2/2]

void resetAddressing ( labelList &&  addr)
inline

Move reset addressing.

Definition at line 63 of file BiIndirectListI.H.

◆ extract()

void extract ( UList< T > &  result) const
inline

Extract the addressed elements. Sizes must match!

Definition at line 70 of file BiIndirectListI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, FOAM_UNLIKELY, Foam::min(), Foam::nl, and UList< T >::size().

Here is the call graph for this function:

◆ list()

Foam::List< T > list ( ) const
inline

Extract and return the addressed elements as a List.

Definition at line 92 of file BiIndirectListI.H.

References Foam::extract().

Here is the call graph for this function:

◆ operator()()

Foam::List< T > operator() ( ) const
inline

Extract and return the addressed elements as a List.

Definition at line 103 of file BiIndirectListI.H.

References Foam::extract().

Here is the call graph for this function:

◆ operator[]() [1/2]

T & operator[] ( const label  i)
inline

Return non-const access to an element.

Definition at line 112 of file BiIndirectListI.H.

◆ operator[]() [2/2]

const T & operator[] ( const label  i) const
inline

Return const access to an element.

Definition at line 121 of file BiIndirectListI.H.

◆ operator=() [1/3]

void operator= ( const T val)
inline

Assignment of all entries to the given value.

Definition at line 131 of file BiIndirectListI.H.

◆ operator=() [2/3]

void operator= ( Foam::zero  )
inline

Assignment of all entries to zero.

Definition at line 143 of file BiIndirectListI.H.

◆ operator=() [3/3]

void operator= ( const UList< T > &  vals)
inline

Deep copy values from a list of the addressed elements.

Definition at line 155 of file BiIndirectListI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, FOAM_UNLIKELY, and UList< T >::size().

Here is the call graph for this function:

The documentation for this class was generated from the following files: