SenK
SenK is a C++ library for high-performance linear solvers.
senk::sparse Namespace Reference

Functions related to sparse matrices and sparse vectors are defined. More...

Classes

class  SpVec
 Sparse vector class. More...
 

Functions

template<typename T >
void SpmvCsr (T *val, int *cind, int *rptr, T *x, T *y, int N)
 Perform SpMV using the CSR format. More...
 
template<typename T >
void SpmvCsr (T *val, int *cind, int *rptr, T *diag, T *x, T *y, int N)
 Perform SpMV using the CSR format, which stores diagonal elements separately. More...
 
template<typename T , int bnl, int bnw>
void SpmvBcsr (T *bval, int *bcind, int *brptr, T *x, T *y, int N)
 Perform SpMV using the BCSR format. More...
 
template<typename T >
void SpmvSell (T *val, int *cind, int *wid, int len, T *x, T *y, int N)
 Perform SpMV using the sliced-ELLPACK (SELL-c) format. More...
 
template<typename T >
void SptrsvCsr_l (T *val, int *cind, int *rptr, T *x, T *y, int N)
 Perform the sparse lower triangular solve on a matrix stored in the CSR format. More...
 
template<typename T >
void SptrsvCsr_u (T *val, int *cind, int *rptr, T *x, T *y, int N)
 Perform the sparse upper triangular solve on a matrix stored in the CSR format. More...
 
template<typename T >
void SptrsvCsr_l (T *val, int *cind, int *rptr, T *x, T *y, int N, int *cptr, int cnum)
 Perform the sparse lower triangular solve in parallel on a AMC ordered matrix stored in the CSR format. More...
 
template<typename T >
void SptrsvCsr_u (T *val, int *cind, int *rptr, T *x, T *y, int N, int *cptr, int cnum)
 Perform the sparse upper triangular solve in parallel on a AMC ordered matrix stored in the CSR format. More...
 
template<typename T >
void SptrsvCsr_l (T *val, int *cind, int *rptr, T *x, T *y, int N, int *cptr, int cnum, int bsize)
 Perform the sparse lower triangular solve in parallel on a ABMC ordered matrix stored in the CSR format. More...
 
template<typename T >
void SptrsvCsr_u (T *val, int *cind, int *rptr, T *x, T *y, int N, int *cptr, int cnum, int bsize)
 Perform the sparse upper triangular solve in parallel on a ABMC ordered matrix stored in the CSR format. More...
 
template<typename T >
void SptrsvCsr_l (T *val, int *cind, int *rptr, T *x, T *y, int N, int bnum)
 Perform the block Jacobi sparse lower triangular solve on a matrix stored in the CSR format. More...
 
template<typename T >
void SptrsvCsr_u (T *val, int *cind, int *rptr, T *x, T *y, int N, int bnum)
 Perform the block Jacobi sparse upper triangular solve on a matrix stored in the CSR format. More...
 
template<typename T , int bnl, int bnw>
void SptrsvBcsr_l (T *bval, int *bcind, int *brptr, T *x, T *y, int N)
 Perform the sparse lower triangular solve for a matrix stored in the BCSR format. More...
 
template<typename T , int bnl, int bnw>
void SptrsvBcsr_u (T *bval, int *bcind, int *brptr, T *x, T *y, int N)
 Perform the sparse upper triangular solve for a matrix stored in the CSR format. More...
 
template<typename T , int bnl, int bnw>
void SptrsvBcsr_l (T *bval, int *bcind, int *brptr, T *x, T *y, int N, int *cptr, int cnum, int bsize)
 Perform the sparse lower triangular solve for a ABMC reordered matrix stored in the BCSR format. More...
 
template<typename T , int bnl, int bnw>
void SptrsvBcsr_u (T *bval, int *bcind, int *brptr, T *x, T *y, int N, int *cptr, int cnum, int bsize)
 Perform the sparse upper triangular solve for a ABMC reordered matrix stored in the CSR format. More...
 

Detailed Description

Functions related to sparse matrices and sparse vectors are defined.

Function Documentation

◆ SpmvBcsr()

template<typename T , int bnl, int bnw>
void senk::sparse::SpmvBcsr ( T *  bval,
int *  bcind,
int *  brptr,
T *  x,
T *  y,
int  N 
)
inline

Perform SpMV using the BCSR format.

Template Parameters
TThe Type of the matrix and the vectors.
bnlThe number of rows of the block.
bnwThe number of columns of the block.
Parameters
bvalA val array in the BCSR format.
bcindA col-index array in the BCSR format.
brptrA row-pointer array in the BCSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.

Definition at line 71 of file senk_sparse.hpp.

◆ SpmvCsr() [1/2]

template<typename T >
void senk::sparse::SpmvCsr ( T *  val,
int *  cind,
int *  rptr,
T *  diag,
T *  x,
T *  y,
int  N 
)
inline

Perform SpMV using the CSR format, which stores diagonal elements separately.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the CSR format.
cindA col-index array in the CSR format.
rptrA row-pointer array in the CSR format.
diagAn array that stores diagonal elements.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.

Definition at line 48 of file senk_sparse.hpp.

◆ SpmvCsr() [2/2]

template<typename T >
void senk::sparse::SpmvCsr ( T *  val,
int *  cind,
int *  rptr,
T *  x,
T *  y,
int  N 
)
inline

Perform SpMV using the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the CSR format.
cindA col-index array in the CSR format.
rptrA row-pointer array in the CSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.

Definition at line 26 of file senk_sparse.hpp.

◆ SpmvSell()

template<typename T >
void senk::sparse::SpmvSell ( T *  val,
int *  cind,
int *  wid,
int  len,
T *  x,
T *  y,
int  N 
)
inline

Perform SpMV using the sliced-ELLPACK (SELL-c) format.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the SELL-c format.
cindA col-index array in the SELL-c format.
widAn array that indicates the starting position of the slices.
lenThe size of the slices.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.

Definition at line 104 of file senk_sparse.hpp.

◆ SptrsvBcsr_l() [1/2]

template<typename T , int bnl, int bnw>
void senk::sparse::SptrsvBcsr_l ( T *  bval,
int *  bcind,
int *  brptr,
T *  x,
T *  y,
int  N 
)
inline

Perform the sparse lower triangular solve for a matrix stored in the BCSR format.

Template Parameters
TThe Type of the matrix and the vectors.
bnlThe number of rows of the block.
bnwThe number of columns of the block.
Parameters
bvalA val array in the BCSR format.
bcindA block col-index array in the BCSR format.
brptrA block row-pointer array in the BCSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.

Definition at line 393 of file senk_sparse.hpp.

◆ SptrsvBcsr_l() [2/2]

template<typename T , int bnl, int bnw>
void senk::sparse::SptrsvBcsr_l ( T *  bval,
int *  bcind,
int *  brptr,
T *  x,
T *  y,
int  N,
int *  cptr,
int  cnum,
int  bsize 
)
inline

Perform the sparse lower triangular solve for a ABMC reordered matrix stored in the BCSR format.

Template Parameters
TThe Type of the matrix and the vectors.
bnlThe number of rows of the block.
bnwThe number of columns of the block.
Parameters
bvalA val array in the BCSR format.
bcindA block col-index array in the BCSR format.
brptrA block row-pointer array in the BCSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.
cptrThe starting index of each color is stored.
cnumThe number of colors.
bsizeThe number of rows/columns of the blocks used in ABMC.

Definition at line 482 of file senk_sparse.hpp.

◆ SptrsvBcsr_u() [1/2]

template<typename T , int bnl, int bnw>
void senk::sparse::SptrsvBcsr_u ( T *  bval,
int *  bcind,
int *  brptr,
T *  x,
T *  y,
int  N 
)
inline

Perform the sparse upper triangular solve for a matrix stored in the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
bnlThe number of rows of the block.
bnwThe number of columns of the block.
Parameters
bvalA val array in the BCSR format.
bcindA block col-index array in the BCSR format.
brptrA block row-pointer array in the BCSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.

Definition at line 430 of file senk_sparse.hpp.

◆ SptrsvBcsr_u() [2/2]

template<typename T , int bnl, int bnw>
void senk::sparse::SptrsvBcsr_u ( T *  bval,
int *  bcind,
int *  brptr,
T *  x,
T *  y,
int  N,
int *  cptr,
int  cnum,
int  bsize 
)
inline

Perform the sparse upper triangular solve for a ABMC reordered matrix stored in the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
bnlThe number of rows of the block.
bnwThe number of columns of the block.
Parameters
bvalA val array in the BCSR format.
bcindA block col-index array in the BCSR format.
brptrA block row-pointer array in the BCSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.
cptrThe starting index of each color is stored.
cnumThe number of colors.
bsizeThe number of rows/columns of the blocks used in ABMC.

Definition at line 534 of file senk_sparse.hpp.

◆ SptrsvCsr_l() [1/4]

