Trait SymSparseArray

Source
pub trait SymSparseArray<T>: SparseArray<T>
where T: Float + Debug + Copy + 'static,
{ // Required methods fn nnz_stored(&self) -> usize; fn to_csr(&self) -> SparseResult<CsrArray<T>>; fn to_coo(&self) -> SparseResult<CooArray<T>>; fn to_sym_csr(&self) -> SparseResult<SymCsrArray<T>>; fn to_sym_coo(&self) -> SparseResult<SymCooArray<T>>; // Provided method fn is_symmetric(&self) -> bool { ... } }
Expand description

Trait for symmetric sparse arrays

Extends the base SparseArray trait with methods specific to symmetric matrices. Implementations guarantee that the matrix is kept symmetric throughout all operations.

Required Methods§

Source

fn nnz_stored(&self) -> usize

Get the number of stored non-zero elements

For symmetric formats, this returns the number of elements actually stored (typically lower or upper triangular part).

§Returns

Number of stored non-zero elements

Source

fn to_csr(&self) -> SparseResult<CsrArray<T>>

Convert to standard CSR array

§Returns

A standard CSR array with the full symmetric matrix

Source

fn to_coo(&self) -> SparseResult<CooArray<T>>

Convert to standard COO array

§Returns

A standard COO array with the full symmetric matrix

Source

fn to_sym_csr(&self) -> SparseResult<SymCsrArray<T>>

Convert to symmetric CSR array

§Returns

A symmetric CSR array

Source

fn to_sym_coo(&self) -> SparseResult<SymCooArray<T>>

Convert to symmetric COO array

§Returns

A symmetric COO array

Provided Methods§

Source

fn is_symmetric(&self) -> bool

Check if the matrix is guaranteed to be symmetric

For implementations of this trait, this should always return true. It’s included for consistency with checking functions.

§Returns

Always true for SymSparseArray implementations

Implementors§

Source§

impl<T> SymSparseArray<T> for SymCooArray<T>
where T: Float + Debug + Copy + 'static + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T>,

Implementation of SymSparseArray for SymCooArray

Source§

impl<T> SymSparseArray<T> for SymCsrArray<T>
where T: Float + Debug + Copy + 'static + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T>,

Implementation of SymSparseArray for SymCsrArray