CompactListList< T > Class Template Reference

A packed storage unstructured matrix of objects of type <T> using an offset table for access. More...

Inheritance diagram for CompactListList< T >:
Collaboration diagram for CompactListList< T >:

Public Member Functions

 CompactListList ()
 Null constructor. More...
 
 CompactListList (const UList< label > &offsets, const UList< T > &m)
 Construct from components. More...
 
 CompactListList (CompactListList< T > &, bool reuse)
 Construct as copy or re-use as specified. More...
 
 CompactListList (CompactListList< T > &&)
 Move constructor. More...
 
 CompactListList (const label mRows, const label nData, const T &)
 Construct given size of offset table (number of rows),. More...
 
template<class Container >
 CompactListList (const List< Container > &)
 Construct by converting given List<Container> More...
 
 CompactListList (const labelUList &rowSizes, const T &)
 Construct given list of row-sizes and a value for all elements. More...
 
 CompactListList (Istream &)
 Construct from Istream. More...
 
autoPtr< CompactListList< T > > clone () const
 Clone. More...
 
void setSize (const label mRows)
 Reset size of CompactListList. More...
 
void setSize (const label mRows, const label nData)
 Reset size of CompactListList. More...
 
void setSize (const label mRows, const label nData, const T &)
 Reset sizes of CompactListList and value for new elements. More...
 
void setSize (const labelUList &rowSizes)
 Reset size of CompactListList. More...
 
void resize (const label mRows)
 Reset size of CompactListList. More...
 
void resize (const label mRows, const label nData)
 Reset size of CompactListList. More...
 
void resize (const label mRows, const label nData, const T &)
 Reset sizes of CompactListList and value for new elements. More...
 
void resize (const labelUList &rowSizes)
 Reset size of CompactListList. More...
 
void clear ()
 Clear the CompactListList, i.e. set sizes to zero. More...
 
void transfer (CompactListList< T > &)
 Transfer the contents of the argument CompactListList. More...
 
void shallowCopy (const UCompactListList< T > &)=delete
 Disallow shallowCopy. More...
 
- Public Member Functions inherited from UCompactListList< T >
 UCompactListList ()
 Null constructor. More...
 
 UCompactListList (const UList< label > &offsets, const UList< T > &m)
 Construct from components. More...
 
label size () const
 Return the primary size, i.e. the number of rows. More...
 
bool empty () const
 Return true if the number of rows is zero. More...
 
const UList< label > & offsets () const
 Return the offset table (= size()+1) More...
 
UList< label > & offsets ()
 Return non-const access to the offset table. More...
 
const UList< T > & m () const
 Return the packed matrix of data. More...
 
UList< T > & m ()
 Return non-const access to the packed matrix of data. More...
 
void shallowCopy (const UCompactListList< T > &)
 Copy the ULists, but not the underlying data. More...
 
void deepCopy (const UCompactListList< T > &)
 Copy the underlying data. More...
 
label index (const label row, const label col) const
 Return index into m. More...
 
label whichRow (const label index) const
 Get row for index into m. More...
 
label whichColumn (const label row, const label index) const
 Get column index (j) given above row. More...
 
labelList sizes () const
 Return sizes (to be used e.g. for construction) More...
 
template<class Container = List<T>>
List< Container > list () const
 Convert to List<Container> More...
 
UList< Toperator[] (const label i)
 Return subscript-checked row as UList. More...
 
const UList< Toperator[] (const label i) const
 Return const subscript-checked row as UList. More...
 
Toperator() (const label i, const label j)
 Return subscript-checked element. More...
 
const Toperator() (const label i, const label j) const
 Return const subscript-checked element. More...
 
void operator= (const T &)
 Assignment of all entries to the given value. More...
 
template<class Container >
Foam::List< Container > list () const
 

Static Public Member Functions

static const CompactListList< T > & null ()
 Return a null CompactListList. More...
 
- Static Public Member Functions inherited from UCompactListList< T >
static const UCompactListList< T > & null ()
 Return a null UCompactListList. More...
 

Friends

Istreamoperator>> (Istream &, CompactListList< T > &)
 Read CompactListList from Istream, discarding contents. More...
 

Detailed Description

template<class T>
class Foam::CompactListList< T >

A packed storage unstructured matrix of objects of type <T> using an offset table for access.

The offset table is the size of the number of rows+1 whose elements are the accumulated sizes of the rows, i.e.

  • offset[i] gives the index of first element of row i
  • offset[i+1] - offset[i] is the number of elements in row i

Storage is allocated on free-store during construction.

Source files

Definition at line 91 of file polyTopoChange.H.

Constructor & Destructor Documentation

◆ CompactListList() [1/8]

CompactListList ( )
inline

Null constructor.

Definition at line 32 of file CompactListListI.H.

References UCompactListList< T >::shallowCopy().

Referenced by CompactListList< T >::CompactListList().

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

◆ CompactListList() [2/8]

CompactListList ( const UList< label > &  offsets,
const UList< T > &  m 
)
inline

Construct from components.

Definition at line 44 of file CompactListListI.H.

