Expand description
Sparse matrix formats, sparse operations and helpers to transform different formats into each other. Free of any dense linear algebra dependency.
Structs§
- Compressed
Sparse Data2 - Structure to store compressed sparse data with two potential data layers. Think for example in single cell raw counts and normalised counts.
- Scatter
Ptr - Destination pointer handed to every worker of the parallel scatter.
- Sparse
Axis - Generate structure to store sparse rows or columns
Enums§
- Compressed
Sparse Format - Type to describe the CompressedSparseFormat
Functions§
- coo_
to_ csr - Transform COO stored data into CSR
- coo_
to_ csr_ presorted - Optimised COO to CSR - assumes input is already sorted by (row, col)
- csr_
matmul_ csr - Multiply two CSR matrices using sparse accumulators and parallel processing
- csr_
matvec - Sparse matrix @ dense vector:
M @ v. - csr_
vecmat - Dense vector @ sparse matrix:
v @ M. - eliminate_
zeros_ csr - Remove zeros from sparse matrix
- normalise_
csr_ columns_ l1 - Normalises the columns of a CSR matrix to a sum of 1 (L1 norm)
- normalise_
csr_ rows_ l1 - Normalises the rows of a CSR matrix to a sum of 1 (L1 norm)
- parse_
compressed_ sparse_ format - Helper function to parse compressed sparse format
- require_
csc - Fail unless the matrix is stored as CSC.
- require_
csr - Fail unless the matrix is stored as CSR.
- require_
matmul_ operands - Check that two CSR matrices can be multiplied,
a @ b. - sparse_
add_ csr - Add two CSR matrices together
- sparse_
multiply_ elementwise_ csr - Element-wise sparse multiplication
- sparse_
scalar_ multiply_ csr - Scalar multiplication of CSR matrix
- sparse_
subtract_ csr - Sparse matrix subtraction
- thread_
chunks - Split
0..ninto one contiguous range per rayon worker. - transpose_
sparse - Re-express a compressed sparse matrix in the other format (CSC→CSR or CSR→CSC).
- transpose_
sparse_ single_ layer - Transpose a compressed sparse matrix (CSC→CSR or CSR→CSC), keeping only one of the two data layers.
- undirected_
edges_ to_ csr - Scatter a sorted undirected edge list into a symmetric CSR adjacency
- validate_
square_ csr - Check that a matrix is a structurally sound square CSR and return its order