A packed storage unstructured matrix of objects of type <T> using an offset table for access. More...
#include <OpenFOAM/CompactListList.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 whose elements are the accumulated sizes of the rows, i.e.
and for i = 0, offset[i-1] = 0.
Storage is allocated on free-store during construction.
Definition at line 70 of file CompactListList.H.
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 > &) |
|
inline |
Null constructor.
Definition at line 30 of file CompactListListI.H.
CompactListList | ( | const List< List< T > > & | ll | ) |
Construct by converting given List<List<T> >
Definition at line 31 of file CompactListList.C.
|
inline |
Construct given size of offset table (number of rows)
and number of data.
Definition at line 36 of file CompactListListI.H.
|
inline |
Construct given size of offset table (number of rows),.
the number of data and a value for all elements.
Definition at line 48 of file CompactListListI.H.
CompactListList | ( | const UList< label > & | rowSizes | ) |
Construct given list of row-sizes.
Definition at line 59 of file CompactListList.C.
References forAll.
CompactListList | ( | const UList< label > & | rowSizes, |
const T & | t | ||
) |
Construct given list of row-sizes.
Definition at line 78 of file CompactListList.C.
References forAll.
CompactListList | ( | const Xfer< CompactListList< T > > & | lst | ) |
Construct by transferring the parameter contents.
Definition at line 98 of file CompactListList.C.
CompactListList | ( | CompactListList< T > & | lst, |
bool | reUse | ||
) |
Construct as copy or re-use as specified.
Definition at line 108 of file CompactListList.C.
CompactListList | ( | Istream & | is | ) |
|
inlinestatic |
Return a null CompactListList.
Definition at line 70 of file CompactListListI.H.
|
inline |
Clone.
Definition at line 61 of file CompactListListI.H.
|
inline |
Return the primary size, i.e. the number of rows.
Definition at line 77 of file CompactListListI.H.
|
inline |
Return true if the number of rows is zero.
Definition at line 84 of file CompactListListI.H.
|
inline |
Return the offset table.
Definition at line 91 of file CompactListListI.H.
|
inline |
Return non-const access to the offset table.
Definition at line 98 of file CompactListListI.H.
|
inline |
Return the packed matrix of data.
Definition at line 105 of file CompactListListI.H.
|
inline |
Return non-const access to the packed matrix of data.
Definition at line 112 of file CompactListListI.H.
void setSize | ( | const label | nRows | ) |
Reset size of CompactListList.
This form only allows contraction of the CompactListList.
Definition at line 121 of file CompactListList.C.
References Foam::abort(), clear(), Foam::FatalError, FatalErrorIn, and Foam::nl.
void setSize | ( | const label | nRows, |
const label | nData | ||
) |
Reset size of CompactListList.
Definition at line 145 of file CompactListList.C.
void setSize | ( | const label | nRows, |
const label | nData, | ||
const T & | t | ||
) |
Reset sizes of CompactListList and value for new elements.
Definition at line 157 of file CompactListList.C.
void setSize | ( | const UList< label > & | rowSizes | ) |
Reset size of CompactListList.
Definition at line 169 of file CompactListList.C.
References forAll, and UList< T >::size().
|
inline |
Reset size of CompactListList.
This form only allows contraction of the CompactListList.
Definition at line 179 of file CompactListListI.H.
References setSize().
|
inline |
Reset size of CompactListList.
Definition at line 187 of file CompactListListI.H.
References setSize().
|
inline |
Reset sizes of CompactListList and value for new elements.
Definition at line 198 of file CompactListListI.H.
References setSize().
|
inline |
Reset size of CompactListList.
Definition at line 209 of file CompactListListI.H.
References setSize().
void clear | ( | ) |
Clear the CompactListList, i.e. set sizes to zero.
Definition at line 200 of file CompactListList.C.
Foam::labelList sizes | ( | ) | const |
Return sizes (to be used e.g. for construction)
Definition at line 185 of file CompactListList.C.
References forAll.
void transfer | ( | CompactListList< T > & | a | ) |
Transfer the contents of the argument CompactListList.
into this CompactListList and annull the argument list.
Definition at line 208 of file CompactListList.C.
References CompactListList< T >::transfer().
Referenced by CompactListList< T >::transfer().
|
inline |
Transfer the contents to the Xfer container.
Definition at line 172 of file CompactListListI.H.
References Foam::xferMove().
|
inline |
Return index into m.
Definition at line 120 of file CompactListListI.H.
|
inline |
Get row for index into m.
Definition at line 137 of file CompactListListI.H.
References Foam::abort(), Foam::FatalError, FatalErrorIn, and forAll.
|
inline |
Get column index (j) given above row.
Definition at line 162 of file CompactListListI.H.
|
inline |
Return subscript-checked row as UList.
Definition at line 219 of file CompactListListI.H.
|
inline |
Return const subscript-checked row as UList.
Definition at line 236 of file CompactListListI.H.
Return subscript-checked element.
Definition at line 253 of file CompactListListI.H.
Return const subscript-checked element.
Definition at line 264 of file CompactListListI.H.
Foam::List< Foam::List< T > > operator() | ( | ) | const |
Return as List<List<T> >
Definition at line 218 of file CompactListList.C.
References forAll, and List< T >::setSize().
Assignment of all entries to the given value.
Definition at line 274 of file CompactListListI.H.
|
friend |
Read CompactListList from Istream, discarding contents.
of existing CompactListList.
|
friend |