A packed storage unstructured matrix of objects of type <T> using an offset table for access. More...
Public Types | |
typedef T | value_type |
The value type the list contains. More... | |
typedef T * | pointer |
The pointer type for non-const access to value_type items. More... | |
typedef const T * | const_pointer |
The pointer type for const access to value_type items. More... | |
typedef T & | reference |
The type used for storing into value_type objects. More... | |
typedef const T & | const_reference |
The type used for reading from constant value_type objects. More... | |
typedef label | size_type |
The type to represent the size of a CompactListList. More... | |
Public Member Functions | |
CompactListList () noexcept=default | |
Default construct. More... | |
CompactListList (const CompactListList< T > &list) | |
Copy construct. More... | |
CompactListList (CompactListList< T > &&list) | |
Move construct. More... | |
CompactListList (CompactListList< T > &list, bool reuse) | |
Copy/move construct as specified. More... | |
CompactListList (const label mRows, const label nVals) | |
Construct from number of rows and number of values. More... | |
CompactListList (const label mRows, const label nVals, const Foam::zero) | |
Construct from number of rows, number of values initializing all elements to zero. More... | |
CompactListList (const label mRows, const label nVals, const T &) | |
Construct from number of rows, number of values and uniform value for all elements. More... | |
CompactListList (const labelUList &listSizes) | |
Construct given list of row-sizes. More... | |
CompactListList (const labelUList &listSizes, const T &val) | |
Construct given list of row-sizes and a uniform value. More... | |
CompactListList (Istream &is) | |
Construct from Istream. More... | |
autoPtr< CompactListList< T > > | clone () const |
Clone. More... | |
bool | empty () const noexcept |
True if the number of rows/sublists is zero. More... | |
label | size () const noexcept |
The primary size (the number of rows/sublists) More... | |
label | totalSize () const |
The total addressed size. More... | |
const labelList & | offsets () const noexcept |
Return the offset table (= size()+1) More... | |
labelList & | offsets () noexcept |
Return non-const access to the offset table. More... | |
const List< T > & | values () const noexcept |
Return the packed matrix of values. More... | |
List< T > & | values () noexcept |
Return non-const access to the packed matrix of values. More... | |
const T * | cdata () const noexcept |
Return const pointer to the first data in values() More... | |
T * | data () noexcept |
Return pointer to the first data in values() More... | |
const char * | cdata_bytes () const noexcept |
Return const pointer to underlying values storage, reinterpreted as byte data. More... | |
char * | data_bytes () noexcept |
Return pointer to underlying values storage, reinterpreted as byte data. More... | |
std::streamsize | size_bytes () const noexcept |
Number of contiguous bytes for the values data, no runtime check that the type is actually contiguous. More... | |
std::streamsize | byteSize () const |
Number of contiguous bytes for the values data, runtime FatalError if type is not contiguous. More... | |
labelList | sizes () const |
The local row sizes. Same as localSizes. More... | |
const labelUList | localStarts () const |
The local row starts. More... | |
labelList | localSizes () const |
The local row sizes. More... | |
label | localStart (const label i) const |
Starting offset for given row. More... | |
label | localEnd (const label i) const |
End offset (exclusive) for given row. More... | |
label | localSize (const label i) const |
Size of given row. More... | |
List< labelRange > | ranges () const |
Return start/size ranges for all sub-lists. More... | |
labelRange | range (const label i) const |
Return start/size range for given sub-list. More... | |
label | maxSize () const |
The max row length used. More... | |
void | clear () |
Clear addressing and contents. More... | |
void | resize (const label mRows) |
Reset size of CompactListList. More... | |
void | resize (const label mRows, const label nVals) |
Redimension CompactListList. More... | |
void | resize_nocopy (const label mRows, const label nVals) |
Redimension without preserving existing content. More... | |
void | resize (const label mRows, const label nVals, const T &) |
Redimension CompactListList and fill new elements with value. More... | |
void | resize (const labelUList &listSizes) |
Reset dimensions of CompactListList. More... | |
void | setLocalSize (const label rowi, const label len) |
Alter local addressing size for given row, does not change content. More... | |
void | setSize (const label mRows) |
Redimension - same as resize() More... | |
void | setSize (const label mRows, const label nVals) |
Redimension - same as resize() More... | |
void | setSize (const label mRows, const label nVals, const T &) |
Redimension - same as resize() More... | |
void | setSize (const labelUList &listSizes) |
Reset sizes - same as resize() More... | |
void | swap (CompactListList< T > &other) |
Swap contents. More... | |
void | transfer (CompactListList< T > &list) |
Transfer contents into this and annul the argument. More... | |
label | toGlobal (const label rowi, const label i) const |
From local index on rowi to global (flat) indexing into packed values. More... | |
label | toLocal (const label rowi, const label i) const |
From global to local index on rowi. More... | |
label | findRow (const label i) const |
Find row where global index comes from. Binary search. More... | |
label | whichRow (const label i) const |
Which row does global index come from? Binary search. More... | |
template<class SubListType = List<T>> | |
List< SubListType > | unpack () const |
Return non-compact list of lists. More... | |
template<class SubListType = List<T>> | |
List< SubListType > | unpack (const labelRange &range) const |
Return non-compact list of lists for the range of sub-lists. More... | |
void | operator= (const CompactListList< T > &list) |
Copy assignment. More... | |
void | operator= (CompactListList< T > &&list) |
Move assignment. More... | |
void | operator= (const T &val) |
Assignment of all entries to the given value. More... | |
void | operator= (const Foam::zero) |
Assignment of all entries to zero. More... | |
UList< T > | localList (const label i) |
Return non-const access to sub-list (no subscript checking) More... | |
const UList< T > | localList (const label i) const |
Return const access to sub-list (no subscript checking) More... | |
UList< T > | operator[] (const label i) |
Return row as UList - same as localList method. More... | |
const UList< T > | operator[] (const label i) const |
Return row as const UList - same as localList method. More... | |
T & | operator() (const label i, const label j) |
Return subscript-checked element. More... | |
const T & | operator() (const label i, const label j) const |
Return const subscript-checked element. More... | |
Istream & | readList (Istream &is) |
Read CompactListList as offsets/values pair from Istream, discards current list contents. More... | |
Ostream & | writeList (Ostream &os, const label shortLen=0) const |
Write CompactListList as offsets/values pair. More... | |
const List< T > & | m () const noexcept |
Const access to the packed matrix of values. More... | |
List< T > & | m () noexcept |
Non-const access to the packed matrix of values. More... | |
label | index (const label rowi, const label colj) const |
Return flat index into packed values. More... | |
label | whichColumn (const label rowi, const label i) const |
Get column within specified row that corresponds to global index. More... | |
template<class ListListType > | |
Foam::CompactListList< T > | packImpl (const ListListType &lists, const bool checkOverflow) |
template<class SubListType > | |
Foam::CompactListList< T > | pack (const UList< SubListType > &lists, const bool checkOverflow) |
template<class SubListType , class Addr > | |
Foam::CompactListList< T > | pack (const IndirectListBase< SubListType, Addr > &lists, const bool checkOverflow) |
template<class SubListType > | |
Foam::List< SubListType > | unpack () const |
template<class SubListType > | |
Foam::List< SubListType > | unpack (const labelRange &range) const |
Static Public Member Functions | |
static const CompactListList< T > & | null () |
Return a CompactListList reference to a nullObject. More... | |
template<class SubListType = List<T>> | |
static CompactListList< T > | pack (const UList< SubListType > &lists, const bool checkOverflow=false) |
Construct by packing together the list of lists. More... | |
template<class SubListType , class Addr > | |
static CompactListList< T > | pack (const IndirectListBase< SubListType, Addr > &lists, const bool checkOverflow=false) |
Construct by packing together an indirect list of lists. More... | |
Friends | |
Istream & | operator>> (Istream &, CompactListList< T > &) |
Read CompactListList offsets/values pair from Istream, discarding existing contents. More... | |
Ostream & | operator (Ostream &, const CompactListList< T > &) |
Write CompactListList as offsets/values pair. More... | |
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.
Note that an empty CompactListList should have empty offsets (not size 1).
Definition at line 89 of file polyTopoChange.H.
typedef T value_type |
The value type the list contains.
Definition at line 121 of file CompactListList.H.
The pointer type for non-const access to value_type items.
Definition at line 126 of file CompactListList.H.
typedef const T* const_pointer |
The pointer type for const access to value_type items.
Definition at line 131 of file CompactListList.H.
The type used for storing into value_type objects.
Definition at line 136 of file CompactListList.H.
typedef const T& const_reference |
The type used for reading from constant value_type objects.
Definition at line 141 of file CompactListList.H.
typedef label size_type |
The type to represent the size of a CompactListList.
Definition at line 146 of file CompactListList.H.
|
defaultnoexcept |
Default construct.
|
inline |
Copy construct.
Definition at line 54 of file CompactListListI.H.
|
inline |
Move construct.
Definition at line 65 of file CompactListListI.H.
|
inline |
Copy/move construct as specified.
Definition at line 76 of file CompactListListI.H.
|
inline |
Construct from number of rows and number of values.
Definition at line 89 of file CompactListListI.H.
|
inline |
Construct from number of rows, number of values initializing all elements to zero.
Definition at line 103 of file CompactListListI.H.
|
inline |
Construct from number of rows, number of values and uniform value for all elements.
Definition at line 118 of file CompactListListI.H.
|
explicit |
Construct given list of row-sizes.
Definition at line 139 of file CompactListList.C.
References UList< T >::size().
CompactListList | ( | const labelUList & | listSizes, |
const T & | val | ||
) |
Construct given list of row-sizes and a uniform value.
Definition at line 169 of file CompactListList.C.
References UList< T >::size().
|
explicit |
Construct from Istream.
Definition at line 27 of file CompactListListIO.C.
|
inlinestatic |
Return a CompactListList reference to a nullObject.
Definition at line 28 of file CompactListListI.H.
|
static |
Construct by packing together the list of lists.
|
static |
Construct by packing together an indirect list of lists.
|
inline |
Clone.
Definition at line 133 of file CompactListListI.H.
References Foam::New().
|
inlinenoexcept |
True if the number of rows/sublists is zero.
Definition at line 205 of file CompactListListI.H.
|
inlinenoexcept |
The primary size (the number of rows/sublists)
Definition at line 212 of file CompactListListI.H.
Referenced by decompositionMethod::calcCellCells(), and SloanRenumber::renumber().
|
inline |
The total addressed size.
Definition at line 227 of file CompactListListI.H.
|
inlinenoexcept |
Return the offset table (= size()+1)
Definition at line 142 of file CompactListListI.H.
Referenced by decompositionMethod::calcCellCells(), metisLikeDecomp::decompose(), decompositionInformation::decompositionInformation(), globalIndex::get(), and Foam::ensightOutput::Detail::getPolysFacePoints().
|
inlinenoexcept |
Return non-const access to the offset table.
Definition at line 149 of file CompactListListI.H.
|
inlinenoexcept |
Return the packed matrix of values.
Definition at line 156 of file CompactListListI.H.
Referenced by metisLikeDecomp::decompose(), decompositionInformation::decompositionInformation(), and Foam::ensightOutput::Detail::getPolysFacePoints().
|
inlinenoexcept |
Return non-const access to the packed matrix of values.
Definition at line 163 of file CompactListListI.H.
|
inlinenoexcept |
Return const pointer to the first data in values()
Definition at line 170 of file CompactListListI.H.
Return pointer to the first data in values()
Definition at line 177 of file CompactListListI.H.
|
inlinenoexcept |
Return const pointer to underlying values storage, reinterpreted as byte data.
Definition at line 184 of file CompactListListI.H.
|
inlinenoexcept |
Return pointer to underlying values storage, reinterpreted as byte data.
Definition at line 191 of file CompactListListI.H.
|
inlinenoexcept |
Number of contiguous bytes for the values data, no runtime check that the type is actually contiguous.
Definition at line 198 of file CompactListListI.H.
std::streamsize byteSize | ( | ) | const |
Number of contiguous bytes for the values data, runtime FatalError if type is not contiguous.
Definition at line 228 of file CompactListList.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
inline |
The local row sizes. Same as localSizes.
Definition at line 220 of file CompactListListI.H.
|
inline |
The local row starts.
Definition at line 243 of file CompactListListI.H.
Foam::labelList localSizes | ( | ) | const |
The local row sizes.
Definition at line 323 of file CompactListList.C.
References Foam::HashTableOps::values().
|
inline |
Starting offset for given row.
Definition at line 254 of file CompactListListI.H.
|
inline |
End offset (exclusive) for given row.
Definition at line 261 of file CompactListListI.H.
|
inline |
Size of given row.
Definition at line 268 of file CompactListListI.H.
Foam::List< Foam::labelRange > ranges | ( | ) | const |
Return start/size ranges for all sub-lists.
Definition at line 249 of file CompactListList.C.
References Foam::HashTableOps::values().
Foam::labelRange range | ( | const label | i | ) | const |
Return start/size range for given sub-list.
Definition at line 241 of file CompactListList.C.
|
inline |
The max row length used.
Definition at line 235 of file CompactListListI.H.
|
inline |
Clear addressing and contents.
Definition at line 347 of file CompactListListI.H.
|
inline |
Reset size of CompactListList.
Definition at line 355 of file CompactListListI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
|
inline |
Redimension CompactListList.
Definition at line 383 of file CompactListListI.H.
References Foam::Zero.
|
inline |
Redimension without preserving existing content.
Definition at line 395 of file CompactListListI.H.
References Foam::Zero.
|
inline |
Redimension CompactListList and fill new elements with value.
Definition at line 407 of file CompactListListI.H.
References Foam::Zero.
void resize | ( | const labelUList & | listSizes | ) |
Reset dimensions of CompactListList.
Definition at line 272 of file CompactListList.C.
References clear(), and UList< T >::size().
void setLocalSize | ( | const label | rowi, |
const label | len | ||
) |
Alter local addressing size for given row, does not change content.
Definition at line 304 of file CompactListList.C.
References delta.
|
inline |
Redimension - same as resize()
Definition at line 420 of file CompactListListI.H.
References resize().
Referenced by decompositionMethod::calcCellCells().
|
inline |
Redimension - same as resize()
Definition at line 428 of file CompactListListI.H.
References resize().
|
inline |
Redimension - same as resize()
Definition at line 439 of file CompactListListI.H.
References resize().
|
inline |
Reset sizes - same as resize()
Definition at line 451 of file CompactListListI.H.
References resize().
void swap | ( | CompactListList< T > & | other | ) |
Swap contents.
Definition at line 347 of file CompactListList.C.
void transfer | ( | CompactListList< T > & | list | ) |
Transfer contents into this and annul the argument.
Definition at line 363 of file CompactListList.C.
Referenced by CompactListList< T >::operator=().
|
inline |
From local index on rowi to global (flat) indexing into packed values.
Definition at line 292 of file CompactListListI.H.
Referenced by CompactListList< T >::index().
|
inline |
From global to local index on rowi.
Definition at line 303 of file CompactListListI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
Referenced by CompactListList< T >::whichColumn().
|
inline |
Find row where global index comes from. Binary search.
Definition at line 323 of file CompactListListI.H.
References Foam::findLower().
|
inline |
Which row does global index come from? Binary search.
FatalError if out-of-bounds
Definition at line 330 of file CompactListListI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
List<SubListType> unpack | ( | ) | const |
Return non-compact list of lists.
Referenced by multiLevelDecomp::decompose(), decompositionMethod::decompose(), and renumberMethod::renumber().
List<SubListType> unpack | ( | const labelRange & | range | ) | const |
Return non-compact list of lists for the range of sub-lists.
|
inline |
Copy assignment.
Definition at line 463 of file CompactListListI.H.
|
inline |
Move assignment.
Definition at line 479 of file CompactListListI.H.
References CompactListList< T >::transfer().
Assignment of all entries to the given value.
Definition at line 494 of file CompactListListI.H.
|
inline |
Assignment of all entries to zero.
Definition at line 501 of file CompactListListI.H.
References Foam::Zero.
|
inline |
Return non-const access to sub-list (no subscript checking)
Definition at line 276 of file CompactListListI.H.
|
inline |
Return const access to sub-list (no subscript checking)
Definition at line 284 of file CompactListListI.H.
|
inline |
Return row as UList - same as localList method.
Definition at line 509 of file CompactListListI.H.
|
inline |
Return row as const UList - same as localList method.
Definition at line 517 of file CompactListListI.H.
Return subscript-checked element.
Definition at line 525 of file CompactListListI.H.
Return const subscript-checked element.
Definition at line 536 of file CompactListListI.H.
Foam::Istream & readList | ( | Istream & | is | ) |
Read CompactListList as offsets/values pair from Istream, discards current list contents.
Definition at line 39 of file CompactListListIO.C.
Foam::Ostream & writeList | ( | Ostream & | os, |
const label | shortLen = 0 |
||
) | const |
Write CompactListList as offsets/values pair.
Definition at line 50 of file CompactListListIO.C.
References os().
Const access to the packed matrix of values.
Definition at line 583 of file CompactListList.H.
Referenced by decompositionMethod::calcCellCells().
Non-const access to the packed matrix of values.
Definition at line 588 of file CompactListList.H.
|
inline |
Return flat index into packed values.
Definition at line 593 of file CompactListList.H.
References CompactListList< T >::toGlobal().
|
inline |
Get column within specified row that corresponds to global index.
Definition at line 601 of file CompactListList.H.
References CompactListList< T >::toLocal().
Foam::CompactListList<T> packImpl | ( | const ListListType & | lists, |
const bool | checkOverflow | ||
) |
Definition at line 53 of file CompactListList.C.
References forAll, and Foam::Zero.
Foam::CompactListList<T> pack | ( | const UList< SubListType > & | lists, |
const bool | checkOverflow | ||
) |
Definition at line 107 of file CompactListList.C.
Foam::CompactListList<T> pack | ( | const IndirectListBase< SubListType, Addr > & | lists, |
const bool | checkOverflow | ||
) |
Definition at line 123 of file CompactListList.C.
Foam::List<SubListType> unpack | ( | ) | const |
Definition at line 380 of file CompactListList.C.
References forAll.
Foam::List<SubListType> unpack | ( | const labelRange & | range | ) | const |
Definition at line 396 of file CompactListList.C.
References IndirectListBase< T, Addr >::begin(), and range.
|
friend |
Read CompactListList offsets/values pair from Istream, discarding existing contents.
Definition at line 613 of file CompactListList.H.
|
friend |
Write CompactListList as offsets/values pair.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.