lazymatrix::IndexedRowSource
LazyMatrix for Rust · 0.9.0
pub trait IndexedRowSource<F: Scalar>: MatrixShape + MatrixErrorTypeNative 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
const IS_DENSE: bool = false;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
fn for_each_indexed_entry(
&self,
rows: &[usize],
visit: impl FnMut(usize, usize, F)
) -> Result<(), <Self as MatrixErrorType>::Error>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
impl<M: IndexedRowSource<F>, F: Scalar> IndexedRowSource<F> for IndexedRows<'_, M, F>Implementation of IndexedRowSource
impl<M: lazymatrix::IndexedRowSource<F>, F: Scalar> IndexedRowSource<F> for SprsCsc<M>Implementation of IndexedRowSource
impl<M: lazymatrix::IndexedRowSource<F>, F: Scalar> IndexedRowSource<F> for SprsCsr<M>
