lazymatrix::SparseColumns
LazyMatrix for Rust · 0.8.1
rust
pub trait SparseColumns<F: Scalar>: MatrixShapeBorrowed 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])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
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]>
