Skip to main content

MatrixType

Enum MatrixType 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source§

fn clone(&self) -> MatrixType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MatrixType

Source§

impl Debug for MatrixType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for MatrixType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for MatrixType

Source§

impl From<MatrixType> for u32

Source§

fn from(enum_value: MatrixType) -> Self

Converts to this type from the input type.
Source§

impl From<MatrixType> for cusparseMatrixType_t

Source§

fn from(value: MatrixType) -> Self

Converts to this type from the input type.
Source§

impl From<cusparseMatrixType_t> for MatrixType

Source§

fn from(value: cusparseMatrixType_t) -> Self

Converts to this type from the input type.
Source§

impl Hash for MatrixType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MatrixType

Source§

fn eq(&self, other: &MatrixType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MatrixType

Source§

impl TryFrom<u32> for MatrixType

Source§

type Error = TryFromPrimitiveError<MatrixType>

The type returned in the event of a conversion error.
Source§

fn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
Source§

impl TryFromPrimitive for MatrixType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.