#[repr(u32)]pub enum cusparseMatrixType_t {
CUSPARSE_MATRIX_TYPE_GENERAL = 0,
CUSPARSE_MATRIX_TYPE_SYMMETRIC = 1,
CUSPARSE_MATRIX_TYPE_HERMITIAN = 2,
CUSPARSE_MATRIX_TYPE_TRIANGULAR = 3,
}Expand description
This type indicates the type of matrix stored in sparse storage. Notice that for symmetric, Hermitian and triangular matrices only their lower or upper part is assumed to be stored.
The whole idea of matrix type and fill mode is to keep minimum storage for symmetric/Hermitian matrix, and also to take advantage of symmetric property on SpMV (Sparse Matrix Vector multiplication). To compute y=A*x when A is symmetric and only lower triangular part is stored, two steps are needed. First step is to compute y=(L+D)*x and second step is to compute y=L^T*x + y. Given the fact that the transpose operation y=L^T*x is 10x slower than non-transpose version y=L*x, the symmetric property does not show up any performance gain. It is better for the user to extend the symmetric matrix to a general matrix and apply y=A*x with matrix type cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL.
In general, SpMV, preconditioners (incomplete Cholesky or incomplete LU) and triangular solver are combined together in iterative solvers, for example PCG and GMRES. If the user always uses general matrix (instead of symmetric matrix), there is no need to support other than general matrix in preconditioners. Therefore the new routines, [bsr|csr]sv2 (triangular solver), [bsr|csr]ilu02 (incomplete LU) and [bsr|csr]ic02 (incomplete Cholesky), only support matrix type cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL.
Variants§
CUSPARSE_MATRIX_TYPE_GENERAL = 0
the matrix is general.
CUSPARSE_MATRIX_TYPE_SYMMETRIC = 1
the matrix is symmetric.
CUSPARSE_MATRIX_TYPE_HERMITIAN = 2
the matrix is Hermitian.
CUSPARSE_MATRIX_TYPE_TRIANGULAR = 3
the matrix is triangular.
Trait Implementations§
Source§impl Clone for cusparseMatrixType_t
impl Clone for cusparseMatrixType_t
Source§fn clone(&self) -> cusparseMatrixType_t
fn clone(&self) -> cusparseMatrixType_t
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for cusparseMatrixType_t
impl Debug for cusparseMatrixType_t
Source§impl Hash for cusparseMatrixType_t
impl Hash for cusparseMatrixType_t
Source§impl Ord for cusparseMatrixType_t
impl Ord for cusparseMatrixType_t
Source§fn cmp(&self, other: &cusparseMatrixType_t) -> Ordering
fn cmp(&self, other: &cusparseMatrixType_t) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for cusparseMatrixType_t
impl PartialEq for cusparseMatrixType_t
Source§fn eq(&self, other: &cusparseMatrixType_t) -> bool
fn eq(&self, other: &cusparseMatrixType_t) -> bool
self and other values to be equal, and is used by ==.