template<typename T >
void senk::sparse::SptrsvCsr_l ( T *  val,
int *  cind,
int *  rptr,
T *  x,
T *  y,
int  N 
)
inline

Perform the sparse lower triangular solve on a matrix stored in the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the CSR format.
cindA col-index array in the CSR format.
rptrA row-pointer array in the CSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.

Definition at line 133 of file senk_sparse.hpp.

◆ SptrsvCsr_l() [2/4]

template<typename T >
void senk::sparse::SptrsvCsr_l ( T *  val,
int *  cind,
int *  rptr,
T *  x,
T *  y,
int  N,
int *  cptr,
int  cnum 
)
inline

Perform the sparse lower triangular solve in parallel on a AMC ordered matrix stored in the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the CSR format.
cindA col-index array in the CSR format.
rptrA row-pointer array in the CSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.
cptrThe starting index of each color is stored.
cnumThe number of colors.

Definition at line 181 of file senk_sparse.hpp.

◆ SptrsvCsr_l() [3/4]

template<typename T >
void senk::sparse::SptrsvCsr_l ( T *  val,
int *  cind,
int *  rptr,
T *  x,
T *  y,
int  N,
int *  cptr,
int  cnum,
int  bsize 
)
inline

Perform the sparse lower triangular solve in parallel on a ABMC ordered matrix stored in the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the CSR format.
cindA col-index array in the CSR format.
rptrA row-pointer array in the CSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.
cptrThe starting index of each color is stored.
cnumThe number of colors.
bsizeThe number of rows/columns of the blocks used in ABMC.

Definition at line 251 of file senk_sparse.hpp.

◆ SptrsvCsr_l() [4/4]

template<typename T >
void senk::sparse::SptrsvCsr_l ( T *  val,
int *  cind,
int *  rptr,
T *  x,
T *  y,
int  N,
int  bnum 
)
inline

Perform the block Jacobi sparse lower triangular solve on a matrix stored in the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the CSR format.
cindA col-index array in the CSR format.
rptrA row-pointer array in the CSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.
bptrThe starting index of each block is stored.
bnumThe number of the blocks.

Definition at line 329 of file senk_sparse.hpp.

◆ SptrsvCsr_u() [1/4]

template<typename T >
void senk::sparse::SptrsvCsr_u ( T *  val,
int *  cind,
int *  rptr,
T *  x,
T *  y,
int  N 
)
inline

Perform the sparse upper triangular solve on a matrix stored in the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the CSR format.
cindA col-index array in the CSR format.
rptrA row-pointer array in the CSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.

Definition at line 155 of file senk_sparse.hpp.

◆ SptrsvCsr_u() [2/4]

template<typename T >
void senk::sparse::SptrsvCsr_u ( T *  val,
int *  cind,
int *  rptr,
T *  x,
T *  y,
int  N,
int *  cptr,
int  cnum 
)
inline

Perform the sparse upper triangular solve in parallel on a AMC ordered matrix stored in the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the CSR format.
cindA col-index array in the CSR format.
rptrA row-pointer array in the CSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.
cptrThe starting index of each color is stored.
cnumThe number of colors.

Definition at line 215 of file senk_sparse.hpp.

◆ SptrsvCsr_u() [3/4]

template<typename T >
void senk::sparse::SptrsvCsr_u ( T *  val,
int *  cind,
int *  rptr,
T *  x,
T *  y,
int  N,
int *  cptr,
int  cnum,
int  bsize 
)
inline

Perform the sparse upper triangular solve in parallel on a ABMC ordered matrix stored in the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the CSR format.
cindA col-index array in the CSR format.
rptrA row-pointer array in the CSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.
cptrThe starting index of each color is stored.
cnumThe number of colors.
bsizeThe number of rows/columns of the blocks used in ABMC.

Definition at line 290 of file senk_sparse.hpp.

◆ SptrsvCsr_u() [4/4]

template<typename T >
void senk::sparse::SptrsvCsr_u ( T *  val,
int *  cind,
int *  rptr,
T *  x,
T *  y,
int  N,
int  bnum 
)
inline

Perform the block Jacobi sparse upper triangular solve on a matrix stored in the CSR format.

Template Parameters
TThe Type of the matrix and the vectors.
Parameters
valA val array in the CSR format.
cindA col-index array in the CSR format.
rptrA row-pointer array in the CSR format.
xInput vector of size N.
yOutput vector of size N.
NThe size of vectors.
bptrThe starting index of each block is stored.
bnumThe number of the blocks.

Definition at line 360 of file senk_sparse.hpp.