◆ CompactListList() [3/8]

CompactListList ( CompactListList< T > &  lst,
bool  reuse 
)
inline

Construct as copy or re-use as specified.

Definition at line 56 of file CompactListListI.H.

References UCompactListList< T >::shallowCopy().

Here is the call graph for this function:

◆ CompactListList() [4/8]

CompactListList ( CompactListList< T > &&  lst)
inline

Move constructor.

Definition at line 67 of file CompactListListI.H.

References CompactListList< T >::CompactListList(), and CompactListList< T >::transfer().

Here is the call graph for this function:

◆ CompactListList() [5/8]

CompactListList ( const label  mRows,
const label  nData,
const T t 
)
inline

Construct given size of offset table (number of rows),.

the number of data and a value for all elements.

Definition at line 75 of file CompactListListI.H.

References UCompactListList< T >::shallowCopy().

Here is the call graph for this function:

◆ CompactListList() [6/8]

CompactListList ( const List< Container > &  ll)

Construct by converting given List<Container>

Definition at line 32 of file CompactListList.C.

References CompactListList< T >::CompactListList(), forAll, k, UCompactListList< T >::shallowCopy(), and List< T >::size().

Here is the call graph for this function:

◆ CompactListList() [7/8]

CompactListList ( const labelUList rowSizes,
const T t 
)

Construct given list of row-sizes and a value for all elements.

Definition at line 63 of file CompactListList.C.

References forAll, and UCompactListList< T >::shallowCopy().

Here is the call graph for this function:

◆ CompactListList() [8/8]

Construct from Istream.

Definition at line 32 of file CompactListListIO.C.

References CompactListList< T >::clear(), UList< T >::empty(), and Foam::operator>>().

Here is the call graph for this function:

Member Function Documentation

◆ null()

const Foam::CompactListList< T > & null ( )
inlinestatic

Return a null CompactListList.

Definition at line 104 of file CompactListListI.H.

◆ clone()

Foam::autoPtr< Foam::CompactListList< T > > clone ( ) const
inline

Clone.

Definition at line 91 of file CompactListListI.H.

◆ setSize() [1/4]

void setSize ( const label  mRows)

◆ setSize() [2/4]

void setSize ( const label  mRows,
const label  nData 
)

Reset size of CompactListList.

Definition at line 115 of file CompactListList.C.

References CompactListList< T >::setSize(), List< T >::setSize(), and UCompactListList< T >::shallowCopy().

Here is the call graph for this function:

◆ setSize() [3/4]

void setSize ( const label  mRows,
const label  nData,
const T t 
)

Reset sizes of CompactListList and value for new elements.

Definition at line 129 of file CompactListList.C.

References List< T >::setSize(), and UCompactListList< T >::shallowCopy().

Here is the call graph for this function:

◆ setSize() [4/4]

void setSize ( const labelUList rowSizes)

Reset size of CompactListList.

Definition at line 143 of file CompactListList.C.

References forAll, List< T >::setSize(), UCompactListList< T >::shallowCopy(), and UList< T >::size().

Here is the call graph for this function:

◆ resize() [1/4]

void resize ( const label  mRows)
inline

Reset size of CompactListList.

This form only allows contraction of the CompactListList.

Definition at line 111 of file CompactListListI.H.

References CompactListList< T >::setSize().

Referenced by CompactListList< T >::resize().

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

◆ resize() [2/4]

void resize ( const label  mRows,
const label  nData 
)
inline

Reset size of CompactListList.

Definition at line 119 of file CompactListListI.H.

References CompactListList< T >::resize(), and CompactListList< T >::setSize().

Here is the call graph for this function:

◆ resize() [3/4]

void resize ( const label  mRows,
const label  nData,
const T t 
)
inline

Reset sizes of CompactListList and value for new elements.

Definition at line 130 of file CompactListListI.H.

References CompactListList< T >::resize(), and CompactListList< T >::setSize().

Here is the call graph for this function:

◆ resize() [4/4]

void resize ( const labelUList rowSizes)
inline

Reset size of CompactListList.

Definition at line 142 of file CompactListListI.H.

References CompactListList< T >::setSize().

Here is the call graph for this function:

◆ clear()

void clear ( )

Clear the CompactListList, i.e. set sizes to zero.

Definition at line 162 of file CompactListList.C.

References UCompactListList< T >::shallowCopy().

Referenced by CompactListList< T >::CompactListList(), CompactListList< T >::setSize(), and CompactListList< T >::transfer().

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

◆ transfer()

void transfer ( CompactListList< T > &  a)

Transfer the contents of the argument CompactListList.

into this CompactListList and annul the argument list.

Definition at line 172 of file CompactListList.C.

References CompactListList< T >::clear(), UCompactListList< T >::shallowCopy(), and List< T >::transfer().

Referenced by CompactListList< T >::CompactListList().

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

◆ shallowCopy()

void shallowCopy ( const UCompactListList< T > &  )
delete

Disallow shallowCopy.

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream ,
CompactListList< T > &   
)
friend

Read CompactListList from Istream, discarding contents.

of existing CompactListList.


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