50#ifndef Foam_CompactListList_H
51#define Foam_CompactListList_H
91 static void reportOverflowAndExit
94 const label prevOffset = -1,
99 template<
class ListListType>
102 const ListListType& lists,
103 const bool checkOverflow =
false
107 inline void enforceSizeSanity();
110 label maxNonLocalSize(
const label rowi)
const;
118 const bool checkOverflow =
false
153 template<
class SubListType = List<T>>
157 const bool checkOverflow =
false
161 template<
class SubListType,
class Addr>
165 const bool checkOverflow =
false
190 const label mRows, const label nVals,
Foam::
zero
286 inline label
localEnd(const label i) const;
308 inline
void resize(const label mRows);
311 inline
void resize(const label mRows, const label nVals);
314 inline
void resize_nocopy(const label mRows, const label nVals);
317 inline
void resize(const label mRows, const label nVals, const
T&);
341 inline label
toGlobal(const label rowi, const label i) const;
344 inline label
toLocal(const label rowi, const label i) const;
348 inline label
findRow(const label i) const;
352 inline label
whichRow(const label i) const;
363 template<class SubListType, class OutputIter>
378 template<class SubListType, class OutputIter>
391 template<class SubListType, class OutputIter>
401 template<class SubListType =
List<
T>>
405 template<class SubListType =
List<
T>>
409 template<class SubListType =
List<
T>>
422 inline
void operator=(const
T& val);
437 inline const
SubList<
T> operator[](const label i) const;
440 inline
SubList<
T> operator[](const label i);
446 inline
T& operator()(const label i, const label j);
449 inline const
T& operator()(const label i, const label j) const;
497 label
index(
const label rowi,
const label colj)
const
503 label
whichColumn(
const label rowi,
const label i)
const
509 void setSize(
const label mRows)
515 void setSize(
const label mRows,
const label nVals)
517 this->
resize(mRows, nVals);
521 void setSize(
const label mRows,
const label nVals,
const T& val)
523 this->
resize(mRows, nVals, val);
A packed storage of objects of type <T> using an offset table for access.
bool single() const noexcept
labelList & offsets() noexcept
Return non-const access to the offset table.
List< SubListType > unpack() const
const List< label > & m() const noexcept
void resize_nocopy(const label mRows, const label nVals)
char * data_bytes() noexcept
label localSize(const label i) const
label totalSize() const noexcept
void setSize(const labelUList &listSizes)
Reset sizes - same as resize().
void setSize(const label mRows, const label nVals, const T &val)
Redimension - same as resize().
bool empty() const noexcept
Ostream & writeMatrix(Ostream &os, const label shortLen=0) const
const labelList & offsets() const noexcept
const T * cdata() const noexcept
Return const pointer to the first data in values().
const label * const_pointer
static const CompactListList< T > & null() noexcept
Return a null CompactListList (reference to a nullObject).
const List< T > & values() const noexcept
Return the packed values.
label whichRow(const label i) const
List< labelRange > ranges() const
label findRow(const label i) const
static CompactListList< T > pack(const IndirectListBase< SubListType, Addr > &lists, const bool checkOverflow=false)
Construct by packing together an indirect list of lists.
const labelUList localStarts() const
labelRange range(const label i) const
static CompactListList< T > pack(const UList< SubListType > &lists, const bool checkOverflow=false)
Construct by packing together the list of lists.
void transfer(CompactListList< label > &list)
label length() const noexcept
label localStart(const label i) const
label size() const noexcept
std::streamsize byteSize() const
const SubList< label > localList(const label i) const
List< T > & values() noexcept
Return non-const access to the packed values.
void setLocalSize(const label rowi, const label len)
void resize(const label mRows)
const char * cdata_bytes() const noexcept
label index(const label rowi, const label colj) const
Return flat index into packed values.
labelList localSizes() const
label localEnd(const label i) const
Ostream & writeList(Ostream &os, const label shortLen=0) const
Istream & readList(Istream &is)
void swap(CompactListList< label > &other)
std::streamsize size_bytes() const noexcept
label whichColumn(const label rowi, const label i) const
Get column within specified row that corresponds to global index.
label toLocal(const label rowi, const label i) const
void setSize(const label mRows, const label nVals)
Redimension - same as resize().
CompactListList() noexcept=default
Default construct.
void setSize(const label mRows)
Redimension - same as resize().
const label & const_reference
autoPtr< CompactListList< label > > clone() const
OutputIter copy_unpack(OutputIter d_iter, const label pos=0, label len=-1) const
label toGlobal(const label rowi, const label i) const
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A non-owning sub-view of a List (allocated or unallocated storage).
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A range or interval of labels defined by a start and a size.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
OBJstream os(runTime.globalPath()/outputName)
dimensionedScalar pos(const dimensionedScalar &ds)
const T & NullObjectRef() noexcept
Const reference (of type T) to the nullObject.
List< label > labelList
A List of labels.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
CompactListList< label > labelCompactListList
A CompactListList of labels.
Istream & operator>>(Istream &, directionInfo &)
UList< label > labelUList
A UList of labels.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
#define FOAM_DEPRECATED_STRICT(since, replacement)
Number of items before requiring line-breaks in the list output.