Skip to content

lazymatrix::SparseColumns ​

LazyMatrix for Rust · 0.8.1

Source

rust
pub trait SparseColumns<F: Scalar>: MatrixShape

Borrowed access to columns stored contiguously in sparse form.

Implement this capability only when a backend can return the stored row indices and values for one column as slices without gathering or copying. Structurally absent entries are implicit zeros.

Methods ​

sparse_column ​

rust
fn sparse_column(&self, j: usize) -> (&[usize], &[F])

Source

Return the stored (row index, raw value) slices for column j.

The two slices have equal length and corresponding entries. Explicitly stored zeros remain present.

Panics ​

Panics if j >= self.ncols().

Implementation of SparseColumns ​

Source

rust
impl<F, IP, IS, DS, Iptr> SparseColumns<F> for SprsCsc<sprs::CsMatBase<F, usize, IP, IS, DS, Iptr>> where F: Scalar, Iptr: SpIndex, IP: Deref<Target = [Iptr]>, IS: Deref<Target = [usize]>, DS: Deref<Target = [F]>

Released under the MIT and Apache 2.0 licenses.