pub enum SparseFormat {
COO,
CSR,
CSC,
BSR,
DIA,
ELL,
}Expand description
Sparse tensor storage formats
Variants§
COO
Coordinate format: stores (indices, values) pairs Memory: O(nnz) for indices + values Good for: construction, element access
CSR
Compressed Sparse Row format Memory: O(nnz) values + O(nnz) column indices + O(rows+1) row pointers Good for: matrix-vector multiplication, row access
CSC
Compressed Sparse Column format Memory: O(nnz) values + O(nnz) row indices + O(cols+1) column pointers Good for: matrix-vector multiplication (transposed), column access
BSR
Block Sparse Row format for structured sparsity Good for: GPU acceleration, structured pruning
DIA
Diagonal format for diagonal and band matrices Good for: diagonal matrices, finite difference operators
ELL
ELLPack format for GPU-optimized sparse operations Good for: GPU kernels with regular sparsity patterns
Implementations§
Source§impl SparseFormat
impl SparseFormat
Sourcepub fn supports_row_access(self) -> bool
pub fn supports_row_access(self) -> bool
Check if format supports efficient row access
Sourcepub fn supports_column_access(self) -> bool
pub fn supports_column_access(self) -> bool
Check if format supports efficient column access
Sourcepub fn is_gpu_friendly(self) -> bool
pub fn is_gpu_friendly(self) -> bool
Check if format is suitable for GPU operations
Trait Implementations§
Source§impl Clone for SparseFormat
impl Clone for SparseFormat
Source§fn clone(&self) -> SparseFormat
fn clone(&self) -> SparseFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SparseFormat
impl Debug for SparseFormat
Source§impl Display for SparseFormat
impl Display for SparseFormat
Source§impl Hash for SparseFormat
impl Hash for SparseFormat
Source§impl PartialEq for SparseFormat
impl PartialEq for SparseFormat
impl Copy for SparseFormat
impl Eq for SparseFormat
impl StructuralPartialEq for SparseFormat
Auto Trait Implementations§
impl Freeze for SparseFormat
impl RefUnwindSafe for SparseFormat
impl Send for SparseFormat
impl Sync for SparseFormat
impl Unpin for SparseFormat
impl UnwindSafe for SparseFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more