Public Member Functions | Static Public Member Functions | Friends | List of all members
CompactListList< T, Container > Class Template Reference

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

Public Member Functions

 CompactListList ()
 Null constructor. More...
 
 CompactListList (const List< Container > &)
 Construct by converting given List<List<T>> More...
 
 CompactListList (const label mRows, const label nData)
 Construct given size of offset table (number of rows) More...
 
 CompactListList (const label mRows, const label nData, const T &)
 Construct given size of offset table (number of rows),. More...
 
 CompactListList (const labelUList &rowSizes)
 Construct given list of row-sizes. More...
 
 CompactListList (const labelUList &rowSizes, const T &)
 Construct given list of row-sizes. More...
 
 CompactListList (const Xfer< CompactListList< T, Container >> &)
 Construct by transferring the parameter contents. More...
 
 CompactListList (CompactListList< T, Container > &, bool reuse)
 Construct as copy or re-use as specified. More...
 
 CompactListList (Istream &)
 Construct from Istream. More...
 
autoPtr< CompactListList< T, Container > > clone () const
 Clone. 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 List< label > & offsets () const
 Return the offset table (= size()+1) More...
 
List< label > & offsets ()
 Return non-const access to the offset table. More...
 
const List< T > & m () const
 Return the packed matrix of data. More...
 
List< T > & m ()
 Return non-const access to the packed matrix of data. 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...
 
labelList sizes () const
 Return sizes (to be used e.g. for construction) More...
 
void transfer (CompactListList< T, Container > &)
 Transfer the contents of the argument CompactListList. More...
 
Xfer< CompactListList< T, Container > > xfer ()
 Transfer the contents to the Xfer container. 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...
 
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...
 
List< Container > operator() () const
 Return as List<Container> More...
 
void operator= (const T &)
 Assignment of all entries to the given value. More...
 

Static Public Member Functions

static const CompactListList< T, Container > & null ()
 Return a null CompactListList. More...
 

Friends

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

Detailed Description

template<class T, class Container = List<T>>
class Foam::CompactListList< T, Container >

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.

Storage is allocated on free-store during construction.

As a special case a null-constructed CompactListList has an empty offsets_ (instead of size 1).

Source files

Definition at line 91 of file polyTopoChange.H.

Constructor & Destructor Documentation

CompactListList ( )
inline

Null constructor.

Definition at line 32 of file CompactListListI.H.

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

Here is the caller graph for this function:

CompactListList ( const List< Container > &  ll)
explicit

Construct by converting given List<List<T>>

Definition at line 31 of file CompactListList.C.

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

Here is the call graph for this function:

CompactListList ( const label  mRows,
const label  nData 
)
inline

Construct given size of offset table (number of rows)

and number of data.

Definition at line 40 of file CompactListListI.H.

References CompactListList< T, Container >::CompactListList().

Here is the call graph for this function:

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

CompactListList ( const labelUList rowSizes)
explicit

Construct given list of row-sizes.

Definition at line 61 of file CompactListList.C.

References CompactListList< T, Container >::CompactListList(), and forAll.

Here is the call graph for this function:

CompactListList ( const labelUList rowSizes,
const T t 
)

Construct given list of row-sizes.

Definition at line 82 of file CompactListList.C.

References CompactListList< T, Container >::CompactListList(), and forAll.

Here is the call graph for this function:

CompactListList ( const Xfer< CompactListList< T, Container >> &  lst)
explicit

Construct by transferring the parameter contents.

Definition at line 104 of file CompactListList.C.

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

Here is the call graph for this function:

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

Construct as copy or re-use as specified.

Definition at line 114 of file CompactListList.C.

Construct from Istream.

Definition at line 32 of file CompactListListIO.C.

References Foam::operator>>(), and List< T >::size().

Here is the call graph for this function:

Member Function Documentation

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

Return a null CompactListList.

Definition at line 80 of file CompactListListI.H.

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

Clone.

Definition at line 67 of file CompactListListI.H.

Foam::label size ( ) const
inline

Return the primary size, i.e. the number of rows.

Definition at line 87 of file CompactListListI.H.

Referenced by decompositionMethod::calcCellCells(), CompactListList< T, Container >::operator()(), CompactListList< T, Container >::setSize(), and CompactListList< T, Container >::sizes().

Here is the caller graph for this function:

bool empty ( ) const
inline

Return true if the number of rows is zero.

Definition at line 94 of file CompactListListI.H.

const Foam::List< Foam::label > & offsets ( ) const
inline

Return the offset table (= size()+1)

Definition at line 102 of file CompactListListI.H.

Referenced by decompositionMethod::calcCellCells().

Here is the caller graph for this function:

Foam::List< Foam::label > & offsets ( )
inline

Return non-const access to the offset table.

Definition at line 109 of file CompactListListI.H.

const Foam::List< T > & m ( ) const
inline

Return the packed matrix of data.

Definition at line 116 of file CompactListListI.H.

Referenced by decompositionMethod::calcCellCells().

Here is the caller graph for this function:

Foam::List< T > & m ( )
inline

Return non-const access to the packed matrix of data.

Definition at line 124 of file CompactListListI.H.

References CompactListList< T, Container >::index().

Here is the call graph for this function:

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

Reset size of CompactListList.

Definition at line 153 of file CompactListList.C.

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

Here is the call graph for this function:

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

Reset sizes of CompactListList and value for new elements.

Definition at line 166 of file CompactListList.C.

References List< T >::setSize().

Here is the call graph for this function:

void setSize ( const labelUList rowSizes)

Reset size of CompactListList.

Definition at line 179 of file CompactListList.C.

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

Here is the call graph for this function:

void resize ( const label  mRows)
inline

Reset size of CompactListList.

This form only allows contraction of the CompactListList.

Definition at line 176 of file CompactListListI.H.

References CompactListList< T, Container >::setSize().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reset size of CompactListList.

Definition at line 184 of file CompactListListI.H.

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

Here is the call graph for this function:

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

Reset sizes of CompactListList and value for new elements.

Definition at line 195 of file CompactListListI.H.

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

Here is the call graph for this function:

void resize ( const labelUList rowSizes)
inline

Reset size of CompactListList.

Definition at line 207 of file CompactListListI.H.

References CompactListList< T, Container >::setSize().

Here is the call graph for this function:

void clear ( )

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

Definition at line 213 of file CompactListList.C.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::labelList sizes ( ) const

Return sizes (to be used e.g. for construction)

Definition at line 197 of file CompactListList.C.

References forAll, List< T >::size(), and CompactListList< T, Container >::size().

Here is the call graph for this function:

void transfer ( CompactListList< T, Container > &  a)

Transfer the contents of the argument CompactListList.

into this CompactListList and annul the argument list.

Definition at line 223 of file CompactListList.C.

References List< T >::transfer().

Referenced by CompactListList< T, Container >::clear(), and CompactListList< T, Container >::CompactListList().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::Xfer< Foam::CompactListList< T, Container > > xfer ( )
inline

Transfer the contents to the Xfer container.

Definition at line 169 of file CompactListListI.H.

References Foam::xferMove().

Here is the call graph for this function:

Foam::label index ( const label  row,
const label  col 
) const
inline

Return index into m.

Definition at line 132 of file CompactListListI.H.

Referenced by CompactListList< T, Container >::m(), CompactListList< T, Container >::operator()(), and CompactListList< T, Container >::whichColumn().

Here is the caller graph for this function:

Foam::label whichRow ( const label  index) const
inline

Get row for index into m.

Definition at line 142 of file CompactListListI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::findLower(), and CompactListList< T, Container >::whichColumn().

Here is the call graph for this function:

Foam::label whichColumn ( const label  row,
const label  index 
) const
inline

Get column index (j) given above row.

Definition at line 158 of file CompactListListI.H.

References CompactListList< T, Container >::index().

Referenced by CompactListList< T, Container >::whichRow().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::UList< T > operator[] ( const label  i)
inline

Return subscript-checked row as UList.

Definition at line 219 of file CompactListListI.H.

const Foam::UList< T > operator[] ( const label  i) const
inline

Return const subscript-checked row as UList.

Definition at line 231 of file CompactListListI.H.

References CompactListList< T, Container >::operator, and Foam::T().

Here is the call graph for this function:

T & operator() ( const label  i,
const label  j 
)
inline

Return subscript-checked element.

Definition at line 246 of file CompactListListI.H.

References CompactListList< T, Container >::index(), CompactListList< T, Container >::operator, and Foam::T().

Here is the call graph for this function:

const T & operator() ( const label  i,
const label  j 
) const
inline

Return const subscript-checked element.

Definition at line 257 of file CompactListListI.H.

References CompactListList< T, Container >::index().

Here is the call graph for this function:

Foam::List< Container > operator() ( ) const

Return as List<Container>

Definition at line 236 of file CompactListList.C.

References forAll, and CompactListList< T, Container >::size().

Here is the call graph for this function:

void operator= ( const T t)
inline

Assignment of all entries to the given value.

Definition at line 267 of file CompactListListI.H.

Friends And Related Function Documentation

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

Read CompactListList from Istream, discarding contents.

of existing CompactListList.

Ostream& operator ( Ostream ,
const CompactListList< T, Container > &   
)
friend

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