OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

CompactListList< T > Class Template Reference

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

Collaboration diagram for CompactListList< T >:

List of all members.


Public Member Functions

 CompactListList ()
 Null constructor.
 CompactListList (const List< List< T > > &)
 Construct by converting given List<List<T> >.
 CompactListList (const label nRows, const label nData)
 Construct given size of offset table (number of rows).
 CompactListList (const label nRows, const label nData, const T &)
 Construct given size of offset table (number of rows),.
 CompactListList (const UList< label > &rowSizes)
 Construct given list of row-sizes.
 CompactListList (const UList< label > &rowSizes, const T &)
 Construct given list of row-sizes.
 CompactListList (const Xfer< CompactListList< T > > &)
 Construct by transferring the parameter contents.
 CompactListList (CompactListList< T > &, bool reUse)
 Construct as copy or re-use as specified.
 CompactListList (Istream &)
 Construct from Istream.
autoPtr< CompactListList< T > > clone () const
 Clone.
label size () const
 Return the primary size, i.e. the number of rows.
bool empty () const
 Return true if the number of rows is zero.
const List< label > & offsets () const
 Return the offset table.
List< label > & offsets ()
 Return non-const access to the offset table.
const List< T > & m () const
 Return the packed matrix of data.
List< T > & m ()
 Return non-const access to the packed matrix of data.
void setSize (const label nRows)
 Reset size of CompactListList.
void setSize (const label nRows, const label nData)
 Reset size of CompactListList.
void setSize (const label nRows, const label nData, const T &)
 Reset sizes of CompactListList and value for new elements.
void setSize (const UList< label > &rowSizes)
 Reset size of CompactListList.
void resize (const label nRows)
 Reset size of CompactListList.
void resize (const label nRows, const label nData)
 Reset size of CompactListList.
void resize (const label nRows, const label nData, const T &)
 Reset sizes of CompactListList and value for new elements.
void resize (const UList< label > &rowSizes)
 Reset size of CompactListList.
void clear ()
 Clear the CompactListList, i.e. set sizes to zero.
labelList sizes () const
 Return sizes (to be used e.g. for construction).
void transfer (CompactListList< T > &)
 Transfer the contents of the argument CompactListList.
Xfer< CompactListList< T > > xfer ()
 Transfer the contents to the Xfer container.
label index (const label row, const label col) const
 Return index into m.
label whichRow (const label index) const
 Get row for index into m.
label whichColumn (const label row, const label index) const
 Get column index (j) given above row.
UList< T > operator[] (const label i)
 Return subscript-checked row as UList.
const UList< T > operator[] (const label i) const
 Return const subscript-checked row as UList.
T & operator() (const label i, const label j)
 Return subscript-checked element.
const T & operator() (const label i, const label j) const
 Return const subscript-checked element.
List< List< T > > operator() () const
 Return as List<List<T> >.
void operator= (const T &)
 Assignment of all entries to the given value.

Static Public Member Functions

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

Friends

Istream & operator>> (Istream &, CompactListList< T > &)
 Read CompactListList from Istream, discarding contents.
Ostream & operator (Ostream &, const CompactListList< T > &)

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 whose elements are the accumulated sizes of the rows, i.e.

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

and for i = 0, offset[i-1] = 0.

Storage is allocated on free-store during construction.

Source files

Definition at line 65 of file CompactListList.H.


Constructor & Destructor Documentation

CompactListList (  )  [inline]

Null constructor.

Definition at line 22 of file CompactListListI.H.

CompactListList ( const List< List< T > > &  ll  )  [inline]

Construct by converting given List<List<T> >.

Definition at line 23 of file CompactListList.C.

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

Here is the call graph for this function:

CompactListList ( const label  nRows,
const label  nData 
) [inline]

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

and number of data.

Definition at line 28 of file CompactListListI.H.

