Skip to main content

SparseOps

Trait SparseOps 

Source
pub trait SparseOps<T> {
    // Required methods
    fn sum_values(&self) -> T;
    fn elementwise_mul_dense(&self, dense: &[T], out_values: &mut [T]);
}
Expand description

Unified trait for elementwise and reduction operations on sparse matrices.

Required Methods§

Source

fn sum_values(&self) -> T

Compute the sum of all elements stored in the sparse matrix.

Source

fn elementwise_mul_dense(&self, dense: &[T], out_values: &mut [T])

Elementwise multiply the sparse matrix values by corresponding entries in a dense matrix, writing the results to out_values.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, T, Arch> SparseOps<T> for SparseView<'a, T, Csr, Arch>
where T: Scalar, Arch: SimdArch + SimdKernel<T>,

Source§

impl<'a, T, Arch> SparseOps<T> for SparseView<'a, T, DenseWithMask, Arch>
where T: Scalar, Arch: SimdArch + SimdKernel<T>,

Source§

impl<'a, T, F, Arch> SparseOps<T> for SparseCow<'a, T, F, Arch>
where T: Scalar, F: CowFormat, Arch: SimdArch, for<'b> SparseView<'b, T, F, Arch>: SparseOps<T>,

Source§

impl<'a, T, const BM: usize, const BN: usize, Arch> SparseOps<T> for SparseView<'a, T, BlockedCoo<BM, BN>, Arch>
where T: Scalar, Arch: SimdArch + SimdKernel<T>,

Source§

impl<'a, T, const C: usize, Arch> SparseOps<T> for SparseView<'a, T, SellP<C>, Arch>
where T: Scalar, Arch: SimdArch + SimdKernel<T>,