KASKADE 7 development version
|
A structure for holding a sequence of several local matrices to be filled sequentially and to be scattered jointly. More...
#include <localMatrices.hh>
A structure for holding a sequence of several local matrices to be filled sequentially and to be scattered jointly.
This realizes a container of dense or diagonal matrices (depending on the diagonal template parameter), with the critical feature that the entries for all the matrices are stored in a contiguous memory block. This should improve locality of memory access during assembly and scattering of local matrices.
Entry | the type of matrix entries |
diagonal | if true, only diagonal |
SortedRowIdx | a range of row indices (global row, local row) sorted ascendingly by global row |
SortedColIdx | a range of column indices (global col, local col) sorted ascendingly by global col |
IT | a particular type that can be used to "store" static information associated to the buffer |
Definition at line 179 of file localMatrices.hh.
Public Types | |
using | value_type = LocalMatrix< Entry, diagonal, SortedRowIdx, SortedColIdx > |
using | InfoType = IT |
Public Member Functions | |
LocalMatrices (NumaBCRSMatrix< Entry, IndexType > &globalMatrix_, size_t maxStorage_=256 *1024) | |
LocalMatrices () | |
Default constructor. More... | |
~LocalMatrices () | |
Destructor. More... | |
void | push_back (SortedRowIdx const &ridx, SortedColIdx const &cidx) |
Appends another (zero-initialized) local matrix. More... | |
value_type & | operator[] (int n) |
A reference to the n-th local matrix. More... | |
value_type const & | operator[] (int n) const |
value_type & | back () |
A reference to the last pushed local matrix. More... | |
value_type const & | back () const |
size_t | size () const |
The number of local matrices that are stored. More... | |
void | scatter () |
Scatters the local matrices into the global one and removes them from the local container. More... | |
void | clear () |
clears all the data, leaving an empty state More... | |
size_t | storageSize () const |
reports the size of the local matrices storage in bytes More... | |
size_t | storageSizeLimit () const |
reports the maximal desired local matrices storage size More... | |
Public Attributes | |
std::vector< value_type > | localMatrices |
using Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::InfoType = IT |
Definition at line 183 of file localMatrices.hh.
using Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::value_type = LocalMatrix<Entry,diagonal,SortedRowIdx,SortedColIdx> |
Definition at line 182 of file localMatrices.hh.
|
inline |
maxStorage_ | the desired maximum size of the occupied memory. This is no hard limit, merely a hint. Defaults to 256kB. |
Definition at line 188 of file localMatrices.hh.
|
inline |
Default constructor.
This creates an essentially useless empty local matrix buffer.
Definition at line 201 of file localMatrices.hh.
|
inline |
Destructor.
The destructor scatters all remaining local matrices into the global matrix.
Definition at line 210 of file localMatrices.hh.
|
inline |
A reference to the last pushed local matrix.
Definition at line 254 of file localMatrices.hh.
Referenced by Kaskade::NumaBCRSMatrix< Entry, Index >::conjugation(), and Kaskade::BDDC::KKTSolver< Domain >::KKTSolver().
|
inline |
Definition at line 255 of file localMatrices.hh.
|
inline |
clears all the data, leaving an empty state
Definition at line 279 of file localMatrices.hh.
Referenced by Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::scatter().
|
inline |
A reference to the n-th local matrix.
Definition at line 248 of file localMatrices.hh.
|
inline |
Definition at line 249 of file localMatrices.hh.
|
inline |
Appends another (zero-initialized) local matrix.
In case that appending the new local matrix exceeds the maximum storage size, the existing local matrices are scattered into the global matrix before the new matrix is created.
ridx | a range of (global idx, local idx) pairs sorted by global index defining the local matrix rows |
cidx | the same for the columns |
Definition at line 227 of file localMatrices.hh.
Referenced by Kaskade::NumaBCRSMatrix< Entry, Index >::conjugation(), and Kaskade::BDDC::KKTSolver< Domain >::KKTSolver().
|
inline |
Scatters the local matrices into the global one and removes them from the local container.
This is generally not necessary, as the LocalMatrices class scatters automatically as soon as its buffer is filled, and also on destruction. Use this only if you need to control the specific time point at which scattering occurs.
Definition at line 269 of file localMatrices.hh.
Referenced by Kaskade::BDDC::KKTSolver< Domain >::KKTSolver(), Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::push_back(), and Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::~LocalMatrices().
|
inline |
The number of local matrices that are stored.
Definition at line 260 of file localMatrices.hh.
Referenced by Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::push_back().
|
inline |
reports the size of the local matrices storage in bytes
This can be used to limit the number of local matrices such that their memory fits into the CPU cache.
Definition at line 290 of file localMatrices.hh.
|
inline |
reports the maximal desired local matrices storage size
Definition at line 298 of file localMatrices.hh.
std::vector<value_type> Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::localMatrices |
Definition at line 216 of file localMatrices.hh.
Referenced by Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::back(), Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::clear(), Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::operator[](), Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::push_back(), Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::scatter(), and Kaskade::LocalMatrices< Entry, diagonal, SortedRowIdx, SortedColIdx, IT, IndexType >::size().