Template Numerical Library version\ main:94209208
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
TNL::Matrices::SparseMatrixElement< Real, Index > Class Template Reference

Accessor for sparse matrix elements. More...

#include <TNL/Matrices/SparseMatrixElement.h>

Collaboration diagram for TNL::Matrices::SparseMatrixElement< Real, Index >:
Collaboration graph
[legend]

Public Types

using IndexType = Index
 Type of matrix elements column indexes.
 
using RealType = Real
 Type of matrix elements values.
 

Public Member Functions

__cuda_callable__ SparseMatrixElement (RealType &value, IndexType rowIdx, IndexType &columnIdx, IndexType localIdx)
 Constructor.
 
__cuda_callable__ IndexTypecolumnIndex ()
 Returns reference on matrix element column index.
 
__cuda_callable__ const IndexTypecolumnIndex () const
 Returns constant reference on matrix element column index.
 
__cuda_callable__ const IndexTypelocalIndex () const
 Returns constant reference on the rank of the non-zero matrix element in the row.
 
__cuda_callable__ const IndexTyperowIndex () const
 Returns constant reference on matrix element column index.
 
__cuda_callable__ RealTypevalue ()
 Returns reference on matrix element value.
 
__cuda_callable__ const RealTypevalue () const
 Returns constant reference on matrix element value.
 

Static Public Member Functions

static constexpr bool isBinary ()
 Test of binary matrix type.
 

Protected Attributes

IndexTypecolumnIdx
 
IndexType localIdx
 
IndexType rowIdx
 
RealTypevalue_
 

Detailed Description

template<typename Real, typename Index>
class TNL::Matrices::SparseMatrixElement< Real, Index >

Accessor for sparse matrix elements.

Template Parameters
Realis a type of matrix elements values.
Indexis a type of matrix elements column indexes.

Constructor & Destructor Documentation

◆ SparseMatrixElement()

template<typename Real , typename Index >
__cuda_callable__ TNL::Matrices::SparseMatrixElement< Real, Index >::SparseMatrixElement ( RealType & value,
IndexType rowIdx,
IndexType & columnIdx,
IndexType localIdx )
inline

Constructor.

Parameters
valueis matrix element value.
rowIdxis row index of the matrix element.
columnIdxis a column index of the matrix element.
localIdxis the rank of the non-zero elements in the matrix row.

Member Function Documentation

◆ columnIndex() [1/2]

template<typename Real , typename Index >
__cuda_callable__ IndexType & TNL::Matrices::SparseMatrixElement< Real, Index >::columnIndex ( )
inline

Returns reference on matrix element column index.

Returns
reference on matrix element column index.

◆ columnIndex() [2/2]

template<typename Real , typename Index >
__cuda_callable__ const IndexType & TNL::Matrices::SparseMatrixElement< Real, Index >::columnIndex ( ) const
inline

Returns constant reference on matrix element column index.

Returns
constant reference on matrix element column index.

◆ isBinary()

template<typename Real , typename Index >
static constexpr bool TNL::Matrices::SparseMatrixElement< Real, Index >::isBinary ( )
inlinestaticconstexpr

Test of binary matrix type.

Returns
true if the matrix is stored as binary and false otherwise.

◆ localIndex()

template<typename Real , typename Index >
__cuda_callable__ const IndexType & TNL::Matrices::SparseMatrixElement< Real, Index >::localIndex ( ) const
inline

Returns constant reference on the rank of the non-zero matrix element in the row.

Returns
constant reference on the rank of the non-zero matrix element in the row.

◆ rowIndex()

template<typename Real , typename Index >
__cuda_callable__ const IndexType & TNL::Matrices::SparseMatrixElement< Real, Index >::rowIndex ( ) const
inline

Returns constant reference on matrix element column index.

Returns
constant reference on matrix element column index.

◆ value() [1/2]

template<typename Real , typename Index >
__cuda_callable__ RealType & TNL::Matrices::SparseMatrixElement< Real, Index >::value ( )
inline

Returns reference on matrix element value.

Returns
reference on matrix element value.

◆ value() [2/2]

template<typename Real , typename Index >
__cuda_callable__ const RealType & TNL::Matrices::SparseMatrixElement< Real, Index >::value ( ) const
inline

Returns constant reference on matrix element value.

Returns
constant reference on matrix element value.

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