NeoN
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
NeoN::la::CSRMatrixView< ValueType, IndexType > Struct Template Reference

A view struct to allow easy read/write on all executors. More...

#include <CSRMatrix.hpp>

Public Member Functions

 CSRMatrixView (const View< ValueType > &valueView, const View< IndexType > &colIdxsView, const View< IndexType > &rowOffsView)
 Constructor for CSRMatrixView.
 
 ~CSRMatrixView ()=default
 Default destructor.
 
KOKKOS_INLINE_FUNCTION ValueType & entry (const IndexType i, const IndexType j) const
 Retrieve a reference to the matrix element at position (i,j).
 
KOKKOS_INLINE_FUNCTION ValueType & entry (const IndexType offset) const
 Direct access to a value given the offset.
 

Public Attributes

View< ValueType > values
 View to the values of the CSR matrix.
 
View< IndexType > colIdxs
 View to the column indices of the CSR matrix.
 
View< IndexType > rowOffs
 View to the row offsets for the CSR matrix.
 

Detailed Description

template<typename ValueType, typename IndexType>
struct NeoN::la::CSRMatrixView< ValueType, IndexType >

A view struct to allow easy read/write on all executors.

Template Parameters
ValueTypeThe value type of the non-zero entries.
IndexTypeThe index type of the rows and columns.

Definition at line 20 of file CSRMatrix.hpp.

Constructor & Destructor Documentation

◆ CSRMatrixView()

template<typename ValueType , typename IndexType >
NeoN::la::CSRMatrixView< ValueType, IndexType >::CSRMatrixView ( const View< ValueType > &  valueView,
const View< IndexType > &  colIdxsView,
const View< IndexType > &  rowOffsView 
)
inline

Constructor for CSRMatrixView.

Parameters
valueViewView of the non-zero values of the matrix.
colIdxsViewView of the column indices for each non-zero value.
rowOffsViewView of the starting index in values/colIdxs for each row.

Definition at line 28 of file CSRMatrix.hpp.

◆ ~CSRMatrixView()

template<typename ValueType , typename IndexType >
NeoN::la::CSRMatrixView< ValueType, IndexType >::~CSRMatrixView ( )
default

Default destructor.

Member Function Documentation

◆ entry() [1/2]

template<typename ValueType , typename IndexType >
KOKKOS_INLINE_FUNCTION ValueType & NeoN::la::CSRMatrixView< ValueType, IndexType >::entry ( const IndexType  i,
const IndexType  j 
) const
inline

Retrieve a reference to the matrix element at position (i,j).

Parameters
iThe row index.
jThe column index.
Returns
Reference to the matrix element if it exists.

Definition at line 47 of file CSRMatrix.hpp.

◆ entry() [2/2]

template<typename ValueType , typename IndexType >
KOKKOS_INLINE_FUNCTION ValueType & NeoN::la::CSRMatrixView< ValueType, IndexType >::entry ( const IndexType  offset) const
inline

Direct access to a value given the offset.

Parameters
offsetThe offset, from 0, to the value.
Returns
Reference to the matrix element if it exists.

Definition at line 69 of file CSRMatrix.hpp.

Member Data Documentation

◆ colIdxs

template<typename ValueType , typename IndexType >
View<IndexType> NeoN::la::CSRMatrixView< ValueType, IndexType >::colIdxs

View to the column indices of the CSR matrix.

Definition at line 72 of file CSRMatrix.hpp.

◆ rowOffs

template<typename ValueType , typename IndexType >
View<IndexType> NeoN::la::CSRMatrixView< ValueType, IndexType >::rowOffs

View to the row offsets for the CSR matrix.

Definition at line 73 of file CSRMatrix.hpp.

◆ values

template<typename ValueType , typename IndexType >
View<ValueType> NeoN::la::CSRMatrixView< ValueType, IndexType >::values

View to the values of the CSR matrix.

Definition at line 71 of file CSRMatrix.hpp.


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