DLPermutation< LabelList > Class Template Reference

A permutation stored in the same manner as a doubly-linked list in order to facilitate reordering in constant time. More...

Classes

class  const_iterator
 A bi-directional constant iterator. More...
 

Public Member Functions

 DLPermutation (const List< label > &permutation)
 Construct for a given permutation. More...
 
 DLPermutation (const label n, randomGenerator &rndGen)
 Construct a random permutation. More...
 
List< labelpermutation (const bool reverse)
 Return the permutation. More...
 
const_iterator begin () const
 Return the starting forward iterator. More...
 
const_iterator end () const
 Return the ending forward iterator. More...
 
const_iterator cbegin () const
 Return the starting forward iterator. More...
 
const_iterator cend () const
 Return the ending forward iterator. More...
 
const_iterator rbegin () const
 Return the starting reverse iterator. More...
 
const_iterator rend () const
 Return the ending reverse iterator. More...
 
const_iterator crbegin () const
 Return the starting reverse iterator. More...
 
const_iterator crend () const
 Return the ending reverse iterator. More...
 
void append ()
 Add a new index to the end of the permutation. More...
 
void prepend ()
 Add a new index to the start of the permutation. More...
 
void raise (const label i)
 Raise a given index to the start of the permutation. More...
 
void sink (const label i)
 Sink a given index to the end of the permutation. More...
 

Detailed Description

template<class LabelList>
class Foam::DLPermutation< LabelList >

A permutation stored in the same manner as a doubly-linked list in order to facilitate reordering in constant time.

Source files

Definition at line 50 of file DLPermutation.H.

Constructor & Destructor Documentation

◆ DLPermutation() [1/2]

DLPermutation ( const List< label > &  permutation)
inline

Construct for a given permutation.

Definition at line 43 of file DLPermutationI.H.

References UList< T >::empty(), UList< T >::first(), UList< T >::last(), DLPermutation< LabelList >::permutation(), and List< T >::size().

Here is the call graph for this function:

◆ DLPermutation() [2/2]

DLPermutation ( const label  n,
randomGenerator rndGen 
)
inline

Construct a random permutation.

Definition at line 72 of file DLPermutationI.H.

Member Function Documentation

◆ permutation()

Foam::List< Foam::label > permutation ( const bool  reverse)
inline

Return the permutation.

Definition at line 195 of file DLPermutationI.H.

References forAllConstIter, forAllConstIterReverse, Foam::reverse(), and List< T >::size().

Referenced by DLPermutation< LabelList >::DLPermutation().

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

◆ begin()

Foam::DLPermutation< LabelList >::const_iterator begin
inline

Return the starting forward iterator.

Definition at line 225 of file DLPermutationI.H.

◆ end()

Foam::DLPermutation< LabelList >::const_iterator end
inline

Return the ending forward iterator.

Definition at line 233 of file DLPermutationI.H.

◆ cbegin()

Foam::DLPermutation< LabelList >::const_iterator cbegin
inline

Return the starting forward iterator.

Definition at line 241 of file DLPermutationI.H.

◆ cend()

Foam::DLPermutation< LabelList >::const_iterator cend
inline

Return the ending forward iterator.

Definition at line 249 of file DLPermutationI.H.

◆ rbegin()

Foam::DLPermutation< LabelList >::const_iterator rbegin
inline

Return the starting reverse iterator.

Definition at line 257 of file DLPermutationI.H.

◆ rend()

Foam::DLPermutation< LabelList >::const_iterator rend
inline

Return the ending reverse iterator.

Definition at line 265 of file DLPermutationI.H.

◆ crbegin()

Foam::DLPermutation< LabelList >::const_iterator crbegin
inline

Return the starting reverse iterator.

Definition at line 273 of file DLPermutationI.H.

◆ crend()

Foam::DLPermutation< LabelList >::const_iterator crend
inline

Return the ending reverse iterator.

Definition at line 281 of file DLPermutationI.H.

◆ append()

void append

Add a new index to the end of the permutation.

Definition at line 288 of file DLPermutationI.H.

◆ prepend()

void prepend

Add a new index to the start of the permutation.

Definition at line 300 of file DLPermutationI.H.

◆ raise()

void raise ( const label  i)

Raise a given index to the start of the permutation.

Definition at line 312 of file DLPermutationI.H.

◆ sink()

void sink ( const label  i)

Sink a given index to the end of the permutation.

Definition at line 330 of file DLPermutationI.H.


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