Skip to main content

Module csr

Module csr 

Source
Expand description

CSR (Compressed Sparse Row) sparse layout element lookup.

Implements element lookup from docs/spec/layouts/csr.md: within a row, the stored column indices are strictly increasing, so a non-zero is found by binary-searching the row’s slice of col_indices. Mirrors the standalone-function API validated by super::csf::element_offset.

Functions§

element_offset
Looks up the storage offset (values / col_indices buffer index) of logical index (row, col) in a CSR matrix, or returns None if the element is a structural zero.