Template Numerical Library version\ main:bb09b17
Loading...
Searching...
No Matches
TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ > Class Template Reference

RowView is a simple structure for accessing rows of sparse matrix. More...

#include <TNL/Matrices/Sandbox/SparseSandboxMatrixRowView.h>

Public Types

using ColumnsIndexesViewType = ColumnsIndexesView
 Type of container view used for storing the column indexes of the matrix elements.
 
using ConstColumnsIndexesViewType = typename ColumnsIndexesViewType::ConstViewType
 Type of constant container view used for storing the column indexes of the matrix elements.
 
using ConstRowView = SparseSandboxMatrixRowView< ConstValuesViewType, ConstColumnsIndexesViewType, isBinary_ >
 Type of constant sparse matrix row view.
 
using ConstValuesViewType = typename ValuesViewType::ConstViewType
 Type of constant container view used for storing the matrix elements values.
 
using IndexType = typename ColumnsIndexesView::IndexType
 The type used for matrix elements indexing.
 
using IteratorType = MatrixRowViewIterator< RowView >
 Type of iterator for the matrix row.
 
using MatrixElementType = SparseMatrixElement< RealType, IndexType >
 The type of related matrix element.
 
using RealType = typename ValuesView::RealType
 The type of matrix elements.
 
using RowView = SparseSandboxMatrixRowView< ValuesViewType, ColumnsIndexesViewType, isBinary_ >
 Type of sparse matrix row view.
 
using ValuesViewType = ValuesView
 Type of container view used for storing the matrix elements values.
 

Public Member Functions

__cuda_callable__ SparseSandboxMatrixRowView (IndexType rowIdx, IndexType offset, IndexType size, const ValuesViewType &values, const ColumnsIndexesViewType &columnIndexes)
 Constructor with segmentView, values and columnIndexes.
 
__cuda_callable__ IteratorType begin ()
 Returns iterator pointing at the beginning of the matrix row.
 
__cuda_callable__ const IteratorType cbegin () const
 Returns constant iterator pointing at the beginning of the matrix row.
 
__cuda_callable__ const IteratorType cend () const
 Returns constant iterator pointing at the end of the matrix row.
 
__cuda_callable__ IteratorType end ()
 Returns iterator pointing at the end of the matrix row.
 
__cuda_callable__ IndexTypegetColumnIndex (IndexType localIdx)
 Returns non-constants reference to a column index of an element with given rank in the row.
 
__cuda_callable__ const IndexTypegetColumnIndex (IndexType localIdx) const
 Returns constants reference to a column index of an element with given rank in the row.
 
__cuda_callable__ const IndexTypegetRowIndex () 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__ RealTypegetValue (IndexType localIdx)
 Returns non-constants reference to value of an element with given rank in the row.
 
__cuda_callable__ const RealTypegetValue (IndexType localIdx) const
 Returns constants reference to value of an element with given rank in the row.
 
template<typename _ValuesView , typename _ColumnsIndexesView , bool _isBinary>
__cuda_callable__ bool operator== (const SparseSandboxMatrixRowView< _ValuesView, _ColumnsIndexesView, _isBinary > &other) const
 Comparison of two matrix rows.
 
__cuda_callable__ void setColumnIndex (IndexType localIdx, const IndexType &columnIndex)
 Sets a column index of matrix element with given rank in the matrix row.
 
__cuda_callable__ void setElement (IndexType localIdx, IndexType columnIndex, const RealType &value)
 Sets both a value and a column index of matrix element with given rank in the matrix row.
 
__cuda_callable__ void setValue (IndexType localIdx, const RealType &value)
 Sets a value of matrix element with given rank in the matrix row.
 

Static Public Member Functions

static constexpr bool isBinary ()
 Tells whether the parent matrix is a binary matrix.
 

Protected Attributes

ColumnsIndexesViewType columnIndexes
 
IndexType offset
 
IndexType rowIdx
 
IndexType size
 
ValuesViewType values
 

Detailed Description

template<typename ValuesView, typename ColumnsIndexesView, bool isBinary_>
class TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >

RowView is a simple structure for accessing rows of sparse matrix.

Template Parameters
ValuesViewis a vector view storing the matrix elements values.
ColumnsIndexesViewis a vector view storing the column indexes of the matrix element.
isBinarytells if the the parent matrix is a binary matrix.

See SparseSandboxMatrix and SparseSandboxMatrixView.

Constructor & Destructor Documentation

