#[non_exhaustive]#[repr(u32)]pub enum MatrixType {
General = 0,
Symmetric = 1,
Hermitian = 2,
Triangular = 3,
}Expand description
Describes the matrix kind stored in sparse storage. For symmetric, Hermitian, and triangular matrices, only their lower or upper part is assumed to be stored.
Matrix type and fill mode minimize storage for symmetric or Hermitian matrices and let SpMV operations use symmetry when useful.
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.
Because the transpose operation y=L^T*x is much slower than the non-transpose version y=L*x, the symmetric property does not always improve performance.
It is usually more efficient to expand the symmetric matrix to a general matrix and
apply y=A*x with matrix type MatrixType::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 applications use general matrices instead of symmetric matrices, preconditioners
only need to support general matrices.
Therefore the newer \[bsr|csr\]sv2 (triangular solver), \[bsr|csr\]ilu02 (incomplete LU), and \[bsr|csr\]ic02 (incomplete Cholesky) operations only support matrix type MatrixType::General.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
General = 0
The matrix is general.
Symmetric = 1
The matrix is symmetric.
Hermitian = 2
The matrix is Hermitian.
Triangular = 3
The matrix is triangular.
Trait Implementations§
Source§impl Clone for MatrixType
impl Clone for MatrixType
Source§fn clone(&self) -> MatrixType
fn clone(&self) -> MatrixType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MatrixType
Source§impl Debug for MatrixType
impl Debug for MatrixType
Source§impl Display for MatrixType
impl Display for MatrixType
impl Eq for MatrixType
Source§impl From<MatrixType> for u32
impl From<MatrixType> for u32
Source§fn from(enum_value: MatrixType) -> Self
fn from(enum_value: MatrixType) -> Self
Source§impl From<MatrixType> for cusparseMatrixType_t
impl From<MatrixType> for cusparseMatrixType_t
Source§fn from(value: MatrixType) -> Self
fn from(value: MatrixType) -> Self
Source§impl From<cusparseMatrixType_t> for MatrixType
impl From<cusparseMatrixType_t> for MatrixType
Source§fn from(value: cusparseMatrixType_t) -> Self
fn from(value: cusparseMatrixType_t) -> Self
Source§impl Hash for MatrixType
impl Hash for MatrixType
Source§impl PartialEq for MatrixType
impl PartialEq for MatrixType
Source§fn eq(&self, other: &MatrixType) -> bool
fn eq(&self, other: &MatrixType) -> bool
self and other values to be equal, and is used by ==.