NeoN
A framework for CFD software
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
NeoN::la::MatrixView< ValueType, SparsityViewType > Struct Template Reference

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

#include <matrix.hpp>

Public Member Functions

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

Public Attributes

View< ValueType > values
 View to the values of the CSR matrix.
 
SparsityViewType sparsity
 

Detailed Description

template<typename ValueType, typename SparsityViewType>
struct NeoN::la::MatrixView< ValueType, SparsityViewType >

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

Template Parameters
ValueTypeThe value type of the non-zero entries.
SparsityViewTypeThe type of the sparsity pattern, eg COO or CSR.

Definition at line 23 of file matrix.hpp.

Constructor & Destructor Documentation

◆ MatrixView()

template<typename ValueType , typename SparsityViewType >
NeoN::la::MatrixView< ValueType, SparsityViewType >::MatrixView ( const View< ValueType >  valueView,
SparsityViewType  sparsityView 
)
inline

Constructor for MatrixView.

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 31 of file matrix.hpp.

◆ ~MatrixView()

template<typename ValueType , typename SparsityViewType >
NeoN::la::MatrixView< ValueType, SparsityViewType >::~MatrixView ( )
default

Default destructor.

Member Function Documentation

◆ entry() [1/2]

template<typename ValueType , typename SparsityViewType >
KOKKOS_INLINE_FUNCTION ValueType & NeoN::la::MatrixView< ValueType, SparsityViewType >::entry ( const localIdx  i,
const localIdx  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 46 of file matrix.hpp.

◆ entry() [2/2]

template<typename ValueType , typename SparsityViewType >
KOKKOS_INLINE_FUNCTION ValueType & NeoN::la::MatrixView< ValueType, SparsityViewType >::entry ( const localIdx  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 57 of file matrix.hpp.

Member Data Documentation

◆ sparsity

template<typename ValueType , typename SparsityViewType >
SparsityViewType NeoN::la::MatrixView< ValueType, SparsityViewType >::sparsity

Definition at line 60 of file matrix.hpp.

◆ values

template<typename ValueType , typename SparsityViewType >
View<ValueType> NeoN::la::MatrixView< ValueType, SparsityViewType >::values

View to the values of the CSR matrix.

Definition at line 59 of file matrix.hpp.


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