CompactListList ( const label  nRows,
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 40 of file CompactListListI.H.

CompactListList ( const UList< label > &  rowSizes  )  [inline]

Construct given list of row-sizes.

Definition at line 51 of file CompactListList.C.

CompactListList ( const UList< label > &  rowSizes,
const T &  t 
) [inline]

Construct given list of row-sizes.

Definition at line 70 of file CompactListList.C.

CompactListList ( const Xfer< CompactListList< T > > &  lst  )  [inline]

Construct by transferring the parameter contents.

Definition at line 90 of file CompactListList.C.

CompactListList ( CompactListList< T > &  lst,
bool  reUse 
) [inline]

Construct as copy or re-use as specified.

Definition at line 100 of file CompactListList.C.

References CompactListList< T >::transfer().

Here is the call graph for this function:

CompactListList ( Istream &  is  )  [inline]

Construct from Istream.

Definition at line 24 of file CompactListListIO.C.


Member Function Documentation

const Foam::CompactListList< T > & null (  )  [inline, static]

Return a null CompactListList.

Definition at line 62 of file CompactListListI.H.

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

Clone.

Definition at line 53 of file CompactListListI.H.

Foam::label size (  )  const [inline]

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

Definition at line 69 of file CompactListListI.H.

bool empty (  )  const [inline]

Return true if the number of rows is zero.

Definition at line 76 of file CompactListListI.H.

References List< T >::size().

Here is the call graph for this function:

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

Return the offset table.

Definition at line 83 of file CompactListListI.H.

References UList< T >::empty().

Here is the call graph for this function:

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

Return non-const access to the offset table.

Definition at line 90 of file CompactListListI.H.

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

Return the packed matrix of data.

Definition at line 97 of file CompactListListI.H.

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

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

Definition at line 104 of file CompactListListI.H.

void setSize ( const label  nRows  )  [inline]

Reset size of CompactListList.

This form only allows contraction of the CompactListList.

Definition at line 113 of file CompactListList.C.

Referenced by CompactListList< T >::operator[](), and CompactListList< T >::resize().

Here is the caller graph for this function:

void setSize ( const label  nRows,
const label  nData 
) [inline]

Reset size of CompactListList.

Definition at line 137 of file CompactListList.C.

void setSize ( const label  nRows,
const label  nData,
const T &  t 
) [inline]

Reset sizes of CompactListList and value for new elements.

Definition at line 149 of file CompactListList.C.

References List< T >::setSize().

Here is the call graph for this function:

void setSize ( const UList< label > &  rowSizes  )  [inline]

Reset size of CompactListList.

Definition at line 161 of file CompactListList.C.

References List< T >::setSize().

Here is the call graph for this function:

void resize ( const label  nRows  )  [inline]

Reset size of CompactListList.

This form only allows contraction of the CompactListList.

Definition at line 171 of file CompactListListI.H.

References Foam::xferMove().

Here is the call graph for this function:

void resize ( const label  nRows,
const label  nData 
) [inline]

Reset size of CompactListList.

Definition at line 179 of file CompactListListI.H.

References CompactListList< T >::setSize().

Here is the call graph for this function:

void resize ( const label  nRows,
const label  nData,
const T &  t 
) [inline]

Reset sizes of CompactListList and value for new elements.

Definition at line 190 of file CompactListListI.H.

References CompactListList< T >::setSize().

Here is the call graph for this function:

void resize ( const UList< label > &  rowSizes  )  [inline]

Reset size of CompactListList.

Definition at line 201 of file CompactListListI.H.

References CompactListList< T >::setSize().

Here is the call graph for this function:

void clear (  )  [inline]

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

Definition at line 192 of file CompactListList.C.

Foam::labelList sizes (  )  const [inline]

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

Definition at line 177 of file CompactListList.C.

void transfer ( CompactListList< T > &  a  )  [inline]

Transfer the contents of the argument CompactListList.

into this CompactListList and annull the argument list.

Definition at line 200 of file CompactListList.C.

References List< T >::clear().

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

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::Xfer< Foam::CompactListList< T > > xfer (  )  [inline]

Transfer the contents to the Xfer container.

Definition at line 164 of file CompactListListI.H.

References CompactListList< T >::index().

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

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

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

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

Get column index (j) given above row.

Definition at line 154 of file CompactListListI.H.

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

Return subscript-checked row as UList.

Definition at line 211 of file CompactListListI.H.

References CompactListList< T >::setSize().

Here is the call graph for this function:

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

Return const subscript-checked row as UList.

Definition at line 228 of file CompactListListI.H.

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

Return subscript-checked element.

Definition at line 245 of file CompactListListI.H.

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

Return const subscript-checked element.

Definition at line 256 of file CompactListListI.H.

Foam::List< Foam::List< T > > operator() (  )  const [inline]

Return as List<List<T> >.

Definition at line 210 of file CompactListList.C.

References List< T >::transfer().

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


Friends And Related Function Documentation

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

Read CompactListList from Istream, discarding contents.

of existing CompactListList.

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


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd