Skip to content
API REFERENCEUsage guides →

cellpack::scans::CsrRef ​

struct

Module contract · All interfaces

At a glance ​

pub struct CsrRef<'a> {
    pub n_genes: u32,
    pub value_width: usize,
    pub indptr: &'a [u64],
    pub indices: Indices<'a>,
    pub data: &'a [u8],
}

Borrowed inputs, selections and encoding options. A canonical CSR matrix: every row’s indices strictly ascending and below n_genes; data holds value_width little-endian bytes per element. Values are opaque bit patterns, so any 1/2/4/8-byte type round-trips.

Fields and variants ​

n_genes ​

n_genes: u32

Genes each row may name (ids lie in 0..n_genes).

value_width ​

value_width: usize

Bytes per value: 1, 2, 4 or 8.

indptr ​

indptr: &'a [u64]

n_rows + 1 row offsets.

indices ​

indices: Indices<'a>

Gene indices of every row, in row order.

data ​

data: &'a [u8]

Value bytes, value_width per index.

Member index ​

1 of 1 members

  • n_rowsRows the offsets describe; an empty indptr has none.

Methods and associated constants ​

n_rows ​

pub fn n_rows(&self) -> usize

Rows the offsets describe; an empty indptr has none.

Implemented traits ​

impl<'a> Clone for CsrRef<'a>
impl<'a> Debug for CsrRef<'a>
impl<'a> From<&CsrRef<'a>> for MatrixRef<'a>
impl<'a> From<CsrRef<'a>> for MatrixRef<'a>

Contract reference ​

See the module reference for semantic input/output rules, units, allocation, mutation, failure behavior, and lifetime requirements. Declarations and documented members are synchronized from the crate source.

Definition