Tpetra parallel linear algebra
Version of the Day
|
Implementation detail of Tpetra::Details::CooMatrix (which see below). More...
#include <Tpetra_Details_CooMatrix.hpp>
Public Types | |
typedef char | packet_type |
Type for packing and unpacking data. More... | |
Public Member Functions | |
CooMatrixImpl ()=default | |
Default constructor. More... | |
void | sumIntoGlobalValue (const GO gblRowInd, const GO gblColInd, const SC &val) |
Insert one entry locally into the sparse matrix, if it does not exist there yet. If it does exist, sum the values. More... | |
void | sumIntoGlobalValues (const GO gblRowInds[], const GO gblColInds[], const SC vals[], const std::size_t numEnt) |
Insert multiple entries locally into the sparse matrix. More... | |
std::size_t | getLclNumEntries () const |
Number of entries in the sparse matrix on the calling process. More... | |
void | forAllEntries (std::function< void(const GO, const GO, const SC &)> f) const |
Execute the given function for all entries of the sparse matrix, sequentially (no thread parallelism). Do not modify entries. More... | |
void | mergeIntoRow (const GO tgtGblRow, const CooMatrixImpl< SC, GO > &src, const GO srcGblRow) |
Into global row tgtGblRow of *this , merge global row srcGblRow of src . More... | |
int | countPackRow (int &numPackets, const GO gblRow, const ::Teuchos::Comm< int > &comm, std::ostream *errStrm=NULL) const |
Count the number of packets (bytes, in this case) needed to pack the given row of the matrix. More... | |
void | packRow (packet_type outBuf[], const int outBufSize, int &outBufCurPos, const ::Teuchos::Comm< int > &comm, std::vector< GO > &gblRowInds, std::vector< GO > &gblColInds, std::vector< SC > &vals, const GO gblRow) const |
Pack the given row of the matrix. More... | |
GO | getMyGlobalRowIndices (std::vector< GO > &rowInds) const |
Get the global row indices on this process, sorted and made unique, and return the minimum global row index on this process. More... | |
template<class OffsetType , class LO > | |
void | buildLocallyIndexedCrs (std::vector< OffsetType > &rowOffsets, LO lclColInds[], SC vals[], std::function< LO(const GO)> gblToLcl) const |
Build a locally indexed version of CRS storage. More... | |
Implementation detail of Tpetra::Details::CooMatrix (which see below).
Definition at line 97 of file Tpetra_Details_CooMatrix.hpp.
typedef char Tpetra::Details::Impl::CooMatrixImpl< SC, GO >::packet_type |
Type for packing and unpacking data.
Definition at line 115 of file Tpetra_Details_CooMatrix.hpp.
|
default |
Default constructor.
|
inline |
Insert one entry locally into the sparse matrix, if it does not exist there yet. If it does exist, sum the values.
gblRowInd | [in] Global row index of the entry to insert. |
gblColInd | [in] Global column index of the entry to insert. |
val | [in] Value of the matrix entry to insert / sum. |
Definition at line 127 of file Tpetra_Details_CooMatrix.hpp.
|
inline |
Insert multiple entries locally into the sparse matrix.
This works like multiple calls to sumIntoGlobalValue.
gblRowInd | [in] Global row indices of the entries to insert. |
gblColInd | [in] Global column indices of the entries to insert. |
val | [in] Values of the matrix entries to insert / sum. |
numEnt | [in] Number of entries to insert. |
Definition at line 150 of file Tpetra_Details_CooMatrix.hpp.
|
inline |
Number of entries in the sparse matrix on the calling process.
Definition at line 170 of file Tpetra_Details_CooMatrix.hpp.
|
inline |
Execute the given function for all entries of the sparse matrix, sequentially (no thread parallelism). Do not modify entries.
Definition at line 179 of file Tpetra_Details_CooMatrix.hpp.
|
inline |
Into global row tgtGblRow of *this
, merge global row srcGblRow of src
.
For matrix entries with the same row and column indices, sum the values into the entry in tgtEntries.
Definition at line 193 of file Tpetra_Details_CooMatrix.hpp.
|
inline |
Count the number of packets (bytes, in this case) needed to pack the given row of the matrix.
numPackets | [out] Number of packets (bytes, in this case) needed for the row. Must be an int for MPI's sake. |
gblRow | [in] Global index of the row to pack. |
comm | [in] Communicator for packing. |
Definition at line 255 of file Tpetra_Details_CooMatrix.hpp.
|
inline |
Pack the given row of the matrix.
outBuf | [out] Output pack buffer. |
outBufSize | [out] Total output buffer size in bytes. |
outBufCurPos | [in/out] Current position from which to start writing to the output buffer. This corresponds to the 'position' in/out argument of MPI_Pack. |
comm | [in] The communicator (MPI wants this). |
gblRowInds | [in/out] Temporary space for row indices. |
gblColInds | [in/out] Temporary space for column indices. |
vals | [in/out] Temporary space for matrix values. |
gblRow | [in] Global index of the row to pack. |
Definition at line 338 of file Tpetra_Details_CooMatrix.hpp.
|
inline |
Get the global row indices on this process, sorted and made unique, and return the minimum global row index on this process.
rowInds | [out] The global row indices on this process. |
Definition at line 407 of file Tpetra_Details_CooMatrix.hpp.
|
inline |
Build a locally indexed version of CRS storage.
Build a locally indexed version of compressed row sparse (CRS, also known as "compressed sparse row," CSR) storage.
rowOffsets | [out] Row offsets. |
lclColInds | [out] The matrix's local column indices; must have at least getLclNumEntries() entries. |
vals | [out] The matrix's values; must have at least getLclNumEntries() entries. |
gblToLcl | [in] Closure that can convert a global column index to a local column index. |
Definition at line 480 of file Tpetra_Details_CooMatrix.hpp.