Skip to content

lazymatrix::IndexedRowSource ​

LazyMatrix for Rust · 0.9.0

Source

rust
pub trait IndexedRowSource<F: Scalar>: MatrixShape + MatrixErrorType

Native traversal of a raw matrix restricted to indexed rows.

This is an operational capability, not borrowed access. Implementations may allocate bounded workspace or return a storage error. In-memory adapters visit dense entries directly, filter CSC columns, or visit selected CSR rows.

Associated constants ​

IS_DENSE ​

rust
const IS_DENSE: bool = false;

Source

Whether traversal visits every selected cell, including zeros.

Dense adapters set this to preserve directly centered products. Sparse sources should retain the default even when every cell happens to be stored.

Methods ​

for_each_indexed_entry ​

rust
fn for_each_indexed_entry(
    &self,
    rows: &[usize],
    visit: impl FnMut(usize, usize, F)
) -> Result<(), <Self as MatrixErrorType>::Error>

Source

Visit selected logical entries as (local row, column, value).

rows must contain strictly increasing, unique indices below nrows. Row i in the result corresponds to source row rows[i]. Omitted cells are zero. Visit each stored cell once, summing duplicate raw entries in storage order before calling visit. Empty selections perform no reads. Traversal order across cells is unspecified.

Errors ​

Returns the source error; the visitor may already have received entries.

Implementation of IndexedRowSource ​

Source

rust
impl<M: IndexedRowSource<F>, F: Scalar> IndexedRowSource<F> for IndexedRows<'_, M, F>

Implementation of IndexedRowSource ​

Source

rust
impl<M: lazymatrix::IndexedRowSource<F>, F: Scalar> IndexedRowSource<F> for SprsCsc<M>

Implementation of IndexedRowSource ​

Source

rust
impl<M: lazymatrix::IndexedRowSource<F>, F: Scalar> IndexedRowSource<F> for SprsCsr<M>

Released under the MIT and Apache 2.0 licenses.