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 T2 >
 CompactListList (const UList< T2 > &)
 Construct from UList<T2> More...
 
template<class T2 >
 CompactListList (const UIndirectList< T2 > &)
 Construct from UIndirectList<T2> 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...
 
template<class T2 >
void setSize (const UList< T2 > &)
 Reset size of CompactListList to match the given UList<T2> More...
 
template<class T2 >
void setSize (const UIndirectList< T2 > &)
 Reset size of CompactListList to match the given. 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...
 
template<class T2 >
void resize (const UList< T2 > &)
 Reset size of CompactListList to match the given. More...
 
template<class T2 >
void resize (const UIndirectList< T2 > &)
 Reset size of CompactListList to match the given. 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...
 
template<class ListType , class ListListType >
static void setSizeToListList (ListType &offsets, ListType &m, const ListListType &ll)
 Set the sizes to match that of the given list-list. More...
 
template<class ListType , class ListListType >
static void setSizeAndValuesToListList (ListType &offsets, ListType &m, const ListListType &ll)
 Set the sizes and values to match that of the given list-list. 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 67 of file CompactListList.H.

Constructor & Destructor Documentation

◆ CompactListList() [1/9]

Null constructor.

Definition at line 32 of file CompactListListI.H.

References UCompactListList< T >::shallowCopy().

Here is the call graph for this function:

◆ CompactListList() [2/9]

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

Construct from components.

Definition at line 43 of file CompactListListI.H.

◆ CompactListList() [3/9]

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/9]

CompactListList ( CompactListList< T > &&  lst)
inline

Move constructor.

Definition at line 67 of file CompactListListI.H.

◆ CompactListList() [5/9]

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 74 of file CompactListListI.H.

◆ CompactListList() [6/9]

CompactListList ( const UList< T2 > &  ll)

Construct from UList<T2>

Definition at line 32 of file CompactListList.C.

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

Here is the call graph for this function:

◆ CompactListList() [7/9]

CompactListList ( const UIndirectList< T2 > &  ll)

Construct from UIndirectList<T2>

Definition at line 46 of file CompactListList.C.

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

Here is the call graph for this function:

◆ CompactListList() [8/9]

CompactListList ( const labelUList rowSizes,
const T t 
)

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

Definition at line 59 of file CompactListList.C.

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

Here is the call graph for this function:

◆ CompactListList() [9/9]

Construct from Istream.

Definition at line 32 of file CompactListListIO.C.

References 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()

Clone.

Definition at line 91 of file CompactListListI.H.

◆ setSize() [1/6]

void setSize ( const label  mRows)

Reset size of CompactListList.

This form only allows contraction of the CompactListList.

Definition at line 86 of file CompactListList.C.

References Foam::abort(), clear(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and UCompactListList< T >::shallowCopy().

Referenced by decompositionMethod::calcCellCells().

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

◆ setSize() [2/6]

void setSize ( const label  mRows,
const label  nData 
)

Reset size of CompactListList.

Definition at line 111 of file CompactListList.C.

◆ setSize() [3/6]

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

Reset sizes of CompactListList and value for new elements.

Definition at line 125 of file CompactListList.C.

◆ setSize() [4/6]

void setSize ( const labelUList rowSizes)

Reset size of CompactListList.

Definition at line 140 of file CompactListList.C.

References UList< T >::size().

Here is the call graph for this function:

◆ setSize() [5/6]

void setSize ( const UList< T2 > &  ll)

Reset size of CompactListList to match the given UList<T2>

Definition at line 160 of file CompactListList.C.

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

Here is the call graph for this function:

◆ setSize() [6/6]

void setSize ( const UIndirectList< T2 > &  ll)

Reset size of CompactListList to match the given.

UIndirectList<T2>

Definition at line 170 of file CompactListList.C.

References UCompactListList< T >::setSizeToListList().

Here is the call graph for this function:

◆ resize() [1/6]

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 setSize().

Referenced by cellEdgeAddressingData::cellEdgeAddressingData().

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

◆ resize() [2/6]

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

Reset size of CompactListList.

Definition at line 118 of file CompactListListI.H.

◆ resize() [3/6]

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

Reset sizes of CompactListList and value for new elements.

Definition at line 129 of file CompactListListI.H.

References setSize().

Here is the call graph for this function:

◆ resize() [4/6]

void resize ( const labelUList rowSizes)
inline

Reset size of CompactListList.

Definition at line 141 of file CompactListListI.H.

References setSize().

Here is the call graph for this function:

◆ resize() [5/6]

void resize ( const UList< T2 > &  ll)

Reset size of CompactListList to match the given.

UList<T2>

Definition at line 152 of file CompactListListI.H.

References setSize().

Here is the call graph for this function:

◆ resize() [6/6]

void resize ( const UIndirectList< T2 > &  ll)

Reset size of CompactListList to match the given.

UIndirectList<T2>

Definition at line 160 of file CompactListListI.H.

◆ clear()

void clear

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

Definition at line 179 of file CompactListList.C.

References UCompactListList< T >::shallowCopy().

Referenced by 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 189 of file CompactListList.C.

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

Here is the call 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: