|
Tpetra Matrix/Vector Services
Version of the Day
|
Nonowning view of a square dense block in a block matrix. More...
#include <Tpetra_Experimental_BlockView.hpp>
Public Member Functions | |
| LittleBlock (Scalar *const A, const LO blockSize, const LO strideX, const LO strideY) | |
| Constructor. | |
| LO | getBlockSize () const |
| The block size (number of rows, and number of columns). | |
| Scalar * | getRawPtr () const |
| Pointer to the block's entries. | |
| Scalar & | operator() (const LO i, const LO j) const |
| Reference to entry (i,j) of the block. | |
| template<class LittleBlockType > | |
| void | update (const Scalar &alpha, const LittleBlockType &X) const |
*this := *this + alpha * X. | |
| template<class LittleBlockType > | |
| void | assign (const LittleBlockType &X) const |
*this := X. | |
| void | scale (const Scalar &alpha) const |
(*this)(i,j) := alpha * (*this)(i,j) for all (i,j). | |
| void | fill (const Scalar &alpha) const |
(*this)(i,j) := alpha for all (i,j). | |
| template<class LittleBlockType > | |
| void | absmax (const LittleBlockType &X) const |
(*this)(i,j) := max(abs((*this)(i,j)), abs(X(i,j))) for all (i,j). | |
Nonowning view of a square dense block in a block matrix.
| Scalar | The type of entries in the block. |
| LO | The type of local indices. See the documentation of the first template parameter of Map for requirements. |
"Little" means local (not distributed over multiple MPI processes; stored to maximize locality) and small (think 3x3, not 1000x1000).
The Scalar template parameter may be const or nonconst. This is one reason why instance methods below that take a LittleBlock accept it as a template parameter: that lets you add a const LittleBlock (e.g., LittleBlock<const double, int>) to a nonconst LittleBlock (e.g., LittleBlock<double, int>).
Definition at line 85 of file Tpetra_Experimental_BlockView.hpp.
| Tpetra::Experimental::LittleBlock< Scalar, LO >::LittleBlock | ( | Scalar *const | A, |
| const LO | blockSize, | ||
| const LO | strideX, | ||
| const LO | strideY | ||
| ) | [inline] |
Constructor.
| A | [in] Pointer to the block's entries |
| blockSize | [in] Dimension of the block (all blocks are square) |
| strideX | [in] Stride between consecutive entries in a column |
| strideY | [in] Stride between consecutive entries in a row |
Definition at line 95 of file Tpetra_Experimental_BlockView.hpp.
| LO Tpetra::Experimental::LittleBlock< Scalar, LO >::getBlockSize | ( | ) | const [inline] |
The block size (number of rows, and number of columns).
Definition at line 104 of file Tpetra_Experimental_BlockView.hpp.
| Scalar* Tpetra::Experimental::LittleBlock< Scalar, LO >::getRawPtr | ( | ) | const [inline] |
Pointer to the block's entries.
Definition at line 109 of file Tpetra_Experimental_BlockView.hpp.
| Scalar& Tpetra::Experimental::LittleBlock< Scalar, LO >::operator() | ( | const LO | i, |
| const LO | j | ||
| ) | const [inline] |
Reference to entry (i,j) of the block.
Definition at line 114 of file Tpetra_Experimental_BlockView.hpp.
| void Tpetra::Experimental::LittleBlock< Scalar, LO >::update | ( | const Scalar & | alpha, |
| const LittleBlockType & | X | ||
| ) | const [inline] |
*this := *this + alpha * X.
Definition at line 120 of file Tpetra_Experimental_BlockView.hpp.
| void Tpetra::Experimental::LittleBlock< Scalar, LO >::assign | ( | const LittleBlockType & | X | ) | const [inline] |
*this := X.
Definition at line 130 of file Tpetra_Experimental_BlockView.hpp.
| void Tpetra::Experimental::LittleBlock< Scalar, LO >::scale | ( | const Scalar & | alpha | ) | const [inline] |
(*this)(i,j) := alpha * (*this)(i,j) for all (i,j).
Definition at line 139 of file Tpetra_Experimental_BlockView.hpp.
| void Tpetra::Experimental::LittleBlock< Scalar, LO >::fill | ( | const Scalar & | alpha | ) | const [inline] |
(*this)(i,j) := alpha for all (i,j).
Definition at line 148 of file Tpetra_Experimental_BlockView.hpp.
| void Tpetra::Experimental::LittleBlock< Scalar, LO >::absmax | ( | const LittleBlockType & | X | ) | const [inline] |
(*this)(i,j) := max(abs((*this)(i,j)), abs(X(i,j))) for all (i,j).
Tpetra uses this operation to implement the ABSMAX CombineMode.
Definition at line 161 of file Tpetra_Experimental_BlockView.hpp.
1.7.6.1