Skip to content
API REFERENCEUsage guides →

cellpack::scans::MatrixRef ​

enum

Module contract · All interfaces

At a glance ​

pub enum MatrixRef<'a> {
    Csr(CsrRef<'a>),
    CsrView(CsrView<'a>),
    Dense(DenseRef<'a>),
}

Borrowed inputs, selections and encoding options. An input matrix. Its form does not decide how rows are stored: every row is stored sparse or dense by its own size (see LayoutChoice).

Fields and variants ​

Csr ​

Csr(CsrRef<'a>)

CSR with u64 offsets.

CsrView ​

CsrView(CsrView<'a>)

CSR with offsets in the caller’s integer type.

Dense ​

Dense(DenseRef<'a>)

Row-major dense.

Member index ​

4 of 4 members

  • n_genesValues per row of the matrix.
  • value_widthBytes per value.
  • n_rowsRows the matrix claims, not counting a partial dense row.
  • rowRow row , checked against the matrix’s own bounds.

Methods and associated constants ​

n_genes ​

pub fn n_genes(&self) -> u32

Values per row of the matrix.

value_width ​

pub fn value_width(&self) -> usize

Bytes per value.

n_rows ​

pub fn n_rows(&self) -> usize

Rows the matrix claims, not counting a partial dense row.

row ​

pub fn row(&self, row: usize) -> Result<RowRef<'a>>

Row row, checked against the matrix’s own bounds.

Implemented traits ​

impl<'a> Clone for MatrixRef<'a>
impl<'a> Debug for MatrixRef<'a>
impl<'a> From<&CsrRef<'a>> for MatrixRef<'a>
impl<'a> From<&DenseRef<'a>> for MatrixRef<'a>
impl<'a> From<CsrRef<'a>> for MatrixRef<'a>
impl<'a> From<CsrView<'a>> for MatrixRef<'a>
impl<'a> From<DenseRef<'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