pub trait SymSparseArray<T>: SparseArray<T>{
// 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§
Sourcefn nnz_stored(&self) -> usize
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
Sourcefn to_csr(&self) -> SparseResult<CsrArray<T>>
fn to_csr(&self) -> SparseResult<CsrArray<T>>
Sourcefn to_coo(&self) -> SparseResult<CooArray<T>>
fn to_coo(&self) -> SparseResult<CooArray<T>>
Sourcefn to_sym_csr(&self) -> SparseResult<SymCsrArray<T>>
fn to_sym_csr(&self) -> SparseResult<SymCsrArray<T>>
Sourcefn to_sym_coo(&self) -> SparseResult<SymCooArray<T>>
fn to_sym_coo(&self) -> SparseResult<SymCooArray<T>>
Provided Methods§
Sourcefn is_symmetric(&self) -> bool
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§
impl<T> SymSparseArray<T> for SymCooArray<T>
Implementation of SymSparseArray for SymCooArray
impl<T> SymSparseArray<T> for SymCsrArray<T>
Implementation of SymSparseArray for SymCsrArray