A packed storage unstructured matrix of objects of type <T> using an offset table for access. More...
#include <dynamicMesh/CompactListList_dev.H>
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-contructed CompactListList_dev has an empty offsets_ (instead of size 1).
Definition at line 80 of file CompactListList_dev.H.
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 > &) |
|
inline |
Null constructor.
Definition at line 32 of file CompactListList_devI.H.
|
explicit |
Construct by converting given List<List<T> >
Definition at line 31 of file CompactListList_dev.C.
References forAll, k(), and List< T >::size().
|
inline |
Construct given size of offset table (number of rows)
and number of data.
Definition at line 40 of file CompactListList_devI.H.
|
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.
|
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.
|
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.
CompactListList_dev | ( | Istream & | is | ) |
Construct from Istream.
Definition at line 32 of file CompactListList_devIO.C.
References operator>>().
|
inlinestatic |
Return a null CompactListList_dev.
Definition at line 80 of file CompactListList_devI.H.
|
inline |
Clone.
Definition at line 67 of file CompactListList_devI.H.
|
inline |
Return the primary size, i.e. the number of rows.
Definition at line 87 of file CompactListList_devI.H.
|
inline |
Return true if the number of rows is zero.
Definition at line 94 of file CompactListList_devI.H.
|
inline |
Return the offset table (= size()+1)
Definition at line 102 of file CompactListList_devI.H.
|
inline |
Return non-const access to the offset table.
Definition at line 109 of file CompactListList_devI.H.
|
inline |
Return the packed matrix of data.
Definition at line 116 of file CompactListList_devI.H.
|
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().
|
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().
|
inline |
Reset size of CompactListList_dev.
Definition at line 186 of file CompactListList_devI.H.
References setSize().
|
inline |
Reset sizes of CompactListList_dev and value for new elements.
Definition at line 197 of file CompactListList_devI.H.
References setSize().
|
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.
|
inline |
Transfer the contents to the Xfer container.
Definition at line 171 of file CompactListList_devI.H.
References Foam::xferMove().
|
inline |
Return index into m.
Definition at line 132 of file CompactListList_devI.H.
|
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().
|
inline |
Get column index (j) given above row.
Definition at line 160 of file CompactListList_devI.H.
|
inline |
Return subscript-checked row as UList.
Definition at line 221 of file CompactListList_devI.H.
|
inline |
Return const subscript-checked row as UList.
Definition at line 233 of file CompactListList_devI.H.
References Foam::T().
Return subscript-checked element.
Definition at line 248 of file CompactListList_devI.H.
Return const subscript-checked element.
Definition at line 259 of file CompactListList_devI.H.
Foam::List< Container > operator() | ( | ) | const |
Assignment of all entries to the given value.
Definition at line 269 of file CompactListList_devI.H.
|
friend |
Read CompactListList_dev from Istream, discarding contents.
of existing CompactListList_dev.
|
friend |