Template Numerical Library version\ main:58f2aa3f5
|
RowView is a simple structure for accessing rows of Lambda matrix. More...
#include <TNL/Matrices/LambdaMatrixRowView.h>
Public Types | |
using | CompressedRowLengthsLambdaType = CompressedRowLengthsLambda |
Type of the lambda function returning the number of non-zero elements in each row. | |
using | ConstRowView = RowView |
Type of constant Lambda matrix row view. | |
using | IndexType = Index |
The type used for matrix elements indexing. | |
using | IteratorType = LambdaMatrixRowViewIterator< RowView > |
Type of iterator for the matrix row. | |
using | MatrixElementsLambdaType = MatrixElementsLambda |
Type of the lambda function returning the matrix elements. | |
using | MatrixElementType = LambdaMatrixElement< RealType, IndexType > |
The type of related matrix element. | |
using | RealType = Real |
The type of matrix elements. | |
using | RowView = LambdaMatrixRowView< MatrixElementsLambdaType, CompressedRowLengthsLambdaType, RealType, IndexType > |
Type of Lambda matrix row view. | |
Public Member Functions | |
__cuda_callable__ | LambdaMatrixRowView (const MatrixElementsLambdaType &matrixElementsLambda, const CompressedRowLengthsLambdaType &compressedRowLengthsLambda, const IndexType &rows, const IndexType &columns, const IndexType &rowIdx) |
Constructor with related lambda functions, matrix dimensions and row index. | |
__cuda_callable__ IteratorType | begin () const |
Returns non-constant iterator pointing at the beginning of the matrix row. | |
__cuda_callable__ IteratorType | cbegin () const |
Returns constant iterator pointing at the beginning of the matrix row. | |
__cuda_callable__ IteratorType | cend () const |
Returns constant iterator pointing at the end of the matrix row. | |
__cuda_callable__ IteratorType | end () const |
Returns non-constant iterator pointing at the end of the matrix row. | |
__cuda_callable__ IndexType | getColumnIndex (IndexType localIdx) const |
Returns constants reference to a column index of an element with given rank in the row. | |
__cuda_callable__ const IndexType & | getRowIndex () const |
Returns the matrix row index. | |
__cuda_callable__ IndexType | getSize () const |
Returns size of the matrix row, i.e. number of matrix elements in this row. | |
__cuda_callable__ RealType | getValue (IndexType localIdx) const |
Returns constants reference to value of an element with given rank in the row. | |
template<typename MatrixElementsLambda_, typename CompressedRowLengthsLambda_, typename Real_, typename Index_> | |
__cuda_callable__ bool | operator== (const LambdaMatrixRowView< MatrixElementsLambda_, CompressedRowLengthsLambda_, Real_, Index_ > &other) const |
Comparison of two matrix rows. | |
Protected Attributes | |
IndexType | columns |
const CompressedRowLengthsLambda & | compressedRowLengthsLambda |
const MatrixElementsLambda & | matrixElementsLambda |
IndexType | rowIdx |
IndexType | rows |
RowView is a simple structure for accessing rows of Lambda matrix.
MatrixElementsLambda | is a lambda function returning matrix elements values and positions. |
It has the following form:
where rows is the number of matrix rows, columns is the number of matrix columns, rowIdx is the index of matrix row being queried, localIdx is the rank of the non-zero element in given row, columnIdx is a column index of the matrix element computed by this lambda and value is a value of the matrix element computed by this lambda.
CompressedRowLengthsLambda | is a lambda function returning a number of non-zero elements in each row. |
It has the following form:
where rows is the number of matrix rows, columns is the number of matrix columns and rowIdx is an index of the row being queried.
Real | is a type of matrix elements values. |
Index | is a type to be used for indexing. |
__cuda_callable__ TNL::Matrices::LambdaMatrixRowView< MatrixElementsLambda, CompressedRowLengthsLambda, Real, Index >::LambdaMatrixRowView | ( | const MatrixElementsLambdaType & | matrixElementsLambda, |
const CompressedRowLengthsLambdaType & | compressedRowLengthsLambda, | ||
const IndexType & | rows, | ||
const IndexType & | columns, | ||
const IndexType & | rowIdx ) |
Constructor with related lambda functions, matrix dimensions and row index.
matrixElementsLambda | is a constant reference to the lambda function evaluating matrix elements. |
compressedRowLengthsLambda | is a constant reference to the lambda function returning the number of nonzero elements in each row. |
rows | is number of matrix rows. |
columns | is number of matrix columns. |
rowIdx | is the matrix row index. |
|
nodiscard |
Returns non-constant iterator pointing at the beginning of the matrix row.
|
nodiscard |
Returns constant iterator pointing at the beginning of the matrix row.
|
nodiscard |
Returns constant iterator pointing at the end of the matrix row.
|
nodiscard |
Returns non-constant iterator pointing at the end of the matrix row.
|
nodiscard |
Returns constants reference to a column index of an element with given rank in the row.
localIdx | is the rank of the non-zero element in given row. |
|
nodiscard |
Returns the matrix row index.
|
nodiscard |
Returns size of the matrix row, i.e. number of matrix elements in this row.
|
nodiscard |
Returns constants reference to value of an element with given rank in the row.
localIdx | is the rank of the non-zero element in given row. |
|
nodiscard |
Comparison of two matrix rows.
The other matrix row can be from any other matrix.
other | is another matrix row. |