Classes | Functions
Foam::ListOps Namespace Reference

Various utility functions to work on Lists. More...

Classes

struct  appendEqOp
 
struct  greater
 
struct  less
 
struct  unionEqOp
 
struct  uniqueEqOp
 

Functions

void identity (labelUList &map, label start=0)
 
template<class ListType , class UnaryPredicate >
label find (const ListType &input, const UnaryPredicate &pred, const label start=0)
 
template<class ListType , class UnaryPredicate >
bool found (const ListType &input, const UnaryPredicate &pred, const label start=0)
 
template<class ListType , class UnaryPredicate >
labelList findIndices (const ListType &input, const UnaryPredicate &pred, label start=0)
 
template<class T >
void setValue (UList< T > &list, const labelUList &locations, const T &val)
 
template<class T >
void setValue (UList< T > &list, const labelHashSet &locations, const T &val)
 
template<class T >
void setValue (UList< T > &list, const UList< bool > &locations, const T &val)
 
template<class T >
void setValue (UList< T > &list, const bitSet &locations, const T &val)
 
template<class T , class T2 , class UnaryOperation >
List< Tcreate (const UList< T2 > &input, const UnaryOperation &op)
 
template<class T , class InputIterator , class UnaryOperation >
List< Tcreate (InputIterator first, InputIterator last, const UnaryOperation &op)
 
template<class T >
List< TcreateWithValue (const label len, const labelUList &locations, const T &val, const T &deflt=T())
 
template<class T >
List< TcreateWithValue (const label len, const labelHashSet &locations, const T &val, const T &deflt=T())
 
template<class T >
List< TcreateWithValue (const label len, const UList< bool > &locations, const T &val, const T &deflt=T())
 
template<class T >
List< TcreateWithValue (const label len, const bitSet &locations, const T &val, const T &deflt=T())
 
template<class T >
List< TcreateWithValue (const label len, const label index, const T &val, const T &deflt=T())
 
template<class T >
List< TcreateWithValue (const label len, const label index, T &&val, const T &deflt=T())
 

Detailed Description

Various utility functions to work on Lists.

Source files

Function Documentation

◆ identity()

void identity ( labelUList map,
label  start = 0 
)

Definition at line 196 of file ListOps.C.

References UList::begin(), and UList::end().

Referenced by SortableList::partialReverseSort(), SortableList::partialSort(), SortList< T >::reset(), SortList< T >::reverseSort(), and SortList< T >::sort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find()

label Foam::ListOps::find ( const ListType &  input,
const UnaryPredicate &  pred,
const label  start = 0 
)

◆ found()

bool found ( const ListType &  input,
const UnaryPredicate &  pred,
const label  start = 0 
)

Definition at line 1149 of file ListOpsTemplates.C.

References find(), and Foam::input().

Referenced by starcdWriter::write(), writeObjects::write(), and starcdWriter::writeTemplate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findIndices()

labelList Foam::ListOps::findIndices ( const ListType &  input,
const UnaryPredicate &  pred,
label  start = 0 
)

◆ setValue() [1/4]

void setValue ( UList< T > &  list,
const labelUList locations,
const T val 
)

Definition at line 1210 of file ListOpsTemplates.C.

References UList::size().

Here is the call graph for this function:

◆ setValue() [2/4]

void setValue ( UList< T > &  list,
const labelHashSet locations,
const T val 
)

Definition at line 1231 of file ListOpsTemplates.C.

References UList::size().

Here is the call graph for this function:

◆ setValue() [3/4]

void setValue ( UList< T > &  list,
const UList< bool > &  locations,
const T val 
)

Definition at line 1252 of file ListOpsTemplates.C.

References Foam::BitOps::count(), stdFoam::end(), Foam::min(), and UList::size().

Here is the call graph for this function:

◆ setValue() [4/4]

void setValue ( UList< T > &  list,
const bitSet locations,
const T val 
)

Definition at line 1275 of file ListOpsTemplates.C.

References bitSet::find_first(), bitSet::find_next(), Foam::pos(), and UList::size().

Here is the call graph for this function:

◆ create() [1/2]

List<T> Foam::ListOps::create ( const UList< T2 > &  input,
const UnaryOperation &  op 
)

◆ create() [2/2]

List<T> Foam::ListOps::create ( InputIterator  first,
InputIterator  last,
const UnaryOperation &  op 
)

◆ createWithValue() [1/6]

List<T> Foam::ListOps::createWithValue ( const label  len,
const labelUList locations,
const T val,
const T deflt = T() 
)

◆ createWithValue() [2/6]

List<T> Foam::ListOps::createWithValue ( const label  len,
const labelHashSet locations,
const T val,
const T deflt = T() 
)

◆ createWithValue() [3/6]

List<T> Foam::ListOps::createWithValue ( const label  len,
const UList< bool > &  locations,
const T val,
const T deflt = T() 
)

◆ createWithValue() [4/6]

List<T> Foam::ListOps::createWithValue ( const label  len,
const bitSet locations,
const T val,
const T deflt = T() 
)

◆ createWithValue() [5/6]

List<T> Foam::ListOps::createWithValue ( const label  len,
const label  index,
const T val,
const T deflt = T() 
)

◆ createWithValue() [6/6]

List<T> Foam::ListOps::createWithValue ( const label  len,
const label  index,
T &&  val,
const T deflt = T() 
)