pub struct SparseOps;Implementations§
Source§impl SparseOps
impl SparseOps
Sourcepub fn from_triplets_u32(
nrows: usize,
ncols: usize,
triplets: Vec<(usize, usize, u32)>,
) -> Result<CsrMatrix<u32>>
pub fn from_triplets_u32( nrows: usize, ncols: usize, triplets: Vec<(usize, usize, u32)>, ) -> Result<CsrMatrix<u32>>
Create CSR matrix from COO format using nalgebra_sparse native conversion
Sourcepub fn from_triplets(
nrows: usize,
ncols: usize,
triplets: Vec<(usize, usize, u8)>,
) -> Result<CsrMatrix<u8>>
pub fn from_triplets( nrows: usize, ncols: usize, triplets: Vec<(usize, usize, u8)>, ) -> Result<CsrMatrix<u8>>
Create CSR matrix from triplets with u8 values
Sourcepub fn add_matrices(
a: &CsrMatrix<u32>,
b: &CsrMatrix<u32>,
) -> Result<CsrMatrix<u32>>
pub fn add_matrices( a: &CsrMatrix<u32>, b: &CsrMatrix<u32>, ) -> Result<CsrMatrix<u32>>
Highly optimized matrix addition using nalgebra_sparse’s spadd operation
Sourcepub fn filter_columns_u32(
matrix: &CsrMatrix<u32>,
keep_indices: &[usize],
) -> Result<CsrMatrix<u32>>
pub fn filter_columns_u32( matrix: &CsrMatrix<u32>, keep_indices: &[usize], ) -> Result<CsrMatrix<u32>>
Optimized column filtering using sparsity pattern operations
Sourcepub fn compute_row_sums(matrix: &CsrMatrix<u32>) -> Vec<u32>
pub fn compute_row_sums(matrix: &CsrMatrix<u32>) -> Vec<u32>
Optimized row sums using native CSR structure access
Sourcepub fn compute_col_sums(matrix: &CsrMatrix<u32>) -> Vec<u32>
pub fn compute_col_sums(matrix: &CsrMatrix<u32>) -> Vec<u32>
Optimized column sums using parallel reduction over CSR structure
Sourcepub fn element_wise_multiply(
a: &CsrMatrix<u32>,
b: &CsrMatrix<u8>,
) -> Result<CsrMatrix<u32>>
pub fn element_wise_multiply( a: &CsrMatrix<u32>, b: &CsrMatrix<u8>, ) -> Result<CsrMatrix<u32>>
Element-wise multiplication using optimized two-pointer algorithm for sparse matrices
This implementation uses a sorted two-pointer merge algorithm which is significantly faster than HashMap-based intersection for sparse matrices. CSR format guarantees column indices are already sorted within each row, allowing O(nnz_a + nnz_b) complexity instead of O(nnz_a * log(nnz_b)) with HashMap lookups.
Sourcepub fn transpose_u32(matrix: &CsrMatrix<u32>) -> CsrMatrix<u32>
pub fn transpose_u32(matrix: &CsrMatrix<u32>) -> CsrMatrix<u32>
Transpose operation using nalgebra_sparse native transpose
Auto Trait Implementations§
impl Freeze for SparseOps
impl RefUnwindSafe for SparseOps
impl Send for SparseOps
impl Sync for SparseOps
impl Unpin for SparseOps
impl UnwindSafe for SparseOps
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.