◆ SparseSandboxMatrixRowView()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::SparseSandboxMatrixRowView ( IndexType rowIdx,
IndexType offset,
IndexType size,
const ValuesViewType & values,
const ColumnsIndexesViewType & columnIndexes )

Constructor with segmentView, values and columnIndexes.

Parameters
rowIdxis row index.
offsetis the begining of the matrix row in arrays with values and column indexes of matrix elements.
sizeis row size, i.e. number of nonzero matrix elements in the row.
valuesis a container view for storing the matrix elements values.
columnIndexesis a container view for storing the column indexes of the matrix elements.

Member Function Documentation

◆ begin()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ auto TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::begin ( )
nodiscard

Returns iterator pointing at the beginning of the matrix row.

Returns
iterator pointing at the beginning.

◆ cbegin()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ auto TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::cbegin ( ) const
nodiscard

Returns constant iterator pointing at the beginning of the matrix row.

Returns
iterator pointing at the beginning.

◆ cend()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ auto TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::cend ( ) const
nodiscard

Returns constant iterator pointing at the end of the matrix row.

Returns
iterator pointing at the end.

◆ end()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ auto TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::end ( )
nodiscard

Returns iterator pointing at the end of the matrix row.

Returns
iterator pointing at the end.

◆ getColumnIndex() [1/2]

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ auto TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::getColumnIndex ( IndexType localIdx)
nodiscard

Returns non-constants reference to a column index of an element with given rank in the row.

Parameters
localIdxis the rank of the non-zero element in given row.
Returns
non-constant reference to the matrix element column index.

◆ getColumnIndex() [2/2]

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ auto TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::getColumnIndex ( IndexType localIdx) const
nodiscard

Returns constants reference to a column index of an element with given rank in the row.

Parameters
localIdxis the rank of the non-zero element in given row.
Returns
constant reference to the matrix element column index.

◆ getRowIndex()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ auto TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::getRowIndex ( ) const
nodiscard

Returns the matrix row index.

Returns
matrix row index.

◆ getSize()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ auto TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::getSize ( ) const
nodiscard

Returns size of the matrix row, i.e. number of matrix elements in this row.

Returns
Size of the matrix row.

◆ getValue() [1/2]

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ auto TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::getValue ( IndexType localIdx)
nodiscard

Returns non-constants reference to value of an element with given rank in the row.

Parameters
localIdxis the rank of the non-zero element in given row.
Returns
non-constant reference to the matrix element value.

◆ getValue() [2/2]

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ auto TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::getValue ( IndexType localIdx) const
nodiscard

Returns constants reference to value of an element with given rank in the row.

Parameters
localIdxis the rank of the non-zero element in given row.
Returns
constant reference to the matrix element value.

◆ isBinary()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
static constexpr bool TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::isBinary ( )
inlinestaticconstexpr

Tells whether the parent matrix is a binary matrix.

Returns
true if the matrix is binary.

◆ operator==()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
template<typename _ValuesView , typename _ColumnsIndexesView , bool _isBinary>
__cuda_callable__ bool TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::operator== ( const SparseSandboxMatrixRowView< _ValuesView, _ColumnsIndexesView, _isBinary > & other) const
nodiscard

Comparison of two matrix rows.

The other matrix row can be from any other matrix.

Parameters
otheris another matrix row.
Returns
true if both rows are the same, false otherwise.

◆ setColumnIndex()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ void TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::setColumnIndex ( IndexType localIdx,
const IndexType & columnIndex )

Sets a column index of matrix element with given rank in the matrix row.

Parameters
localIdxis the rank of the matrix element in the row.
columnIndexis the new column index of the matrix element.

◆ setElement()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ void TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::setElement ( IndexType localIdx,
IndexType columnIndex,
const RealType & value )

Sets both a value and a column index of matrix element with given rank in the matrix row.

Parameters
localIdxis the rank of the matrix element in the row.
columnIndexis the new column index of the matrix element.
valueis the new value of the matrix element.

◆ setValue()

template<typename ValuesView , typename ColumnsIndexesView , bool isBinary_>
__cuda_callable__ void TNL::Matrices::Sandbox::SparseSandboxMatrixRowView< ValuesView, ColumnsIndexesView, isBinary_ >::setValue ( IndexType localIdx,
const RealType & value )

Sets a value of matrix element with given rank in the matrix row.

Parameters
localIdxis the rank of the matrix element in the row.
valueis the new value of the matrix element.

The documentation for this class was generated from the following files: