XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Attributes | List of all members
Matrix< Device > Class Template Reference

#include <matrix.hpp>

Public Member Functions

 Matrix ()
 
 Matrix (int m_in, int n_in, int w_in)
 
 Matrix (int m_in, int n_in, int w_in, int nnz_in, bool is_csr_in, int *csr_ridx_or_eindex, int *csr_cidx_or_nelement, double *values)
 
void mult_org (const Kokkos::View< double *, Kokkos::LayoutRight, Device > &x, const Kokkos::View< double *, Kokkos::LayoutRight, Device > &y) const
 
void mult_csr (const Kokkos::View< double *, Kokkos::LayoutRight, Device > &x, const Kokkos::View< double *, Kokkos::LayoutRight, Device > &y) const
 
void mult_tensor_org (const Kokkos::View< double **, Kokkos::LayoutRight, Device > &x, const Kokkos::View< double **, Kokkos::LayoutRight, Device > &y) const
 
void mult_tensor_csr (const Kokkos::View< double **, Kokkos::LayoutRight, Device > &x, const Kokkos::View< double **, Kokkos::LayoutRight, Device > &y) const
 
void mult (const Kokkos::View< double *, Kokkos::LayoutRight, Device > &x, const Kokkos::View< double *, Kokkos::LayoutRight, Device > &y) const
 
void mult_tensor (const Kokkos::View< double **, Kokkos::LayoutRight, Device > &x, const Kokkos::View< double **, Kokkos::LayoutRight, Device > &y) const
 

Private Types

enum  SetValueOpt { Replace =0, Add =1 }
 
using exspace = typename Device::execution_space
 Use execution space where matrix views are allocated. More...
 

Private Attributes

int m
 

of rows (size of each column)

More...
 
int n
 

of columns (size of each row)

More...
 
int width
 
Kokkos::View< double
**, Kokkos::LayoutRight,
Device > 
value
 matrix value More...
 
Kokkos::View< int
**, Kokkos::LayoutRight,
Device > 
eindex
 column index - 1-indexed!! More...
 
Kokkos::View< int
*, Kokkos::LayoutRight, Device > 
nelement
 

of non-zero element of each row

More...
 
bool is_csr
 Whether the matrix is in CSR format. More...
 
int nnz
 if in CSR format, number of (nonzero) values More...
 
Kokkos::View< int
*, Kokkos::LayoutRight, Device > 
csr_ridx
 row index for CSR - m+1 More...
 
Kokkos::View< double
*, Kokkos::LayoutRight, Device > 
csr_v
 value of CSR - nnz More...
 
Kokkos::View< int
*, Kokkos::LayoutRight, Device > 
csr_cidx
 columun index - nnz More...
 

Member Typedef Documentation

template<class Device>
using Matrix< Device >::exspace = typename Device::execution_space
private

Use execution space where matrix views are allocated.

Member Enumeration Documentation

template<class Device>
enum Matrix::SetValueOpt
private
Enumerator
Replace 
Add 

Constructor & Destructor Documentation

template<class Device>
Matrix< Device >::Matrix ( )
inline
template<class Device>
Matrix< Device >::Matrix ( int  m_in,
int  n_in,
int  w_in 
)
inline

Constructor that allocates the original format

Parameters
[in]m_inis the # of rows
[in]n_inis the # of columns
[in]w_inis the width you think you will need (youll get an error later if its too small)
template<class Device>
Matrix< Device >::Matrix ( int  m_in,
int  n_in,
int  w_in,
int  nnz_in,
bool  is_csr_in,
int *  csr_ridx_or_eindex,
int *  csr_cidx_or_nelement,
double *  values 
)
inline

Constructor that deep copies the matrix from pointers (to copy from Fortran mat_type)

Parameters
[in]m_inis the # of rows
[in]n_inis the # of columns
[in]w_inis the width you think you will need (youll get an error later if its too small)
[in]nnz_inis the number of nonzero entries
[in]is_csr_inis whether the matrix is in CSR format
[in]csr_ridx_or_eindexpoints to csr_ridx if in CSR, otherwise to eindex
[in]csr_cidx_or_nelementpoints to csr_cidx if in CSR, otherwise to nelement
[in]valuesis the pointer to the matrix entries

Member Function Documentation

template<class Device>
void Matrix< Device >::mult ( const Kokkos::View< double *, Kokkos::LayoutRight, Device > &  x,
const Kokkos::View< double *, Kokkos::LayoutRight, Device > &  y 
) const
inline

Matrix multiplication of the form: y = Ax. Dispatch for the two matrix formats

Parameters
[in]xis the input vector
[out]yis the result
Returns
void

Here is the caller graph for this function:

template<class Device>
void Matrix< Device >::mult_csr ( const Kokkos::View< double *, Kokkos::LayoutRight, Device > &  x,
const Kokkos::View< double *, Kokkos::LayoutRight, Device > &  y 
) const
inline

Matrix multiplication of the form: y = Ax. Matrix is in CSR format.

Parameters
[in]xis the input vector
[out]yis the result
Returns
void

Here is the caller graph for this function:

template<class Device>
void Matrix< Device >::mult_org ( const Kokkos::View< double *, Kokkos::LayoutRight, Device > &  x,
const Kokkos::View< double *, Kokkos::LayoutRight, Device > &  y 
) const
inline

Matrix multiplication of the form: y = Ax. Matrix is in original data format.

Parameters
[in]xis the input vector
[out]yis the result
Returns
void

Here is the caller graph for this function:

template<class Device>
void Matrix< Device >::mult_tensor ( const Kokkos::View< double **, Kokkos::LayoutRight, Device > &  x,
const Kokkos::View< double **, Kokkos::LayoutRight, Device > &  y 
) const
inline

Matrix multiplication using the transpose, i.e.: y = A^T x. Dispatch for the two matrix formats

Parameters
[in]xis the input vector
[out]yis the result
Returns
void Matrix multiplication of tensor of the form: y = Ax. Dispatch for the two matrix formats
Parameters
[in]xis the input tensor
[out]yis the result
Returns
void
template<class Device>
void Matrix< Device >::mult_tensor_csr ( const Kokkos::View< double **, Kokkos::LayoutRight, Device > &  x,
const Kokkos::View< double **, Kokkos::LayoutRight, Device > &  y 
) const
inline

Matrix multiplication of tensor of the form: y = Ax. Matrix is in CSR format.

Parameters
[in]xis the input tensor
[in]yis the result
Returns
void

Here is the caller graph for this function:

template<class Device>
void Matrix< Device >::mult_tensor_org ( const Kokkos::View< double **, Kokkos::LayoutRight, Device > &  x,
const Kokkos::View< double **, Kokkos::LayoutRight, Device > &  y 
) const
inline

Matrix multiplication of tensor of the form: y = Ax. Matrix is in original data format.

Parameters
[in]xis the input tensor
[in]yis the result
Returns
void

Here is the caller graph for this function:

Member Data Documentation

template<class Device>
Kokkos::View<int*,Kokkos::LayoutRight, Device> Matrix< Device >::csr_cidx
private

columun index - nnz

template<class Device>
Kokkos::View<int*,Kokkos::LayoutRight, Device> Matrix< Device >::csr_ridx
private

row index for CSR - m+1

template<class Device>
Kokkos::View<double*,Kokkos::LayoutRight, Device> Matrix< Device >::csr_v
private

value of CSR - nnz

template<class Device>
Kokkos::View<int**,Kokkos::LayoutRight, Device> Matrix< Device >::eindex
private

column index - 1-indexed!!

template<class Device>
bool Matrix< Device >::is_csr
private

Whether the matrix is in CSR format.

template<class Device>
int Matrix< Device >::m
private

of rows (size of each column)

template<class Device>
int Matrix< Device >::n
private

of columns (size of each row)

template<class Device>
Kokkos::View<int*,Kokkos::LayoutRight, Device> Matrix< Device >::nelement
private

of non-zero element of each row

template<class Device>
int Matrix< Device >::nnz
private

if in CSR format, number of (nonzero) values

template<class Device>
Kokkos::View<double**,Kokkos::LayoutRight, Device> Matrix< Device >::value
private

matrix value

template<class Device>
int Matrix< Device >::width
private

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