FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

CompactListList_dev< T, Container > Class Template Reference

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

#include <dynamicMesh/CompactListList_dev.H>


Detailed Description

template<class T, class Container = List<T>>
class Foam::CompactListList_dev< 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.

  • 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.

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

Source files

Definition at line 80 of file CompactListList_dev.H.

Collaboration diagram for CompactListList_dev< T, Container >:

List of all members.

Public Member Functions

 CompactListList_dev ()
 Null constructor.
 CompactListList_dev (const List< Container > &)
 Construct by converting given List<List<T> >
 CompactListList_dev (const label nRows, const label nData)
 Construct given size of offset table (number of rows)
 CompactListList_dev (const label nRows, const label nData, const T &)
 Construct given size of offset table (number of rows),.
 CompactListList_dev (const UList< label > &rowSizes)
 Construct given list of row-sizes.
 CompactListList_dev (const UList< label > &rowSizes, const T &)
 Construct given list of row-sizes.
 CompactListList_dev (const Xfer< CompactListList_dev< T, Container > > &)
 Construct by transferring the parameter contents.
 CompactListList_dev (CompactListList_dev< T, Container > &, bool reUse)
 Construct as copy or re-use as specified.
 CompactListList_dev (Istream &)
 Construct from Istream.
autoPtr< CompactListList_dev
< T, Container > >  
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 (= size()+1)
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_dev.
void  setSize (const label nRows, const label nData)
 Reset size of CompactListList_dev.
void  setSize (const label nRows, const label nData, const T &)
 Reset sizes of CompactListList_dev and value for new elements.
void  setSize (const UList< label > &rowSizes)
 Reset size of CompactListList_dev.
void  resize (const label nRows)
 Reset size of CompactListList_dev.
void  resize (const label nRows, const label nData)
 Reset size of CompactListList_dev.
void  resize (const label nRows, const label nData, const T &)
 Reset sizes of CompactListList_dev and value for new elements.
void  resize (const UList< label > &rowSizes)
 Reset size of CompactListList_dev.
void  clear ()
 Clear the CompactListList_dev, i.e. set sizes to zero.
labelList  sizes () const
 Return sizes (to be used e.g. for construction)
void  transfer (CompactListList_dev< T, Container > &)
 Transfer the contents of the argument CompactListList_dev.
Xfer< CompactListList_dev< T,
Container > >  
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< Container >  operator() () const
 Return as List<Container>
void  operator= (const T &)
 Assignment of all entries to the given value.

Static Public Member Functions

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

Friends

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

Constructor & Destructor Documentation

CompactListList_dev (  ) [inline]

Null constructor.

Definition at line 32 of file CompactListList_devI.H.

CompactListList_dev ( const List< Container > &   ll  ) [explicit]

Construct by converting given List<List<T> >

Definition at line 31 of file CompactListList_dev.C.

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

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

Construct given size of offset table (number of rows)

and number of data.

Definition at line 40 of file CompactListList_devI.H.

CompactListList_dev ( 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 53 of file CompactListList_devI.H.

CompactListList_dev ( const UList< label > &   rowSizes  ) [explicit]

Construct given list of row-sizes.

Definition at line 61 of file CompactListList_dev.C.

References forAll.

CompactListList_dev ( const UList< label > &   rowSizes,
const T &   t  
)

Construct given list of row-sizes.

Definition at line 82 of file CompactListList_dev.C.

References forAll.

CompactListList_dev ( const Xfer< CompactListList_dev< T, Container > > &   lst  ) [explicit]

Construct by transferring the parameter contents.

Definition at line 104 of file CompactListList_dev.C.

CompactListList_dev ( CompactListList_dev< T, Container > &   lst,
bool   reUse  
)

Construct as copy or re-use as specified.

Definition at line 114 of file CompactListList_dev.C.

Construct from Istream.

Definition at line 32 of file CompactListList_devIO.C.

References operator>>().


Member Function Documentation

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

Return a null CompactListList_dev.

Definition at line 80 of file CompactListList_devI.H.

Foam::autoPtr< Foam::CompactListList_dev< T, Container > > clone (  ) const [inline]

Clone.

Definition at line 67 of file CompactListList_devI.H.

Foam::label size (  ) const [inline]

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

Definition at line 87 of file CompactListList_devI.H.

bool empty (  ) const [inline]

Return true if the number of rows is zero.

Definition at line 94 of file CompactListList_devI.H.

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

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

Definition at line 102 of file CompactListList_devI.H.

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

Return non-const access to the offset table.

Definition at line 109 of file CompactListList_devI.H.

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

Return the packed matrix of data.

Definition at line 116 of file CompactListList_devI.H.

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

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

Definition at line 124 of file CompactListList_devI.H.

void setSize ( const label   nRows  )

Reset size of CompactListList_dev.

This form only allows contraction of the CompactListList_dev.

Definition at line 128 of file CompactListList_dev.C.

References Foam::abort(), clear(), Foam::FatalError, FatalErrorIn, and Foam::nl.

void setSize ( const label   nRows,
const label   nData  
)

Reset size of CompactListList_dev.

Definition at line 155 of file CompactListList_dev.C.

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

Reset sizes of CompactListList_dev and value for new elements.

Definition at line 168 of file CompactListList_dev.C.

void setSize ( const UList< label > &   rowSizes  )

Reset size of CompactListList_dev.

Definition at line 181 of file CompactListList_dev.C.

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

void resize ( const label   nRows  ) [inline]

Reset size of CompactListList_dev.

This form only allows contraction of the CompactListList_dev.

Definition at line 178 of file CompactListList_devI.H.

References setSize().

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

Reset size of CompactListList_dev.

Definition at line 186 of file CompactListList_devI.H.

References setSize().

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

Reset sizes of CompactListList_dev and value for new elements.

Definition at line 197 of file CompactListList_devI.H.

References setSize().

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

Reset size of CompactListList_dev.

Definition at line 209 of file CompactListList_devI.H.

References setSize().

void clear (  )

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

Definition at line 215 of file CompactListList_dev.C.

Foam::labelList sizes (  ) const

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

Definition at line 199 of file CompactListList_dev.C.

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

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

Transfer the contents of the argument CompactListList_dev.

into this CompactListList_dev and annul the argument list.

Definition at line 225 of file CompactListList_dev.C.

Foam::Xfer< Foam::CompactListList_dev< T, Container > > xfer (  ) [inline]

Transfer the contents to the Xfer container.

Definition at line 171 of file CompactListList_devI.H.

References Foam::xferMove().

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

Return index into m.

Definition at line 132 of file CompactListList_devI.H.

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

Get row for index into m.

Definition at line 142 of file CompactListList_devI.H.

References Foam::abort(), Foam::FatalError, FatalErrorIn, and Foam::findLower().

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

Get column index (j) given above row.

Definition at line 160 of file CompactListList_devI.H.

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

Return subscript-checked row as UList.

Definition at line 221 of file CompactListList_devI.H.

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

Return const subscript-checked row as UList.

Definition at line 233 of file CompactListList_devI.H.

References Foam::T().

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

Return subscript-checked element.

Definition at line 248 of file CompactListList_devI.H.

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

Return const subscript-checked element.

Definition at line 259 of file CompactListList_devI.H.

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

Return as List<Container>

Definition at line 238 of file CompactListList_dev.C.

References forAll.

void operator= ( const T &   t  ) [inline]

Assignment of all entries to the given value.

Definition at line 269 of file CompactListList_devI.H.


Friends And Related Function Documentation

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

Read CompactListList_dev from Istream, discarding contents.

of existing CompactListList_dev.

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

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